Travis/Releases: Difference between revisions
From charlesreid1
(Created page with "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...") |
|||
| Line 12: | Line 12: | ||
* Open Settings, then open the Applications tab | * Open Settings, then open the Applications tab | ||
* Add an API token | * Add an API token | ||
* Encrypt your API token | * Encrypt your API token using travis encrypt command | ||
Example: | Example command to run from the same directory as your travis.yml file: | ||
<pre> | <pre> | ||
| Line 20: | Line 20: | ||
</pre> | </pre> | ||
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 <code>{'secure' : 'encrypted_string'}</code> and replace it with the decrypted string. | |||
So | |||
<pre> | |||
notifications: | |||
campfire: | |||
rooms: | |||
secure: "encrypted string" | |||
</pre> | |||
becomes | |||
<pre> | |||
notifications: | |||
campfire: | |||
rooms: "decrypted string" | |||
</pre> | |||
while | |||
<pre> | |||
notifications: | |||
campfire: | |||
rooms: | |||
- secure: "encrypted string" | |||
</pre> | |||
becomes | |||
<pre> | |||
notifications: | |||
campfire: | |||
rooms: | |||
- "decrypted string" | |||
</pre> | |||
In the case of secure env vars | |||
<pre> | |||
env: | |||
- secure: "encrypted string" | |||
</pre> | |||
becomes | |||
<pre> | |||
env: | |||
- "decrypted string" | |||
</pre> | |||
[[Category:Travis]] | [[Category:Travis]] | ||
Revision as of 10:31, 27 November 2017
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"