forked from Sage-Bionetworks-IT/packer-shinyserver-pro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
39 lines (39 loc) · 1.48 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
dist: bionic
language: python
python: 3.7
cache: pip
install:
- wget https://github.com/Sage-Bionetworks/infra-utils/archive/master.zip -O /tmp/infra-utils.zip
- unzip -j -n /tmp/infra-utils.zip -x "infra-utils-master/.gitignore" "infra-utils-master/LICENSE" "infra-utils-master/*.md" "infra-utils-master/aws/*"
- ./setup_aws_cli.sh || travis_terminate 1
- ./install_packer.sh || travis_terminate 1
- pip install pre-commit travis-wait-improved ansible
before_script:
- path=$(pwd)
- export REPO_NAME="${path##*/}"
- export IMAGE_NAME="${REPO_NAME}-${TRAVIS_BRANCH}"
- export AWS_PROFILE="default"
- export AWS_REGION="us-east-1"
stages:
- name: validate
- name: deploy-branch
if: type = push AND branch = master
- name: deploy-tag
if: tag =~ ^v
jobs:
include:
- stage: validate
script:
- pre-commit autoupdate
- pre-commit run --all-files
- pushd src
- echo "ImageName = ${IMAGE_NAME}"
- packer validate -var ImageName=${IMAGE_NAME} template.json
- stage: deploy-branch
script:
- pushd src
- travis-wait-improved --timeout 90m packer build -force -var PACKER_LOG=1 -var AwsProfile=${AWS_PROFILE} -var AwsRegion=${AWS_REGION} -var ImageName=${IMAGE_NAME} template.json
- stage: deploy-tag
script:
- pushd src
- travis-wait-improved --timeout 90m packer build -var PACKER_LOG=1 -var AwsProfile=${AWS_PROFILE} -var AwsRegion=${AWS_REGION} -var ImageName=${IMAGE_NAME} template.json