-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
42 lines (34 loc) · 1.16 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
# Keep this file in sync with docker-compose.yml.
# Build JAVA applications using Apache Maven (http://maven.apache.org)
# For docker image tags see https://hub.docker.com/_/maven/
#
# For general lifecycle information see https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
image: dockerhub.ebi.ac.uk/ega/ega-data-api-build-container:latest
# Add the service of docker in docker to allow us to compile the docker images
# https://docs.gitlab.com/runner/executors/kubernetes.html#using-dockerdind
services:
- name: docker:dind
alias: dataedge
## List of jobs:
stages:
- unitTest
- imageBuild
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
paths:
- .m2/repository
variables:
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
TRAVIS_BUILD_DIR: $CI_PROJECT_DIR
## Diffent stages for the CICD of Data API
unitTest:
stage: unitTest
script:
- mvn test
imageBuild:
stage: imageBuild
script:
- mvn clean install "-DdockerRegistry=$CI_REGISTRY_IMAGE" "-Dimage.version=$CI_COMMIT_TAG" -P production -DskipTests
only:
- tags