Skip to content

Instantly share code, notes, and snippets.

@carlessistare
Last active May 19, 2018 11:39
Show Gist options
  • Save carlessistare/d87751214c188e007fcb to your computer and use it in GitHub Desktop.
Save carlessistare/d87751214c188e007fcb to your computer and use it in GitHub Desktop.
Output de text to copy to .travis.yml for the splitted secured ssh private key
base64 --wrap=0 ~/.ssh/id_rsa_travis > ~/.ssh/id_rsa_travis_64
cat ~/.ssh/id_rsa_travis_64 | perl -pe 's/(.{100})/$1\n/g' | nl | perl -pe 's/\s*(\d+)\s*(.*)/echo " - secure: `travis encrypt ID_RSA_TRAVIS_$1=$2 --pro`"/' | sh
# OUTPUT
# - secure: "...="
# - secure: "...="
# - secure: "...="
# ...
# - secure: "...="
@koppor
Copy link

koppor commented Mar 29, 2017

For public repos, the --pro has to be removed. Then, it works like a charm! For the googlers hitting this gist: The upload functionality is described at https://gist.github.com/lukewpatterson/4242707

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment