Possibility to add SSH private key for deployment

Issue #12891 resolved
Vlad Bura created an issue

I have multiple servers at digital ocean with Ubuntu and i what to authorise a public key so we we can deploy our application automatically without user and password.

Is any possibility to make like this? I don't want to store a user and a password on server and make a ssh connection.

Thx

Comments (8)

  1. Vlad Bura reporter

    Hello! Thx for your replay :) I saw your post(nice solution) and also I succed to make like this: yml file:

    pipelines: default: - step: script: # Modify the commands below to build your repository. - apt-get update - apt-get install sshpass - mvn --version - mvn clean install - chmod +x deploy.sh - ./deploy.sh

    and deploy.sh

    echo "SCP app on remote server" sshpass -p $PASSWORD scp -oStrictHostKeyChecking=no target/app.jar $USER@$IP:/$USER/app.jar echo "Restarting the kafka application" sshpass -p $PASSWORD ssh -oStrictHostKeyChecking=no $USER@$IP 'sudo service app restart' echo "DONE!!! :)"

    where user and password are ssh credentials stored in environment variable

    but i think that this solutions are "hacks" and like another pipelines on the market that feature should be made

  2. Rob Widdick

    @Vlad -- I had previously reached out to Atlassian for a solution. Their solution was to put the remote server's private key into an environment variable or to put it into a secured private variable... For numerous reasons, this just wouldn't work...

    Like CodeShip, I believe Pipelines should set a static SSH key pair and inject it into the container for use. That way we can always expect the public key on the remote host. The current solution just seems backwards to me.

  3. Joshua Tjhin Account Deactivated

    Please correct me if I'm wrong but the title should say "Possibility to add SSH private key for deployment" rather than public. Updated.

    If so, this is something we are working on. You should have the ability to generate or upload an ssh key-pair 😄

  4. Log in to comment