-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
104 lines (95 loc) · 2.47 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
stages:
- build
- pre-deploy-tests
- push
- deploy-staging
- staging-functional-tests
- deploy-production
- production-functional-tests
image:
name: registry.gitlab.com/mesonomics/meso-alert/ci
entrypoint: [""]
unit-tests:
stage: pre-deploy-tests
script:
- make sbt-unit-tests
scalafix:
stage: pre-deploy-tests
script:
- make sbt-scalafix-check
scalafmt:
stage: pre-deploy-tests
script:
- make sbt-scalafmt-check-all
docker:
stage: push
script:
- echo "POSTGRES_PORT=5432" > docker/.env
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- make -e sbt-build
- cd docker
- docker-compose up --no-start --build meso-alert
- cd ..
- docker push registry.gitlab.com/mesonomics/meso-alert/play-server
only:
- master
staging-functional-tests:
stage: staging-functional-tests
script:
- make -e sbt-functional-tests
only:
- master
artifacts:
paths:
- captures/*.png
when: on_failure
expire_in: 1 week
production-functional-tests:
stage: production-functional-tests
script:
- export STAGING_URL='https://blockinsights.co.uk'
- make -e sbt-functional-tests
only:
- master
when: manual
artifacts:
paths:
- captures/*.png
when: on_failure
expire_in: 1 week
k8-staging:
stage: deploy-staging
image:
name: bitnami/kubectl:latest
entrypoint: ['']
script:
- kubectl config use-context mesonomics/meso-alert:meso-alert-k8agent
- kubectl apply -f k8/staging/sealed-secrets.yaml
- kubectl apply -f k8/staging/meso-alert-service.yaml
- kubectl apply -f k8/staging/postgres-pv.yaml
- kubectl apply -f k8/postgres.yaml
- kubectl apply -f k8/web-application.yaml
- kubectl rollout restart deployment/meso-alert-deployment
only:
- master
environment:
name: staging
k8-production:
stage: deploy-production
image:
name: bitnami/kubectl:1.26.4
entrypoint: ['']
script:
- kubectl config use-context mesonomics/meso-alert:digitalocean-production
- kubectl apply -f k8/production/sealed-secrets.yaml
- kubectl apply -f k8/production/meso-alert-service.yaml
- kubectl apply -f k8/production/postgres-pv.yaml
- kubectl apply -f k8/production/postgresql-backup.yaml
- kubectl apply -f k8/postgres.yaml
- kubectl apply -f k8/web-application.yaml
- kubectl rollout restart deployment/meso-alert-deployment
only:
- master
when: manual
environment:
name: production