-
Notifications
You must be signed in to change notification settings - Fork 11
/
Jenkinsfile
74 lines (70 loc) · 3.2 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
#!/usr/bin/env groovy
/**
* Copyright (C) 2019 CS-SI
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 3 of the License, or (at your option)
* any later version.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, see http://www.gnu.org/licenses/
*/
pipeline {
options {
buildDiscarder(logRotator(daysToKeepStr: '10', artifactDaysToKeepStr: '10'))
timeout(time: 20, unit: 'HOURS')
}
/*environment {
toolName = sh(returnStdout: true, script: "echo ${env.JOB_NAME} | cut -d '/' -f 1").trim()
branchVersion = sh(returnStdout: true, script: "echo ${env.GIT_BRANCH} | cut -d '/' -f 2").trim()
toolVersion = ''
deployDirName = ''
snapMajorVersion = ''
}*/
agent { label 'snap-test' }
parameters {
string(name: 'smosBoxBranch', defaultValue: "master", description: 'Smos-box branch to use to build installer')
string(name: 'probavboxBranch', defaultValue: "master", description: 'Probavbox branch to use to build installer')
}
stages {
stage('Create installer') {
agent {
docker {
label 'snap-test'
image 'snap-build-server.tilaa.cloud/install4j:8.0.0'
args '-v docker_snap-installer:/snap-installer -v /opt/install4j/:/install4j'
}
}
steps {
/*script {
// Get snap version from pom file
toolVersion = sh(returnStdout: true, script: "cat pom.xml | grep '<version>' | head -1 | cut -d '>' -f 2 | cut -d '-' -f 1").trim()
snapMajorVersion = sh(returnStdout: true, script: "echo ${toolVersion} | cut -d '.' -f 1").trim()
deployDirName = "${toolName}/${branchVersion}-${toolVersion}-${env.GIT_COMMIT}"
}*/
echo "Build SNAP intaller ${env.JOB_NAME} from ${env.GIT_BRANCH} with commit ${env.GIT_COMMIT}"
sh "/opt/createSnapInstaller.sh ${env.GIT_BRANCH} ${params.smosBoxBranch} ${params.probavboxBranch}"
}
}
}
/* disable email send on failure
post {
failure {
step (
emailext(
subject: "[SNAP] JENKINS-NOTIFICATION: ${currentBuild.result ?: 'SUCCESS'} : Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
body: """Build status : ${currentBuild.result ?: 'SUCCESS'}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':
Check console output at ${env.BUILD_URL}
${env.JOB_NAME} [${env.BUILD_NUMBER}]""",
attachLog: true,
compressLog: true,
recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class:'DevelopersRecipientProvider']]
)
)
}
}*/
}