Skip to content

Instantly share code, notes, and snippets.

@mikesplain
Last active August 29, 2015 14:08
Show Gist options
  • Save mikesplain/c6041676ef6ae0b30c27 to your computer and use it in GitHub Desktop.
Save mikesplain/c6041676ef6ae0b30c27 to your computer and use it in GitHub Desktop.
after_success:
- git config --global user.email "[email protected]"
- git config --global user.name "Travis CI"
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- ssh-add travis-openstack-clients-cookbook
- echo -n $RELEASE_{00..30} >> release_base64
- base64 --decode --ignore-garbage release_base64 > release.pem
!/bin/bash
# travis_ssh_key_encrypt_for_mac.ssh
# Encrypts private SSH keys for use in .travis.yml.
# Based on the excellent linux version:
# https://gist.github.com/lukewpatterson/4242707
# Also see the travis documentation:
# http://docs.travis-ci.com/user/build-configuration/#Secure-environment-variables
# Usage:
# Go to your git project:
# cd my_project
# Then run:
# ./travis_key_encrypt.sh ~/.ssh/my_private_key
SSH_KEY_PATH=$1
base64 --break 64 ${SSH_KEY_PATH} > ${SSH_KEY_PATH}_base64
if [[ ! $(which travis) ]]
then
gem install travis
fi
travis login --pro --auto
for l in $(cat ${SSH_KEY_PATH}_base64);
do
LINE=$(grep -n $l ${SSH_KEY_PATH}_base64 | cut -d: -f1);
echo "- secure: $(travis encrypt \"RELEASE_$LINE=$l\")";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment