-
Notifications
You must be signed in to change notification settings - Fork 28
/
Jenkinsfile
executable file
·79 lines (71 loc) · 1.73 KB
/
Jenkinsfile
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
68
69
70
71
72
73
74
75
76
77
78
79
pipeline {
agent any
parameters {
choice(
name: 'TYPE',
choices: ['QUICK', 'FULL'],
description: 'Build types:<p>QUICK: Compile, Build, Deploy artifacts, Skip integration tests and extra artifacts, Multithread build<p>FULL: Compile, Build, Deploy artifacts, Run integration tests and extra artifacts, Singlethread build\n'
)
}
tools {
maven 'Maven3.6'
jdk 'OpenJDK11'
}
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
skipStagesAfterUnstable()
timestamps()
}
stages {
stage('Quick build') {
when {
expression {
params.TYPE == 'QUICK'
}
}
steps {
sh 'mvn clean verify -U -T 3 -P skip-coverage,skip-release-it'
}
}
stage('Full build') {
when {
expression {
params.TYPE == 'FULL'
}
}
steps {
sh 'mvn clean verify -U -P coverage'
}
}
stage('Snapshots to nexus') {
environment {
PROFILES = getProfiles()
}
steps {
configFileProvider([configFile(fileId: 'org.jenkinsci.plugins.configfiles.maven.GlobalMavenSettingsConfig1387378707709', variable: 'MAVEN_SETTINGS')]) {
sh 'mvn -s $MAVEN_SETTINGS deploy -B -P $PROFILES -DskipTests'
}
}
}
stage('Build and push Docker images: Ingestion') {
steps {
sh 'build/ingestion-docker-build.sh'
}
}
}
post {
success {
echo 'Pipeline executed successfully!'
}
failure {
echo 'Pipeline execution failed!'
}
}
}
def getProfiles() {
def profiles = "skip-coverage,skip-release-it,gbif-artifacts"
if (params.TYPE == 'FULL') {
profiles += ",extra-artifacts"
}
return profiles
}