-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
79 lines (70 loc) · 2.87 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
sudo: required
language: nodejs
node_js:
- 6
services:
- docker
env:
global:
- DOCKER_COMPOSE_VERSION=1.14.0
# - CACHE_DIR=$HOME/.cache/docker
# - CACHE_UI=$CACHE_DIR/mywell-ui.tar.gz
# - CACHE_SERVER=$CACHE_DIR/mywell-server.tar.gz
# - CACHE_GQL=$CACHE_DIR/mywell-gql.tar.gz
# - CACHE_UTILS=$CACHE_DIR/mywell-utils.tar.gz
# - CACHE_DEPLOY=$CACHE_DIR/mywell-deploy.tar.gz
# cache:
# directories:
# - $CACHE_DIR
before_install:
- pip install --user awscli
- export PATH=$PATH:$HOME/.local/bin
#install latest docker-compose
# - sudo apt-get update
# - sudo apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y docker-engine
# - docker-compose --version
# - sudo rm /usr/local/bin/docker-compose
# - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
# - chmod +x docker-compose
# - sudo mv docker-compose /usr/local/bin
# - docker-compose --version
# Unencrypt secrets
- openssl aes-256-cbc -K $encrypted_5d1e44ff4222_key -iv $encrypted_5d1e44ff4222_iv
-in secrets.tar.enc -out secrets.tar -d;
- tar xvf secrets.tar;
- mkdir -p ~/.aws/
- ls -la ~/.aws/
- echo -e '[profile default]\nregion = ap-southeast-2' > ~/.aws/config
- aws s3 ls
# Caching
# - if [ -f ${CACHE_UI} ]; then gunzip -c ${CACHE_UI} | docker load; fi
# - if [ -f ${CACHE_SERVER} ]; then gunzip -c ${CACHE_SERVER} | docker load; fi
# - if [ -f ${CACHE_GQL} ]; then gunzip -c ${CACHE_GQL} | docker load; fi
# - if [ -f ${CACHE_UTILS} ]; then gunzip -c ${CACHE_UTILS} | docker load; fi
# - docker images
# - if [ -f ${CACHE_DEPLOY} ]; then gunzip -c ${CACHE_DEPLOY} | docker load; fi
install:
- docker-compose -f docker-compose.yml build
- docker images
# - cd ./deployment && docker-compose build
# - mkdir -p $CACHE_DIR
#TODO: this will only cache old ones...
# - if [ ! -f ${CACHE_UI} ]; then docker save mywell-ui:local | gzip > ${CACHE_UI}; fi
# - if [ ! -f ${CACHE_SERVER} ]; then docker save mywell-server:local | gzip > ${CACHE_SERVER}; fi
# - if [ ! -f ${CACHE_GQL} ]; then docker save mywell-gql:local | gzip > ${CACHE_GQL}; fi
# - if [ ! -f ${CACHE_UTILS} ]; then docker save mywell-utils:local | gzip > ${CACHE_UTILS}; fi
# - if [ ! -f ${CACHE_DEPLOY} ]; then docker save mywell-deploy:local | gzip > ${CACHE_DEPLOY}; fi
script:
#TODO: eventually run tests here
- echo 'Run tests'
after_success:
- source ./deployment/tools/stage_calculator.sh;
- source ./env/env$STAGE.sh;
#update static resources
- cd ./mywell-ui && ./post_build_deploy.sh && cd ..
- cd ./mywell-console && ./post_build_deploy.sh && cd ..
#update other services
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
- "./deployment/tools/tag_and_push_docker.sh skip-build;"
- export AWS_PROFILE=default
- cd ./deployment && ./run-tools.sh deploy