Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): Add encrypted ssh key for semantic-release #20

Merged
merged 2 commits into from
Apr 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ cache: yarn
# Temporarily also run the build script to make sure it works
# (will move this to the release step once that's implemented)
script: yarn run validate && yarn run build

deploy:
provider: script
skip_cleanup: true
script:
- bash _scripts/deploy_key_decrypt.sh
15 changes: 15 additions & 0 deletions _scripts/deploy_key_decrypt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
# Decrypt Github Deploy key for the Semantic Release package to be able to push tags
# Ubuntu-14.04

# Make sure only the current user can read the private key-
/usr/bin/openssl aes-256-cbc -K "${encrypted_ba12a3340263_key}" -iv "${encrypted_ba12a3340263_iv}" -in git_deploy_key.enc -out /tmp/git_deploy_key -d
# Make sure only the current user can read the private key
/bin/chmod 600 /tmp/git_deploy_key
# Create a script to return the passphrase environment variable to ssh-add
/bin/echo 'echo ${SSH_PASSPHRASE}' > /tmp/askpass && chmod +x /tmp/askpass
# Start the authentication agent
eval "$(ssh-agent -s)"
# Add the key to the authentication agent
DISPLAY=":0.0" SSH_ASKPASS="/tmp/askpass" /usr/bin/setsid ssh-add /tmp/git_deploy_key </dev/null

Binary file added git_deploy_key.enc
Binary file not shown.