Hi, I'm trying to setup my pipeline to deploy our repo to Google Compute Engine but I'm facing a few issues.
First, I can SSH in but passing commands using SSH fails.
Second, SCP is failing with the error `No such file or directory`.
This is my pipeline:
- ssh -i ~/.ssh/config my-bitbucket-username@<IP> 'Gracefully shutdown'
- scp -r -i ~/.ssh/config ~/ my-bitbucket-username@<IP>:~/
- ssh -i ~/.ssh/config my-bitbucket-username@<IP> 'Do a bunch of stuff'
1. The first ssh command fails, but if I don't pass a command, it succeeds
2. The scp fails with ` No such file or directory`. I've even tried to pass the path that was output from the build setup, `Cloning into '/opt/atlassian/pipelines/agent/build'...`
What am I doing wrong here?
1. What you send in as argument to "SSH" needs to be a command. You need a command like:
ssh username@<IP> 'echo "Gracefully shutdown"'
2. Are you trying to copy your entire home directory to the target machine? Usually, you give a name on both source and target:
scp -r ~/mysourcedir username@<IP>:~/mydestinationdir
Thanks for jumping in Nova but I do pass a series of commands. That was just filler text. For anyone that wants to figure it out, read the docs closely. You'll need to pass the bitbucket username to the public key and then copy that to the VM. That's where I went wrong, and it is in the pipelines docs but took a while to spot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mike Hardy would you have an example of this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mike, I am struggling in doing the same, I get the "No such file or directory" whatever I do and I pass (relative or absolute path) .
I didn't understand your comment about : "You'll need to pass the bitbucket username to the public key and then copy that to the VM"
Can you elaborate a bit more?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.