Skip to content

Commit

Permalink
chore(travis): Add encrypted private ssh key
Browse files Browse the repository at this point in the history
  • Loading branch information
evenstensberg committed May 7, 2018
1 parent 2091d1c commit bb181a1
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
test
coverage
lib
.travis.yml
.eslintrc*
.fitcommitjsrc.json
.vscode
.editorconfig
.eslintignore
__testfixtures__
*.test.js
*.input.js
types.js
*.spec.js
docs
jsdoc.json
.appveyor.yml
.codecov.yml
*.snap
open-bot.yml
.nyc_output
git_deploy_key.enc
*.md
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,21 @@ matrix:
env: JOB_PART=integration

before_install:
# Decrypt the git_deploy_key.enc key into /tmp/git_deploy_key
- openssl aes-256-cbc -K $encrypted_04be16cef0a7_key -iv $encrypted_04be16cef0a7_iv -in git_deploy_key.enc -out /tmp/git_deploy_key -d
# Make sure only the current user can read the private key
- chmod 600 /tmp/git_deploy_key
# Create a script to return the passphrase environment variable to ssh-add
- 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" setsid ssh-add /tmp/git_deploy_key </dev/null

- npm i -g npm@latest
- npm ci
- npm install -g codecov
- npm install -g eslint

jobs:
include:
- stage: commit lint
Expand Down
Binary file added git_deploy_key.enc
Binary file not shown.

0 comments on commit bb181a1

Please sign in to comment.