This repository has been archived by the owner on Oct 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
68 lines (56 loc) · 1.66 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
image: $CI_REGISTRY_IMAGE/ci-base
services:
- docker:dind
# For predefined environment variables see: https://docs.gitlab.com/ee/ci/variables/
variables:
# Instruct Testcontainers to use the daemon of DinD.
# See further: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
DOCKER_HOST: "tcp://docker:2375"
# Improve performance with overlayfs.
# See further: https://docs.docker.com/storage/storagedriver/overlayfs-driver/
# See further: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
DOCKER_DRIVER: "overlay2"
IMAGE_TAG: "${CI_COMMIT_SHORT_SHA}-${CI_PIPELINE_ID}"
GRADLE_USER_HOME: "$CI_PROJECT_DIR/.gradle"
# ODS specific envs
ODS_IT_COUCHDB_HOST: docker
stages:
- build
- build-docker
- test
- deploy
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
cache:
paths:
- .gradle/wrapper
- .gradle/caches
build-ci-image:
stage: build
image: docker:stable
when: manual
script:
- docker build -t $CI_REGISTRY_IMAGE/ci-base ./docker/ci-base
- docker push $CI_REGISTRY_IMAGE/ci-base
build:
stage: build
script:
- ./gradlew assemble
unit-tests:
stage: test
script: ./gradlew test
artifacts:
reports:
junit: /*/build/test-results/test/**/TEST-*.xml
integration-test:
stage: test
script:
- docker run -d -p 5984:5984 -e COUCHDB_USER=admin -e COUCHDB_PASSWORD=admin --name couchdb couchdb
- ./gradlew integrationTest
after_script:
- docker stop couchdb
publish-jars:
stage: deploy
when: manual
script:
- ./gradlew publish