-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
73 lines (73 loc) · 2.02 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
language: python
python:
- '3.7'
os: linux
cache:
directories:n
- "$HOME/.local"
- ".cache-loader"
jobs:
include:
- stage: tests
name: "API Unit Tests"
language: node_js
services:
- docker
node_js:
- "12"
before_install:
- 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
install:
- cd backend && docker-compose build
script:
- docker-compose run --rm test
- docker-compose down
- stage: build
name: "Building Project"
install:
- pip install awscli
- pip install aws-sam-cli
- npm install
script:
- |
if [ "$TRAVIS_BRANCH" == "master" ]; then
npm run build
echo "dashboard.sustainability.oregonstate.edu" >> dist/CNAME
else
npm run build-stage
fi
cd backend
sam validate
sam package --template-file template.yaml --s3-bucket osu-so-serverless-builds --output-template-file packaged.yaml
cd ../
deploy:
- provider: script
script: cd backend; sam deploy --template-file ./packaged.yaml --stack-name energy
--capabilities CAPABILITY_IAM; cd ../;
skip_cleanup: true
on:
branch: master
- provider: pages
local_dir: dist/
skip_cleanup: true
github_token: "$GITHUB_TOKEN"
keep_history: true
on:
branch: master
- provider: s3
access_key_id: "$S3_ACCESS_ID"
secret_access_key: "$S3_ACCESS_KEY"
bucket: energy-dashboard
skip_cleanup: true
region: "$AWS_DEFAULT_REGION"
local_dir: dist
on:
all_branches: true
condition: "$TRAVIS_BRANCH != master"
env:
global:
- AWS_DEFAULT_REGION=us-west-2
- DOCKER_COMPOSE_VERSION=1.29.2