-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
182 lines (155 loc) · 3.55 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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
stages:
# - test
# - build
# - kill
# - deploy
- aws_archiving
- aws_deploy
# variables:
# AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
# AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
.preamble: &preamble
- python3 -m venv venv
- source venv/bin/activate
- pip install -r flaskr/requirements.txt
# hello-world-test:
# stage: test
# script:
# - *preamble
# - pytest test/test_sanity.py
# # Tests of the support test code which should be executed
# # before other bot-related tests
# bot-resp-test:
# stage: test
# script:
# - *preamble
# - pytest test/bots/test_bot_resp.py
# bot-entry-test:
# stage: test
# script:
# - *preamble
# - pytest test/bots/test_bot_entry.py
# database-test:
# stage: test
# script:
# - *preamble
# - pytest tests/test_database.py
# flaskr-test:
# stage: test
# script:
# - *preamble
# - pytest tests/test_flaskr.py
# event-test:
# stage: test
# script:
# - *preamble
# - pytest tests/test_event.py
# game-test:
# stage: test
# script:
# - *preamble
# - pytest tests/test_game.py
# player-test:
# stage: test
# script:
# - *preamble
# - pytest tests/test_player.py
# question-factory-test:
# stage: test
# script:
# - *preamble
# - pytest tests/test_question_factory.py
# question-test:
# stage: test
# script:
# - *preamble
# - pytest tests/test_question.py
# questions-test:
# stage: test
# script:
# - *preamble
# - pytest tests/test_questions.py
# quiz-master-test:
# stage: test
# script:
# - *preamble
# - pytest tests/test_quiz_master.py
# rate-controller-test:
# stage: test
# script:
# - *preamble
# - pytest tests/test_rate_controller.py
# scoreboard-test:
# stage: test
# script:
# - *preamble
# - pytest tests/test_scoreboard.py
# # The following are done only on master branch.
# docker-build-image:
# stage: build
# script:
# - docker build -t se-xp .
# rules:
# - if: $CI_COMMIT_BRANCH == "master"
# docker-clear-old-resources:
# stage: kill
# script:
# - docker system prune --filter "until=24h" --force
# rules:
# - if: $CI_COMMIT_BRANCH == "master"
# docker-stop-previous-container:
# stage: kill
# script:
# - docker stop se-xp-container
# rules:
# - if: $CI_COMMIT_BRANCH == "master"
# allow_failure: true
# dockerremove-previous-container:
# stage: kill
# script:
# - docker rm se-xp-container
# rules:
# - if: $CI_COMMIT_BRANCH == "master"
# allow_failure: true
# docker-run-new-container:
# stage: deploy
# script:
# - docker run --name se-xp-container -d -p80:5000 se-xp
# rules:
# - if: $CI_COMMIT_BRANCH == "master"
# fly-deploy:
# stage: deploy
# script:
# - /home/gitlab-runner/.fly/bin/fly deploy . --detach --now
# rules:
# - if: $CI_COMMIT_BRANCH == "master"
archive-lambda:
stage: aws_archiving
only:
- master
- aws_attachment_attempt
- lambdaHandler
- lambdaCtd
image: ubuntu
when:
on_success
script:
- ./auxiliary/lambdarch
artifacts:
paths:
- "aws/aws_deployment_package.zip"
deploy-lambda:
stage: aws_deploy
only:
- master
- aws_attachment_attempt
- lambdaHandler
- lambdaCtd
image:
name: amazon/aws-cli
entrypoint: [""]
script:
- aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
- aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
- aws configure set region eu-west-2
- aws lambda update-function-code --function-name BubbleLambda --zip-file fileb://aws/aws_deployment_package.zip