forked from Cray-HPE/docs-csm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile.github
57 lines (50 loc) · 1.73 KB
/
Jenkinsfile.github
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
@Library('csm-shared-library') _
pipeline {
agent {
label "metal-gcp-builder"
}
options {
buildDiscarder(logRotator(numToKeepStr: "10"))
timestamps()
}
environment {
IS_STABLE = getBuildIsStable(releaseBranchIsStable: true)
BUILD_METADATA = getRpmRevision(isStable: env.IS_STABLE)
GIT_REPO_NAME = getRepoName()
RELEASE_BRANCH_VERSION = getReleaseBranchVersion()
}
stages {
stage("Prepare") {
steps {
script {
withCredentials([gitUsernamePassword(credentialsId: 'jenkins-algol60-cray-hpe-github-integration')]) {
runLibraryScript("addRpmMetaData.sh", "${env.GIT_REPO_NAME}.spec")
sh "make prepare"
}
}
}
}
stage("Build RPM") {
steps {
script {
withCredentials([gitUsernamePassword(credentialsId: 'jenkins-algol60-cray-hpe-github-integration')]) {
sh "make rpm"
}
}
}
}
stage('Publish') {
steps {
script {
if(env.RELEASE_BRANCH_VERSION){
RELEASE_FOLDER = "/" + env.RELEASE_BRANCH_VERSION
} else {
RELEASE_FOLDER = ""
}
publishCsmRpms(component: env.GIT_REPO_NAME + RELEASE_FOLDER, pattern: "dist/rpmbuild/RPMS/noarch/*.rpm", arch: "noarch", isStable: env.IS_STABLE)
publishCsmRpms(component: env.GIT_REPO_NAME + RELEASE_FOLDER, pattern: "dist/rpmbuild/SRPMS/*.rpm", arch: "src", isStable: env.IS_STABLE)
}
}
}
}
}