I am using CD for deploying my code to a VPS. This VPS is running ubuntu 16.04 and has a user 'deployer'.
Now when I use ssh deployer@server
I get shell access to the server and then when using cd /var/www
I get into the /var/www
directory.
When I do this from the deployment script, defined in .gitlab-ci.yml I get this error /bin/bash: line 101: cd: /var/www/data/: No such file or directory
. I also did ls -al
to view the directory structure of /var
which turned out not to contain the www
directory. So clearly now I have no permission to the www
directory.
- rsync -avz --exclude=.env . deployer@devvers.work:/var/www/data/staging/home
- ssh deployer@devvers.work
- cd /var
- ls -al
- cd /var/www
Tthis is the part of the script where it fails. Does anyone know why my user has different permissions when using ssh from the terminal then when using ssh in this script? Coping the files with rsync
when fine and all the files were copied.