Skip to content

Commit

Permalink
Merge pull request #136 from datosgobar/73-agregar-cd
Browse files Browse the repository at this point in the history
73 agregar cd
  • Loading branch information
poligarcia authored Jan 5, 2018
2 parents 4debcb5 + 6314dff commit 51c46b2
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 15 deletions.
46 changes: 31 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,48 @@
sudo: required

services:
- docker
- docker

language: python
python:
- "2.7"
- "2.7"

env:
- DJANGO_SETTINGS_MODULE=conf.settings.testing
- DJANGO_SETTINGS_MODULE=conf.settings.testing

before_install:
- docker-compose pull
- docker-compose up -d elasticsearch redis
- docker-compose ps
- docker-compose pull
- docker-compose up -d elasticsearch redis
- docker-compose ps

install:
- pip install -r requirements/testing.txt
- nvm install v7.4.0
- nvm use v7.4.0
- npm install

- pip install -r requirements/testing.txt
- nvm install v7.4.0
- nvm use v7.4.0
- npm install

script:
- npm run jsc
- scripts/tests.sh
- scripts/pylint.sh
- scripts/pycodestyle.sh
- npm run jsc
- scripts/tests.sh
- scripts/pylint.sh
- scripts/pycodestyle.sh

after_success:
- coveralls

before_deploy:
- ssh-keyscan -p $DEPLOY_TARGET_SSH_PORT -t 'rsa,dsa,ecdsa' -H $DEPLOY_TARGET_IP 2>&1 | tee -a $HOME/.ssh/known_hosts
- openssl aes-256-cbc -K $encrypted_ae74091d1bce_key -iv $encrypted_ae74091d1bce_iv -in deploy/build\[email protected] -out /tmp/build\[email protected] -d
- eval "$(ssh-agent -s)"
- chmod 600 /tmp/build\[email protected]
- ssh-add /tmp/build\[email protected]
- openssl aes-256-cbc -K $encrypted_f201276fd578_key -iv $encrypted_f201276fd578_iv -in deploy/vault_pass.txt.enc -out /tmp/vault_pass.txt -d
- scp -P $DEPLOY_TARGET_SSH_PORT /tmp/vault_pass.txt $DEPLOY_TARGET_USERNAME@$DEPLOY_TARGET_IP:~/series-tiempo-ar-deploy/
- rm /tmp/vault_pass.txt

deploy:
skip_cleanup: true
provider: script
script: scripts/deploy.sh
on:
branch: master
Binary file added deploy/[email protected]
Binary file not shown.
1 change: 1 addition & 0 deletions deploy/vault_pass.txt.enc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
j�ACRrn�D��ݢ�c�Y����h���)
Expand Down
9 changes: 9 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

echo "Ejecutando comando de instalación..."
ssh $DEPLOY_TARGET_USERNAME@$DEPLOY_TARGET_IP -p$DEPLOY_TARGET_SSH_PORT "\
cd ~/series-tiempo-ar-deploy &&\
git pull &&\
source ./env/bin/activate &&\
ansible-playbook -i inventories/testing/hosts --vault-password-file vault_pass.txt site.yml -vvv &&\
rm -f vault_pass.txt"

0 comments on commit 51c46b2

Please sign in to comment.