I've set up a SSH key within my pipelines settings and got the server admin to add the public key on the server. I've then added the known hosts to get a fingerprint.
Question is how do i reference this key in my build scripts? I usually use gulp to FTP files up to a remote server and i've found some gulp ssh packages.
Can i store this key as an environment variable as i have done for the FTP stuff?
I cracked this yesterday. Looks like i can't use gulp ssh as it can't access the filesystem remotely. not sure if this is true?
I used rsync directly in the bitbucket pipelines script
```- rsync -azvvP --omit-dir-times --no-perms ./build/ {username}@{host}:/{remotepath} ```
For example in my build scripts it asks a reference to the ssh key
var config = { host: '192.168.0.21', port: 22, username: 'node', privateKey: fs.readFileSync('/Users/zensh/.ssh/id_rsa')}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.