hello i am trying to push files from bitbucket to an aws lightsail instance. I am using rsync in my pipeline file. I have set up a specific user and added the repository public ssh key to the authorized_keys file on the lightsail instance. I keep getting a permission denied fault. I think that bitbucket is not specifying the private ssh key when it tries to connect. I am not sure why. here is the line in my pipeline yaml file that does the rsync deployment. Do i need to specify the location of the private key in this line?
Hi @shanedara
Thanks for your question!
It is a good case for the Bitbucket Pipe usage!
As an example, you could use atlassian/rsync-deploy pipe:
Deploy your code to any server over ssh using rsync. By default it will upload the whole directory to the target. Rsync is famous for its delta-transfer algorithm, which reduces the amount of data sent over the network by sending only the differences between the source files and the existing files in the destination.
By default, the RSYNC pipe will automatically use your configured SSH key and known_hosts file configured from the Bitbucket Pipelines administration pages. You can pass the
SSH_KEY
parameter to use an alternate SSH key as per the instructions in the docs for using multiple ssh keys
script: - pipe: atlassian/rsync-deploy:0.12.0 variables: USER: 'ec2-user' SERVER: '127.0.0.1' REMOTE_PATH: '/var/www/build/' LOCAL_PATH: 'build' DEBUG: 'true' EXTRA_ARGS: - "--filter=P assets/css" # double quotes here are necessary - "--exclude=*.txt"
To discover more pipes, visit our Bitbucket Pipes Marketplace.
Best regards,
Oleksandr Kyrdan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.