-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
50 lines (44 loc) · 1.3 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
dist: jammy
language: python
python:
"3.11"
cache:
directories:
- $HOME/.cache/pip
- $HOME/.cache/pre-commit
services:
- docker
env:
global:
- TIMESTAMP=$(date '+%Y%m%d%H%M%S')
- CONTAINER=web
- APPLICATION_NAME=digitized_av_qc
- APPLICATION_PORT=80
before_install:
- 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:$APPLICATION_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:
- pip install awscli
- docker build -t ${APPLICATION_NAME} --target build .
- if [ ! -d deploy_scripts ]; then git clone https://github.com/RockefellerArchiveCenter/deploy_scripts.git; fi
deploy:
- provider: script
script: >-
bash deploy_scripts/containers/push_image_to_ecr.sh $APPLICATION_NAME
on:
branch: development
- provider: script
script: >-
bash deploy_scripts/containers/add_tag_to_image.sh $APPLICATION_NAME dev prod
on:
branch: base
notifications:
email: false