-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile_release
31 lines (24 loc) · 1.52 KB
/
Jenkinsfile_release
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
import com.efluid.mail.legacy.MailUtils
import com.efluid.jenkins.*
new EfluidPodTemplate(this).label(env.JOB_BASE_NAME).addContainer(new Container(this).containerType("maven-14").memory('4G')).execute() {
MailUtils mailUtils = new MailUtils(this)
git branch: branch, credentialsId: credentials.gerritAuthentificationForJenkins, url: '[email protected]:efluid/testControlByteCode.git'
String subject = "Release testControlByteCode ${releaseVersion}"
try{
env.JAVA_HOME = "${variables.jdkPathPrefix}1.8.0_172"
withEfluidHttpProxy {
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: credentials.gpgMavenCentralPassphrase, passwordVariable: 'gpgPassword', usernameVariable: 'gpgUsername']]) {
sh "mvn -B release:prepare release:perform -DgpgPassphrase=${env.gpgPassword} -DreleaseVersion=${releaseVersion} -DdevelopmentVersion=${developmentVersion}"
}
}
sh('git push --all')
sh('git push --tags')
String mailDetail = "testControlByteCode tool from open source project https://github.com/efluid/testControlByteCode was successfull released in version ${releaseVersion}"
mailUtils.mailInfo(subject, mailDetail, destinatairesMail, false)
} catch (Exception e) {
String mailDetail = "testControlByteCode tool from open source project https://github.com/efluid/testControlByteCode was in error during release ${releaseVersion}"
mailUtils.mailError(subject, mailDetail, 'testControlByteCode', releaseVersion, null, destinatairesMail, null)
throw e
}
}
return this;