-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile.github
61 lines (55 loc) · 1.71 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
57
58
59
60
61
@Library('csm-shared-library') _
def sleVersion = '15.3'
def isStable = env.TAG_NAME != null || env.BRANCH_NAME == 'main' ? true : false
pipeline {
agent {
label "metal-gcp-builder"
}
options {
buildDiscarder(logRotator(numToKeepStr: "10"))
disableConcurrentBuilds()
timeout(time: 20, unit: 'MINUTES')
timestamps()
}
environment {
BUILD_METADATA = getRpmRevision(isStable: isStable)
GIT_REPO_NAME = getRepoName()
}
stages {
stage("Prepare: RPM") {
agent {
docker {
label 'docker'
reuseNode true
image "artifactory.algol60.net/csm-docker/stable/csm-docker-sle:${sleVersion}"
}
}
steps {
runLibraryScript("addRpmMetaData.sh", "${env.GIT_REPO_NAME}.spec")
sh "make prepare"
}
}
stage('Build: RPM') {
agent {
docker {
label 'docker'
reuseNode true
image "artifactory.algol60.net/csm-docker/stable/csm-docker-sle:${sleVersion}"
}
}
steps {
sh "make rpm"
}
}
stage('Publish') {
steps {
script {
publishCsmRpms(component: env.GIT_REPO_NAME, pattern: "dist/rpmbuild/RPMS/noarch/*.rpm", os: "sle-15sp2", arch: "noarch", isStable: isStable)
publishCsmRpms(component: env.GIT_REPO_NAME, pattern: "dist/rpmbuild/RPMS/noarch/*.rpm", os: "sle-15sp3", arch: "noarch", isStable: isStable)
publishCsmRpms(component: env.GIT_REPO_NAME, pattern: "dist/rpmbuild/SRPMS/*.rpm", os: "sle-15sp2", arch: "src", isStable: isStable)
publishCsmRpms(component: env.GIT_REPO_NAME, pattern: "dist/rpmbuild/SRPMS/*.rpm", os: "sle-15sp3", arch: "src", isStable: isStable)
}
}
}
}
}