-
Notifications
You must be signed in to change notification settings - Fork 16
/
.travis.yml
28 lines (23 loc) · 2.29 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
sudo: required
services:
- docker
env:
global:
- CI_ENV=`bash <(curl -s https://codecov.io/env)`
matrix:
- SERVICE=ml_service
- SERVICE=nlp_service
- SERVICE=web_client
- SERVICE=backend_service
install:
- BRANCH=$(echo $TRAVIS_BRANCH | egrep "([0-9]+/|master)"); if [ ! $BRANCH ]; then exit 1; fi;
- COMMIT=$(echo $TRAVIS_COMMIT_MESSAGE | egrep "^(\[#[0-9]+\]|Merge)"); if [ ! $COMMIT ]; then exit 1; fi;
before_script: echo -e "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
script:
- "COMPOSE_FILE=ci ./cjl run --no-deps -d postgresql_db && ./cjl build $SERVICE && COMPOSE_FILE=ci ./cjl run --no-deps $CI_ENV $SERVICE"
after_success:
- if [ $TRAVIS_BRANCH == "master" ]; then sudo apt-get update -y && sudo apt-get install software-properties-common -y && sudo apt-get install sshpass ansible -y && sudo bash -c "echo \"capstone.cyberjustice.ca ansible_host=capstone.cyberjustice.ca ansible_user=$CAPSTONE_SSH_USER ansible_ssh_user=$CAPSTONE_SSH_USER ansible_pass=$CAPSTONE_SSH_PASS ansible_ssh_pass=$CAPSTONE_SSH_PASS\" >> /etc/ansible/hosts"ansible all -u "$CAPSTONE_SSH_USER" -m shell -a "cd /home/$CAPSTONE_SSH_USER/JusticeAI && echo '>>> Fetching latest commits on master <<<' && git pull && echo '>>> Removing running containers <<<' && ./cjl down && echo '>>> Removing all Docker images <<<' && ./cjl clean -y && echo '>>> Nuking the database <<<' && ./cjl reset-db -y && echo '>>> Rebuilding Docker images <<<' && ./cjl build --no-cache && echo '>>> Running new Docker images <<<' && ./cjl up -d && echo '>>> Successfully deployed Procezeus!'"; fi;
notifications:
slack:
secure: b+KgT/jROJyUBWVmXx97seP57NqK30uiqp/ZzxxsR9CvgDJFvKQtXVAtLxx3ivqUW+1/0nEyLhj3g+BEy3UOEwqnfj7X3f2LH68AdlQGPqJEUVEtieLmbJ69YSf3+UagXKRTInSmTvx+o67R+pgfrva9PvaJDIohhC2qrqfm21w15NkK5PTzwkdtPKyJBy8lCsh6Zka1iED73dtfdWidOB0tmkPmqCywz+ng/m7j9FhvCcDG9d27FbXkPno0yYL8CdhOXB6CiLzWkH6/WpX/Ay8UqEkX1HD9W2N4RWvbTbd8ZP6sBoguZ7YMDQ2GGKDox7zWxkzwXCU02e3+rvwRzLsOzrtWtdBhlGgWghT7Qgsf2VRAA+1yYuQycDISDF1K6R+N7r2BJ/2qFM0ViBiSVHzETv+Dt+3zsvUnD3Bs+dAg4DHFk8OhmKSRopOZC5W1DQ0/dCo6cP724sgeRrl4etUrdhXQObwvfotrva6tXHU78AsjltzEg1Q00dV9B6eWLH6QTfWGUmrlM46PycoFfUyx1U6wEzRNlXKUr7sUPr7HQkThp9hqIhNLj+y5aOLqpyeFGX+uM9mDYBKt1Mu0FCautF24Joo1UlFEqxtQZIqpiVwSGontSN2Ye8Ebl+effJjlgs+pUaf/IxCso+fBverf1E9qO5RKhn5D6o+erxM=
email: false