@@ -73,14 +73,21 @@ lock(resource: "build-node-image") {
73
73
// add any additional root CA cert before we do anything that fetches
74
74
pipeutils.addOptionalRootCA()
75
75
76
+ def yumrepos_file
76
77
stage('Init') {
77
- shwrap("""git clone ${stream_info.yumrepo.url} yumrepos""")
78
+ shwrap("git clone ${stream_info.yumrepo.url} yumrepos")
79
+ for (repo in stream_info.yumrepo.files) {
80
+ shwrap("cat yumrepos/${repo} >> all.repo")
81
+ }
82
+ yumrepos_file = shwrapCapture("realpath all.repo")
83
+ // let's archive it also so it's easy to see what the final repo file looked like
84
+ archiveArtifacts 'all.repo'
78
85
}
79
86
80
87
if (params.PIPECFG_HOTFIX_REPO || params.PIPECFG_HOTFIX_REF) {
81
88
container_registry_staging_image_tag += "-hotfix-${pipecfg.hotfix.name}"
82
89
}
83
- stage('Build Layered Image') {
90
+ stage('Build Node Image') {
84
91
withCredentials([file(credentialsId: 'oscontainer-push-registry-secret', variable: 'REGISTRY_AUTH_FILE')]) {
85
92
def build_from = params.FROM ?: stream_info.from
86
93
pipeutils.build_and_push_image(arches: arches,
@@ -89,36 +96,32 @@ lock(resource: "build-node-image") {
89
96
staging_repository: container_registry_staging_repo,
90
97
image_tag_staging: container_registry_staging_image_tag,
91
98
manifest_tag_staging: container_registry_staging_manifest_tag,
92
- secret: "id=yumrepos,src=\$(pwd)/yumrepos/${stream_info.yumrepo.files[0] }",
99
+ secret: "id=yumrepos,src=${yumrepos_file }",
93
100
from: build_from,
94
101
extra_build_args: ["--security-opt label=disable", "--mount-host-ca-certs", "--force"])
95
102
}
96
103
}
97
- stage('Build Extensions Container ') {
104
+ stage('Build Extensions Image ') {
98
105
withCredentials([file(credentialsId: 'oscontainer-push-registry-secret', variable: 'REGISTRY_AUTH_FILE')]) {
99
106
// Use the node image as from
100
107
def build_from = container_registry_staging_manifest
101
- def repos = stream_info.yumrepo.files
102
- for (repo in repos) {
103
- shwrap(""" cat yumrepos/${repo} >> /tmp/final_repo """)
104
- }
105
108
pipeutils.build_and_push_image(arches: arches,
106
109
src_commit: commit,
107
110
src_url: src_config_url,
108
111
staging_repository: container_registry_staging_repo,
109
112
image_tag_staging: "${container_registry_staging_image_tag}-extensions",
110
113
manifest_tag_staging: "${container_registry_staging_manifest_tag}-extensions",
111
- secret: "id=yumrepos,src=/tmp/final_repo ",
114
+ secret: "id=yumrepos,src=${yumrepos_file} ",
112
115
from: build_from,
113
116
extra_build_args: ["--security-opt label=disable", "--mount-host-ca-certs",
114
- "--git-containerfile", "extensions/Dockerfile", "--force"])
117
+ "--git-containerfile", "extensions/Dockerfile", "--force"])
115
118
}
116
119
}
117
120
stage("Release Manifests") {
118
121
withCredentials([file(credentialsId: 'oscontainer-push-registry-secret', variable: 'REGISTRY_AUTH_FILE')]) {
119
- pipeutils.copy_image(container_registry_staging_manifest, container_registry_repo_and_tag, REGISTRY_AUTH_FILE )
122
+ pipeutils.copy_image(container_registry_staging_manifest, container_registry_repo_and_tag)
120
123
pipeutils.copy_image("${container_registry_staging_manifest}-extensions",
121
- "${container_registry_repo_and_tag}-extensions", REGISTRY_AUTH_FILE )
124
+ "${container_registry_repo_and_tag}-extensions")
122
125
}
123
126
}
124
127
currentBuild.result = 'SUCCESS'
0 commit comments