The documentation on Pipelines is shocking and nearly every post I have read, the user has had issues setting this up and ended up moving to Jenkins which gets recommended a lot. I would like to keep this in-house seeing as I'm already using Bitbucket.
I have successfully added my key to Bitbucket which allows me to post my local files to my Bitbucket repository.
I then enable Pipelines, create an environment variable called MY_SSH_KEY with my public ssh key, I also encoded it using the following link and pasted it into the variable.
I just can't get this to work and I'm on the verge of jumping ship as well as I've wasted a week on this.
Here's my Pipeline code
pipelines:
default:
- step:
script:
- mkdir -p ~/.ssh
- cat my_known_hosts >> ~/.ssh/known_hosts
- (umask 077 ; echo $MY_SSH_KEY | base64 --decode -i > ~/.ssh/id_rsa)
- ssh user@domain 'bash -s' < ./deploy.bashThe error I'm getting is:
+ cat my_known_hosts >> ~/.ssh/known_hosts
bash: /opt/atlassian/pipelines/agent/tmp/bashScript4585730180615321479.sh: line 16: syntax error near unexpected token `;&'
Can someone please help me to do this and not just paste a link as it's more than likely I have already read the link.