forked from RockefellerArchiveCenter/scorpio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
69 lines (69 loc) · 1.98 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
dist: bionic
language: python
python: "3.10"
cache:
directories:
- $HOME/.cache/pip
- $HOME/.cache/pre-commit
services:
- docker
env:
global:
- CONTAINER: scorpio-web
- APPLICATION_NAME: scorpio
- DJANGO_PORT: 8008
before_install:
- cp ${APPLICATION_NAME}/config.py.example ${APPLICATION_NAME}/config.py
- echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
- docker-compose up -d
install:
- pip install pre-commit && pre-commit install
- ./wait-for-it.sh $CONTAINER:$DJANGO_PORT -- docker-compose exec $CONTAINER pip install coverage
script:
- pre-commit run --all-files --show-diff-on-failure
- docker-compose exec ${CONTAINER} coverage run manage.py test
after_script:
- docker-compose exec ${CONTAINER} coverage report --omit=*/migrations/* -m
before_deploy:
- sudo deploy_scripts/substitute_env.sh
- sudo deploy_scripts/make_zip.sh $DEPLOY_ZIP_DIR $DEPLOY_ZIP_NAME
deploy:
- provider: s3
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
local_dir: $DEPLOY_ZIP_DIR
skip_cleanup: true
on:
repo: RockefellerArchiveCenter/${APPLICATION_NAME}
all_branches: true
condition: $TRAVIS_BRANCH =~ ^(base|development)$
bucket: $AWS_BUCKET_NAME
region: us-east-1
- provider: codedeploy
wait_until_deployed: true
bucket: $AWS_BUCKET_NAME
key: $DEPLOY_ZIP_NAME
bundle_type: zip
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
application: ${APPLICATION_NAME}
deployment_group: ScorpioDevelopment
region: us-east-1
on:
repo: RockefellerArchiveCenter/${APPLICATION_NAME}
branch: development
- provider: codedeploy
wait_until_deployed: true
bucket: $AWS_BUCKET_NAME
key: $DEPLOY_ZIP_NAME
bundle_type: zip
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
application: ${APPLICATION_NAME}
deployment_group: ScorpioProduction
region: us-east-1
on:
repo: RockefellerArchiveCenter/${APPLICATION_NAME}
branch: base
notifications:
email: false