Hi, I just set up a pipeline with rsync pipe. The code looks like this:
pipelines:
branches:
master:
- step:
script:
- pipe: atlassian/rsync-deploy:0.4.2
variables:
USER: 'myuser'
SERVER: 'www.mysite.com'
REMOTE_PATH: '/someuri/htdocs'
LOCAL_PATH: '$BITBUCKET_CLONE_DIR/htdocs/*'
EXTRA_ARGS: '-avz'
- apt-get update -y
- apt-get install -y ssh
- ssh myuser@www.mysite.com "sudo chmod -R 755 /someuri/htdocs/ && sudo chmod -R 775 /someuri/htdocs/wp-content/ && sudo chown -R myuser:group /someuri/htdocs/"
I have 2 issues here and ask for your kind advice:
1. As the USER and SERVER variables are already declared above, is there a way to use them in ssh statement below?
2. For some reason, rsync changes owner and permissions to my files in the remote host. I thought passing EXTRA_ARGS: -avz would help, but it did not. Any thoughts?