This repository has been archived by the owner on Sep 27, 2022. It is now read-only.
generated from Cray-HPE/metal-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.github
62 lines (56 loc) · 1.82 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
62
@Library('csm-shared-library@main') _
def pythonVersion = '3.10'
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 {
IS_STABLE = getBuildIsStable()
BUILD_METADATA = getRpmRevision(isStable: isStable)
GIT_REPO_NAME = getRepoName()
}
stages {
stage('Prepare') {
agent {
docker {
image "artifactory.algol60.net/csm-docker/stable/csm-docker-sle-python:${pythonVersion}"
reuseNode true
args "-v ${env.WORKSPACE}:/workspace"
}
}
steps {
runLibraryScript("addRpmMetaData.sh", "${env.GIT_REPO_NAME}.spec")
sh "make prepare"
}
}
stage('Build: RPM') {
agent {
docker {
image "artifactory.algol60.net/csm-docker/stable/csm-docker-sle-python:${pythonVersion}"
reuseNode true
args "-v ${env.WORKSPACE}:/workspace"
}
}
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)
}
}
}
}
}