|
1 | 1 | @Library('csm-shared-library') _
|
2 | 2 |
|
3 |
| -def isStable = env.TAG_NAME != null || env.BRANCH_NAME == 'main' ? true : false |
4 | 3 | pipeline {
|
5 |
| - agent { |
6 |
| - label "metal-gcp-builder" |
7 |
| - } |
| 4 | + agent { |
| 5 | + label "metal-gcp-builder" |
| 6 | + } |
8 | 7 |
|
9 |
| - options { |
10 |
| - buildDiscarder(logRotator(numToKeepStr: "10")) |
11 |
| - timestamps() |
12 |
| - } |
| 8 | + options { |
| 9 | + buildDiscarder(logRotator(numToKeepStr: "10")) |
| 10 | + timestamps() |
| 11 | + } |
13 | 12 |
|
14 |
| - environment { |
15 |
| - IS_STABLE = getBuildIsStable() |
16 |
| - BUILD_METADATA = getRpmRevision(isStable: isStable) |
17 |
| - GIT_REPO_NAME = getRepoName() |
18 |
| - } |
| 13 | + environment |
| 14 | + SPEC_FILE = "docs-csm.spec" |
| 15 | + IS_STABLE = getBuildIsStable() |
| 16 | + BUILD_METADATA = getRpmRevision(isStable: env.IS_STABLE) |
| 17 | + GIT_REPO_NAME = getRepoName() |
| 18 | + } |
19 | 19 |
|
20 |
| - stages { |
21 |
| - stage('Prepare') { |
22 |
| - steps { |
23 |
| - sh "make prepare" |
24 |
| - } |
25 |
| - } |
| 20 | + stages { |
| 21 | + stage("Prepare") { |
| 22 | + steps { |
| 23 | + script { |
| 24 | + withCredentials([gitUsernamePassword(credentialsId: 'jenkins-algol60-cray-hpe-github-integration')]) { |
| 25 | + runLibraryScript("addRpmMetaData.sh", env.SPEC_FILE) |
| 26 | + sh "make prepare" |
| 27 | + } |
| 28 | + } |
| 29 | + } |
| 30 | + } |
26 | 31 |
|
27 |
| - stage('Build: RPM') { |
28 |
| - steps { |
29 |
| - sh "make rpm" |
30 |
| - } |
31 |
| - } |
| 32 | + stage("Build RPM") { |
| 33 | + steps { |
| 34 | + script { |
| 35 | + withCredentials([gitUsernamePassword(credentialsId: 'jenkins-algol60-cray-hpe-github-integration')]) { |
| 36 | + sh "make rpm" |
| 37 | + } |
| 38 | + } |
| 39 | + } |
| 40 | + } |
32 | 41 |
|
33 |
| - stage('Publish') { |
34 |
| - steps { |
35 |
| - script { |
36 |
| - publishCsmRpms(component: env.GIT_REPO_NAME, pattern: "dist/rpmbuild/RPMS/noarch/*.rpm", arch: "noarch", isStable: isStable) |
37 |
| - publishCsmRpms(component: env.GIT_REPO_NAME, pattern: "dist/rpmbuild/SRPMS/*.rpm", arch: "src", isStable: isStable) |
| 42 | + stage('Publish') { |
| 43 | + steps { |
| 44 | + script { |
| 45 | + publishCsmRpms(component: env.GIT_REPO_NAME, pattern: "dist/rpmbuild/RPMS/noarch/*.rpm", arch: "noarch", isStable: env.IS_STABLE) |
| 46 | + publishCsmRpms(component: env.GIT_REPO_NAME, pattern: "dist/rpmbuild/SRPMS/*.rpm", arch: "src", isStable: env.IS_STABLE) |
38 | 47 | }
|
39 | 48 | }
|
40 | 49 | }
|
|
0 commit comments