I'm struggling to make pipeline to work. I just want Bitbucket simply update the changes to my server.
I already installed git in my server. I can ony access my server via ssh. I also already included my Host address in SSH Keys, and Fingerprint is already being displayed.
Here is my current yml configuration:
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples. # Only use spaces to indent your .yml configuration. # ----- # You can specify a custom docker image from Docker Hub as your build environment. image: samueldebruyn/debian-git pipelines: default: - step: script: - apt-get update - apt-get -qq install git-ftp - git ftp init --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://123.45.678.901/site.com/
Are the informations correct? What I'm missing?
I just want to update my server once I commit and push the files to bitbucket.
Can you guys help me?
I haven't tried it the way your are yet, but I have had success using scp:
- mkdir -p ~/.ssh
- umask 077 - echo $MY_SSH_KEY | base64 --decode > ~/.ssh/id_rsa
- scp -i ~/.ssh/id_rsa -P $SERVER_PORT -r $DIRECTORY_TRANSFER_LIST $USERNAME@$SERVER_IP_ADDRESS:~/path/to/project
Where $DIRECTORY_TRANSFER_LIST is the name of the project directory you wish to transfer
Hi @Shane Fast
Thanks for your response. When I access my server, I have the following folders: Maildir , sitename.com and logs.
So based on your example, I should use:
- scp -i ~/.ssh/id_rsa -P $SERVER_PORT -r sitename.com $USERNAME@$SERVER_IP_ADDRESS:~/sitename.com
Is this correct?
Also should I use id_rsa or this is something that I also have to change?
Yes, based on the info you provided that appears to be the correct command.
as for id_rsa - its just the standard name for the key file. You can name it whatever you want as long as its the same name as the command preceeding it:
- umask 077 - echo $MY_SSH_KEY | base64 --decode > ~/.ssh/<name of file holding my private key>
- scp -i ~/.ssh/<name of file holding my private key> -P .....
Saving it into the .ssh directory and using umask 077 are required for setting the correct permissions on the key file. Without the correct permissions on the key file any remote commands or transfers will be rejected for built in security reasons.
Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot