-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
117 lines (113 loc) · 3.62 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
language: python
dist: bionic
os: linux
python:
- "3.11"
branches:
only:
- test
- develop
- main
install:
- pip install -r requirements.txt
services:
- postgresql
jobs:
include:
# Test environment
- stage: test-environment
branches:
only:
- test
before_script:
- python src/manage.py makemigrations
- python src/manage.py migrate
script:
- python src/manage.py collectstatic --noinput
deploy:
- provider: elasticbeanstalk
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
region: "us-east-1"
app: "wed-fall24-team5"
env: "food-donation-swe-test"
bucket_name: "elasticbeanstalk-us-east-1-149536460878"
on:
repo: gcivil-nyu-org/wed-fall24-team5
branch: test
# Re-run migrate after deploy to support Google Auth
after_deploy:
- python src/manage.py makemigrations
- python src/manage.py migrate
# Main deployment via cron
- stage: merge-develop-into-main
if: type = cron
branches:
only:
- main
before_script:
- psql -c 'create database test_db;' -U postgres
- python src/manage.py makemigrations
- python src/manage.py migrate
script:
- black --check ./src
- flake8 ./src
- djlint src/ --lint
- coverage run --source='src' src/manage.py test src --noinput
- coverage report
- coveralls
- python src/manage.py collectstatic --noinput
- git config --global user.name "travis-ci"
- git config --global user.email "[email protected]"
- git remote set-url origin https://[email protected]/$TRAVIS_REPO_SLUG.git
- git fetch origin develop:develop
- git checkout main
- git merge develop
- git push https://[email protected]/$TRAVIS_REPO_SLUG.git main
deploy:
- provider: elasticbeanstalk
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
region: "us-east-1"
app: "wed-fall24-team5"
env: "food-donation-swe-prod"
bucket_name: "elasticbeanstalk-us-east-1-149536460878"
on:
repo: gcivil-nyu-org/wed-fall24-team5
branch: main
# Re-run migrate after deploy to support Google Auth
after_deploy:
- python src/manage.py makemigrations
- python src/manage.py migrate
# Develop deployment
- stage: test-and-send-to-dev
branches:
only:
- develop
before_script:
- psql -c 'create database test_db;' -U postgres
- python src/manage.py makemigrations
- python src/manage.py migrate
script:
- black --check ./src
- flake8 ./src
- djlint src/ --lint
- coverage run --source='src' src/manage.py test src --noinput
- coverage report
- coveralls --service=github
- python src/manage.py collectstatic --noinput
deploy:
- provider: elasticbeanstalk
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
region: "us-east-1"
app: "wed-fall24-team5"
env: "food-donation-swe-dev"
bucket_name: "elasticbeanstalk-us-east-1-149536460878"
on:
repo: gcivil-nyu-org/wed-fall24-team5
branch: develop
# Re-run migrate after deploy to support Google Auth
after_deploy:
- python src/manage.py makemigrations
- python src/manage.py migrate