-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.travis.yml
72 lines (63 loc) · 2.28 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
# Variables needed for this script are:
# Case 1: Stored on Travis Settings
# For all environments:
# - DOCKER_CI_REPO_NAME
# - DOCKER_USERNAME
# - DOCKER_PASSWORD
#For dev environment:
# - AWS_ACCOUNT_USER_ID_DEV
# - AWS_ACCOUNT_SECRET_DEV
# - AWS_PROFILE_DEV
#For Prod environment:
# - AWS_ACCOUNT_USER_ID_PROD
# - AWS_ACCOUNT_SECRET_PROD
# - AWS_PROFILE_PROD
#For Demo environment:
# - AWS_ACCOUNT_USER_ID_DEMO
# - AWS_ACCOUNT_SECRET_DEMO
# - AWS_PROFILE_DEMO
env:
global:
- COMMIT=${TRAVIS_COMMIT::7}
#Add IMAGE_TAG variable to build docker image
- IMAGE_TAG=${COMMIT}
before_install:
# Get Meteor
- curl https://install.meteor.com | /bin/sh
- export PATH="$HOME/.meteor:$PATH"
# Install AWS CLI
- pip install --user awscli
- export PATH=$PATH:$HOME/.local/bin
- curl -o $HOME/.local/bin/ecs-cli
https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-linux-amd64-latest &&
chmod +x $HOME/.local/bin/ecs-cli
install:
- meteor npm install
# fix Errors and vulnerabilities
#- meteor npm audit fix
script:
# Test that our code is working as expected on that image.
- meteor npm run test
matrix:
include:
- env: DEPLOY=dev
- env: DEPLOY=demo
if: tag IS present
deploy:
provider: script
script: TRAVIS_PROFILE=$AWS_PROFILE_DEMO AWS_ACCESS_KEY_ID=$AWS_ACCOUNT_USER_ID_DEMO AWS_SECRET_ACCESS_KEY=$AWS_ACCOUNT_SECRET_DEMO AWS_REGION=$AWS_DEFAULT_REGION ./deploy.sh -d
on:
branch: master
tags: true
- env: DEPLOY=prod
if: tag IS present
deploy:
provider: script
# TODO - Distribution-id uses a hardcoded value
# This will ONLY work for the main Unee-T installation but no other Unee-T Installation
# This is a problem we need to fix
script: TRAVIS_PROFILE=$AWS_PROFILE_PROD AWS_ACCESS_KEY_ID=$AWS_ACCOUNT_USER_ID_PROD AWS_SECRET_ACCESS_KEY=$AWS_ACCOUNT_SECRET_PROD AWS_REGION=$AWS_DEFAULT_REGION ./deploy.sh -p && AWS_ACCESS_KEY_ID=$AWS_ACCOUNT_USER_ID_PROD AWS_SECRET_ACCESS_KEY=$AWS_ACCOUNT_SECRET_PROD aws cloudfront create-invalidation --distribution-id E173XT6X8V4A18 --paths '/*'
# END - TODO - Distribution-id uses a hardcoded value
on:
branch: master
tags: true