Skip to content

Commit

Permalink
Decrypt variables on master only.
Browse files Browse the repository at this point in the history
* Move deployment into separate script.
* Resolves #136.
  • Loading branch information
k-nut authored and johnjohndoe committed Nov 7, 2016
1 parent 8d9ce5a commit eab38e7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
8 changes: 1 addition & 7 deletions .travis.yml
Expand Up @@ -3,11 +3,6 @@ language: python
python:
- '2.7'

before_install:
# decrypt the ssh key that is used for deployment
- openssl aes-256-cbc -K $encrypted_02f86fe65d47_key -iv $encrypted_02f86fe65d47_iv
-in markt_deploy_id_rsa.enc -out markt_deploy_id_rsa -d

install:
- pip install -r requirements.txt
- npm install
Expand All @@ -16,5 +11,4 @@ script:
- npm test

after_success:
# Run fabric for deployment but only if we are on the master branch and not on a pull request
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && fab deploy -i markt_deploy_id_rsa -H deploy@kiesinger.okfn.de:2207
- bash deploy.sh
11 changes: 11 additions & 0 deletions deploy.sh
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
if [[ $TRAVIS_PULL_REQUEST == "false" && $TRAVIS_BRANCH == "master" ]]; then
# Decrypt the SSH key that is used for authentication at our server
openssl aes-256-cbc -K $encrypted_02f86fe65d47_key -iv $encrypted_02f86fe65d47_iv -in markt_deploy_id_rsa.enc -out markt_deploy_id_rsa -d
# Deploy to our server using Fabric
fab deploy -i markt_deploy_id_rsa -H deploy@kiesinger.okfn.de:2207
else
echo "not a push to master, so not deploying"
exit 0
fi

0 comments on commit eab38e7

Please sign in to comment.