-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gitlab-ci.yml
49 lines (40 loc) · 1.92 KB
/
.gitlab-ci.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
image: python:3.7
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- pip install --upgrade pip virtualenv virtualenvwrapper
- pip install poetry
stages:
- deploy
deploy:
stage: deploy
script:
- python -m venv venv
- source venv/bin/activate
- pip install --upgrade pip virtualenv virtualenvwrapper wheel
- poetry install --no-dev
# optional dependency for metrics
- git clone [email protected]:OverTrack/overtrack_2_api.git
- mv -t overtrack_web ./overtrack_2_api/api
- git clone [email protected]:OverTrack/overtrack-v2.git
- mv -t overtrack_web ./overtrack-v2/overtrack
- git clone [email protected]:OverTrack/overtrack-models.git
- mv -t overtrack_web ./overtrack-models/overtrack_models # ??? why does poetry no longer install this from deps?
- pushd overtrack_web
# - zappa update test || { sleep 30; zappa tail test --since 1min --disable-keep-open; false; }
- zappa update main
# install with dev deps this time
- poetry install
- boussole compile
- pip install awscli
- aws s3 sync ./static/ s3://overtrack-web-2-assets/static --delete --acl public-read --cache-control max-age=86400
- aws s3 cp s3://overtrack-web-2-assets/static/images s3://overtrack-web-2-assets/static/images --recursive --acl public-read --cache-control max-age=604800 --metadata-directive REPLACE
- aws s3 cp s3://overtrack-web-2-assets/static/js/lib s3://overtrack-web-2-assets/static/js/lib --recursive --acl public-read --cache-control max-age=6048000 --metadata-directive REPLACE
- aws configure set preview.cloudfront true
- aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/static/*"
only:
- master
- "apex.overtrack.gg"