Why Rsync is not available and can not be installed?

Hi -
I tried this but my script still executes apt-get install rsync with each run. Please help me understand what I am doing wrong.

I also posted a new question but no response. New Question Link

Here is the yml
before_script:

- …

  • ‘which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )’
  • mkdir -p ~/.ssh
  • eval $(ssh-agent -s)
  • ‘[[ -f /.dockerenv ]] && echo -e “Host *\n\tStrictHostKeyChecking no\n\n” > ~/.ssh/config’
  • export PATH=$PATH:/usr/bin
  • which rsync || ( apt-get update -y && apt-get install rsync -y )