Newer
Older
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
variables:
SPRING_PROFILES_ACTIVE: gitlab
stages:
- analyse
- build
- verification
- publish
- deploy
# ===========================================================================
# Stage: analyse
# ===========================================================================
include:
- template: Code-Quality.gitlab-ci.yml
code_quality:
stage: analyse
services: [] # Shut off Docker-in-Docker
variables:
REPORT_FORMAT: html
artifacts:
paths: [gl-code-quality-report.html]
# second job has to be run to create both artefacts
code_quality_json:
extends: code_quality
variables:
REPORT_FORMAT: json
artifacts:
paths: [gl-code-quality-report.json]
# ===========================================================================
# Stage: build
# ===========================================================================
build-bootJar:
stage: build
script:
- ./gradlew bootJar
build-image:
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
# ===========================================================================
# Stage: test
# ===========================================================================
verification-unit:
stage: verification
allow_failure: true
script:
- ./gradlew test
artifacts:
when: always
reports:
junit: build/test-results/test/**/TEST-*.xml
verification-env:
stage: verification
allow_failure: true
before_script:
- export $(xargs < .env)
script:
- echo $TAG
# ===========================================================================
# Stage: publish
# ===========================================================================
publish:
stage: publish
only:
- master
- /^verze_\d+\.\d+\.\d+$/
before_script:
- export $(xargs < .env)
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
script:
- docker push $DOCKER_NAMESPACE/gateway:$TAG
# ===========================================================================
# Stage: deploy
# ===========================================================================
deploy-bioinformatika.pef.mendelu.cz:
stage: deploy
only:
- 384-test-server-deplyment
- master
script:
- cp .env /home/bioinformatics/
- cd /home/bioinformatics/
- docker-compose config > docker-swarm.yml
# - docker stack deploy -c docker-compose.yml test_stack
# after_script:
# - docker system prune -f
deploy-bioinformatics.ibp.cz:
stage: deploy
only:
- /^verze_\d+\.\d+\.\d+$/
script:
- scp .env root@bioinformatics.ibp.cz:/opt/
- scp docker-compose.yml root@bioinformatics.ibp.cz:/opt/
- ssh root@bioinformatics.ibp.cz "cd /opt && export $(xargs < .env) && docker stack deploy dna-analyser -c docker-compose.yml"