-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
91 lines (85 loc) · 2.95 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
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
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
stages:
- build
- deploy
build-sit:
stage: build
tags:
- sit
script:
- docker build -t registry.gitlab.com/new-learning/mathefragen.de/app:$CI_COMMIT_TAG .
- docker push registry.gitlab.com/new-learning/mathefragen.de/app:$CI_COMMIT_TAG
only:
- /^[0-9]+(?:.[0-9]+)+[a-z]*-sit$/
except:
- branches
#deploy-sit:
# stage: deploy
# tags:
# - sit
# script:
# - docker service update --with-registry-auth --image registry.gitlab.com/new-learning/mathefragen.de/app:$CI_COMMIT_TAG --force math_mathefragen-server
# - docker service update --with-registry-auth --image registry.gitlab.com/new-learning/mathefragen.de/app:$CI_COMMIT_TAG --force api-mathe_mathefragen-server
# only:
# - /^[0-9]+(?:.[0-9]+)+[a-z]*-sit$/
# except:
# - branches
build-prod:
stage: build
tags:
- prod
script:
- docker build -t registry.gitlab.com/new-learning/mathefragen.de/app:$CI_COMMIT_TAG .
- docker push registry.gitlab.com/new-learning/mathefragen.de/app:$CI_COMMIT_TAG
only:
- /^[0-9]+(?:.[0-9]+)+$/
except:
- branches
deploy-prod:
stage: deploy
tags:
- prod
script:
- docker service update --with-registry-auth --image registry.gitlab.com/new-learning/mathefragen.de/app:$CI_COMMIT_TAG --force bio_biofragen-server
- docker service update --with-registry-auth --image registry.gitlab.com/new-learning/mathefragen.de/app:$CI_COMMIT_TAG --force chemi_chemiefragen-server
- docker service update --with-registry-auth --image registry.gitlab.com/new-learning/mathefragen.de/app:$CI_COMMIT_TAG --force informatic_informatikfragen-server
- docker service update --with-registry-auth --image registry.gitlab.com/new-learning/mathefragen.de/app:$CI_COMMIT_TAG --force math_mathefragen-server
- docker service update --with-registry-auth --image registry.gitlab.com/new-learning/mathefragen.de/app:$CI_COMMIT_TAG --force meta_metafragen-server
- docker service update --with-registry-auth --image registry.gitlab.com/new-learning/mathefragen.de/app:$CI_COMMIT_TAG --force physik_physikfragen-server
only:
- /^[0-9]+(?:.[0-9]+)+$/
except:
- branches
#default:
# image: debian:10
# services:
# - postgres:11.7
# - redis:latest
# cache:
# paths:
# - ~/.cache/pip/
# before_script:
# - apt -y update
# - apt -y install apt-utils
# - apt -y install net-tools python3 python3-pip
# - apt -y install postgresql postgresql-contrib
# - apt -y upgrade
# - pip3 install -r requirements.txt
#
#
#migrations:
# stage: build
# script:
# - python3 manage.py makemigrations
# - python3 manage.py migrate
# - python3 manage.py check
#
#
#django-tests:
# stage: test
# script:
# # - python3 manage.py test, we need to solve this migration issue later on once we start writing new tests
# # django.db.utils.ProgrammingError: relation "user_review" does not exist
# - python3 manage.py check
#