-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
61 lines (52 loc) · 1.74 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
#include:
# - remote: 'https://gitlab.cern.ch/c2mon/c2mon/-/raw/master/.gitlab-ci-templates/daq-gitlab-ci.yml'
stages:
- build
- deploy
- sonar
services:
# To obtain a Docker daemon, request a Docker-in-Docker service
- docker:19.03.11-dind
variables:
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: "tcp://docker:2375/"
image:
name: gitlab-registry.cern.ch/industrial-controls/sw-infra/mvn-dind:3.6.2-19.3.0-jdk11
entrypoint: [""]
# Get the settings file from c2mon project
before_script:
- curl -O -L https://cern.ch/maven/settings-ci.xml
# Fully build and publish develop branch (for snapshots) and tags (for releases)
build_and_publish:
stage: deploy
tags:
- docker-privileged
script:
- docker info
- mvn -q -B -T4 deploy -Dmaven.test.skip=true --settings settings-ci.xml
only:
- tags
- develop
# Just run unit and integration tests on feature branches
test:
stage: build
script:
- mvn -B test failsafe:integration-test -DskipDockerBuild -DskipDockerTag --settings settings-ci.xml
except:
- tags
- develop
sonar_preview:
stage: sonar
script:
- mvn -q -B compile sonar:sonar -Dmaven.test.skip=true -Dsonar.host.url=https://cvl-sonarqube.cern.ch -Dsonar.analysis.mode=preview -Dsonar.gitlab.commit_sha=$CI_BUILD_REF -Dsonar.gitlab.ref_name=$CI_BUILD_REF_NAME -Dsonar.gitlab.project_id=$CI_PROJECT_ID -Dsonar.gitlab.max_major_issues_gate=0 --settings settings-ci.xml --debug -X
except:
- master
- tags
- develop
quality_assurance:
stage: sonar
script:
- mvn package sonar:sonar -Dmaven.test.skip=true -Dsonar.host.url=https://cvl-sonarqube.cern.ch -Dsonar.dependencyCheck.reportPath=target/dependency-check-report.xml --settings settings-ci.xml
only:
- master
- develop