Newer
Older
Jan Kolomazník
committed
cache:
untracked: true
key: "$CI_COMMIT_MESSAGE"
paths:
- .gradle
- build
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
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
# ===========================================================================
Jan Kolomazník
committed
gradlew-bootJar:
Jan Kolomazník
committed
docker-build:
- docker build -t $DOCKER_NAMESPACE/gateway:$TAG .
- docker save -o build/image.tar $DOCKER_NAMESPACE/gateway:$TAG
artifacts:
paths:
- build/image.tar
# ===========================================================================
# 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
# ===========================================================================
only:
- master
- /^verze_\d+\.\d+\.\d+$/
before_script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
script:
# ===========================================================================
# 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"