0xburned
0xburned

Reputation: 2655

Travis CI: How to generate .travis/deploy_key.pem key for the deployment to remote server

As mentioned in the custom deployment page on Travis CI

https://docs.travis-ci.com/user/deployment/custom/#Git

after_success:
  - eval "$(ssh-agent -s)" #start the ssh agent
  - chmod 600 .travis/deploy_key.pem # this key should have push access
  - ssh-add .travis/deploy_key.pem
  - git remote add deploy DEPLOY_REPO_URI_GOES_HERE
  - git push deploy

How do I generate .travis/deploy_key.pem key?

Is it something which I should set as an env variable?

My GitHub repo is public and I am trying to deploy the app on Upcloud platform. Since Upcloud is not pre supported by TravisCI I need to use after_success step.

Here is my travis.yml file looks so far

language: node_js
node_js:
  - "node"
os:
  - linux
script:
  - yarn test
after_script:
  # Custome upcloud script should go here. More info https://docs.travis-ci.com/user/deployment/custom/
  # For encrypting keys: https://docs.travis-ci.com/user/encrypting-files/
notifications:
  slack:
    on_failure: always

Upvotes: 1

Views: 496

Answers (0)

Related Questions