-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathJenkinsfile.zip.sources
52 lines (44 loc) · 1.64 KB
/
Jenkinsfile.zip.sources
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
import org.jenkinsci.plugins.workflow.libs.Library
@Library('jenkins-pipeline-shared-libraries')_
pipeline {
agent {
label util.avoidFaultyNodes()
}
environment {
SOURCES_FILE_NAME = "${SOURCES_FILE_NAME_TEMPLATE}.zip"
SIGNATURE_FILE_NAME = "${SOURCES_FILE_NAME_TEMPLATE}.zip.asc"
CHECKSUM_FILE_NAME = "${SOURCES_FILE_NAME_TEMPLATE}.zip.sha512"
}
options {
timeout(time: 120, unit: 'MINUTES')
}
stages {
stage('Create sources ZIP') {
steps {
sh "tools/zip-sources-all.sh ${SOURCES_FILE_NAME}"
archiveArtifacts artifacts: "**/${SOURCES_FILE_NAME}"
}
}
stage('Sign and upload the sources.zip') {
steps {
dir('sources-out') {
script {
releaseUtils.gpgImportKeyFromStringWithoutPassword(getReleaseGpgSignKeyCredsId())
releaseUtils.gpgSignFileDetachedSignatureWithoutPassword(SOURCES_FILE_NAME, SIGNATURE_FILE_NAME)
releaseUtils.svnUploadFileToRepository(getReleaseSvnRepository(), getReleaseSvnCredsId(), TARGET_VERSION, SOURCES_FILE_NAME, SIGNATURE_FILE_NAME, CHECKSUM_FILE_NAME)
}
archiveArtifacts artifacts: "**/${SIGNATURE_FILE_NAME}"
}
}
}
}
}
String getReleaseGpgSignKeyCredsId() {
return env.RELEASE_GPG_SIGN_KEY_CREDS_ID
}
String getReleaseSvnRepository() {
return env.RELEASE_SVN_REPOSITORY
}
String getReleaseSvnCredsId() {
return env.RELEASE_SVN_CREDS_ID
}