```- /bin/cd /path/to/working/dir``` does not work in .gitlab-ci.yml

Rather than use a bash script to deploy my code, I just want to run the few necessary commands using the script section of my deploy job.

With a shell gitlab-runner instance, I do something like this in my .gitlab-ci.yml file:

deploy_stage:
  stage: deploy_stage
  script:
    - pwd; /bin/rsync --progress -avz --delete --exclude=".git/" . /srv/blah
    - pwd; /bin/cd /srv/blah
    - pwd; /bin/docker-compose pull
    - pwd; /bin/docker-compose stop
    - pwd; /bin/docker-compose up -d --force-recreate
  only:
    - test
  tags:
    - deploy_stage

pwd always returns the path of the gitlab-runner checkout. /home/gitlab-runner/builds/c4699e3f/0/group/project.

Why isn’t is returning /srv/blah after I cd into that directory?

Thanks!

Erm… /bin/cd is an invalid path… That explains why it was not changing directory. Though, i have to wonder why no error was output… Anyway, problem solved. A good nights sleep helps a lot.