forked from operations-relay42/opstest
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
47 lines (40 loc) · 1.11 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
---
dist: xenial
language: java
cache:
directories:
- $HOME/.m2
- ~/.ansible/roles
- ~/.terraform
pip: true
apt: true
before_script:
- sudo apt-get update -q
- sudo apt-get install -q python-pip
- pip install --upgrade --user ansible
- ansible --version
- ansible-galaxy install -r ansible/requirements.yml
# Installs Packer and Terraform used in deployment steps
- ansible-playbook -i localhost ansible/prepare_deploy_server.yml
jobs:
include:
- stage: test
name: Test App
before_script: skip # needs change
script: make test
- stage: deploy
name: Deploy production
script: |
make bake
AMIID=$(cat manifest.json | jq -r .builds[0].artifact_id | cut -d':' -f2)
#AMIID=ami-016434dc9b78a18c6
make deploy AMIID=$AMIID ENV=prod
if: branch = master AND type = push
- stage: deploy
name: Deploy non production
script: |
make bake
AMIID=$(cat manifest.json | jq -r .builds[0].artifact_id | cut -d':' -f2)
#AMIID=ami-016434dc9b78a18c6
make deploy AMIID=$AMIID ENV=$TRAVIS_BRANCH
if: branch IN (sta, dev, test) AND type = push