From charlesreid1

No edit summary
 
Line 1: Line 1:
Main Travis page: [[Travis]]
Set up Travis to perform releases by modifying travis.yml
Set up Travis to perform releases by modifying travis.yml



Latest revision as of 10:32, 27 November 2017

Main Travis page: Travis

Set up Travis to perform releases by modifying travis.yml

Choices:

  • Should travis build/upload a release with every commit? or only with tagged commits?

Oh yeah, then there's OAuth.

OAuth Process

Travis can use encrypted environment variables, so to give Travis (and only Travis) access to your Github account, and to put those details into your travis.yml file (which will be public), you can do the following:

  • Log in to Github
  • Open Settings, then open the Applications tab
  • Add an API token
  • Encrypt your API token using travis encrypt command

Example command to run from the same directory as your travis.yml file:

travis encrypt GH_OAUTH=2345abc123abc5555abcde2345ccc384838483848abcde --add env.global

More info on Travis encryption keys: https://docs.travis-ci.com/user/encryption-keys/

Encrypting arbitrary data

Any key in a travis.yml can be encrypted.

The secure variable system will turn any key-value pair of the form {'secure' : 'encrypted_string'} and replace it with the decrypted string.

So

notifications:
  campfire:
    rooms:
      secure: "encrypted string"

becomes

notifications:
  campfire:
    rooms: "decrypted string"

while

notifications:
  campfire:
    rooms:
      - secure: "encrypted string"

becomes

notifications:
  campfire:
    rooms:
      - "decrypted string"

In the case of secure env vars

env:
  - secure: "encrypted string"

becomes

env:
  - "decrypted string"