Skip to content

Commit

Permalink
Fix styles?
Browse files Browse the repository at this point in the history
  • Loading branch information
roidrage committed Aug 13, 2012
1 parent cdfaed3 commit 1c86591
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions docs/user/travis-pro.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,9 @@ Below are the steps required to encrypt and decrypt data.
`curl -u <username> https://api.github.com/repos/<username>/<repo>/keys`
Look for a key named travis-ci.com in the JSON outpt and copy the string that
contains the public key into a file `id_travis.pub`. Here's a handy one-liner
that does it for you:
`curl -u <username> https://api.github.com/repos/<username>/<repo>/keys | grep -B 4 travis-ci\\.com | grep '"key":' | perl -pe 's/^[ ]+"key": //; s/^"//; s/",$//' > id_travis.pub`
* Extract a public key certificate from the public key:
`ssh-keygen -e -m PKCS8 -f id_travis.pub > id_travis.pub.pem`
* Now you can encrypt a file, let's call it config.xml:
`openssl rsautl -encrypt -pubin -inkey id_travis.pub.pem -in config.xml -out config.xml.enc`
that does it for you: `curl -u <username> https://api.github.com/repos/<username>/<repo>/keys | grep -B 4 travis-ci\\.com | grep '"key":' | perl -pe 's/^[ ]+"key": //; s/^"//; s/",$//' > id_travis.pub`
* Extract a public key certificate from the public key: `ssh-keygen -e -m PKCS8 -f id_travis.pub > id_travis.pub.pem`
* Now you can encrypt a file, let's call it config.xml: `openssl rsautl -encrypt -pubin -inkey id_travis.pub.pem -in config.xml -out config.xml.enc`
* Add the file to your Git repository.
* For the build to decrypt the file, add a `before_script` section to your
`.travis.yml` that runs the opposite command of the above:
`before_script: openssl rsautl -decrypt -inkey ~/.ssh/id_rsa -in config.xml.enc -out config.xml`
`.travis.yml` that runs the opposite command of the above: `before_script: openssl rsautl -decrypt -inkey ~/.ssh/id_rsa -in config.xml.enc -out config.xml`

0 comments on commit 1c86591

Please sign in to comment.