Skip to content

Commit

Permalink
CI setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ntxbot committed Sep 13, 2016
1 parent b318807 commit 5469b10
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sudo: required

language: python

services:
- docker

deploy:
provider: script
script: ./deploy.sh
on:
branch: unicef
Binary file added .travis/deploy_key.enc
Binary file not shown.
13 changes: 13 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
[ "$CI_BUILD_REF_NAME" = "" ] && CI_BUILD_REF_NAME=$(git symbolic-ref --short -q HEAD)

if [ "$CI_BUILD_REF_NAME" = "unicef" ]; then
docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
docker push institutotim/zup-web:$CI_BUILD_REF_NAME
mkdir -p ~/.ssh
SSH_DEPLOY_KEY=~/.ssh/id_rsa
openssl aes-256-cbc -K $encrypted_b1f0a4911acd_key -iv $encrypted_b1f0a4911acd_iv -in .travis/deploy_key.enc -out $SSH_DEPLOY_KEY -d
chmod 600 $SSH_DEPLOY_KEY
ssh -i $SSH_DEPLOY_KEY -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $DEPLOY_TARGET "docker pull institutotim/zup-web:$CI_BUILD_REF_NAME; supervisorctl restart zup-web"
cleanup
fi

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion zup-painel/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
<![endif]--><!-- Sentry Configuration --><script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places,geometry&language=pt-br"></script><script src="assets/scripts/vendor.f73396b4.js"></script><script>Raven.config('SENTRY_DSN', {}).install();</script><script type="text/javascript">function load() {
gapi.client.setApiKey('GOOGLE_ANALYTICS_KEY');
gapi.client.load('urlshortener', 'v1');
}</script><script src="https://apis.google.com/js/client.js?onload=load"></script><script src="config/main.constants.js"></script><script src="assets/scripts/scripts.1778e48d.js"></script></body></html>
}</script><script src="https://apis.google.com/js/client.js?onload=load"></script><script src="config/main.constants.js"></script><script src="assets/scripts/scripts.427cd27e.js"></script></body></html>

0 comments on commit 5469b10

Please sign in to comment.