Skip to content

Commit 15e81f1

Browse files
committed
jobs/build-podman-os.Jenkinsfile: get podman version from main
The current podman version is hardcoded to `5.1`. This commit will allow fetching podman from upstream main branch. Signed-off-by: Lokesh Mandvekar <[email protected]>
1 parent 99772cd commit 15e81f1

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

jobs/build-podman-os.Jenkinsfile

+29-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def generate_diskvar_json(shortcommit, arch, artifacts, staging_repo, repo) {
3838
"container-tag": "${arch}-${shortcommit}",
3939
"extra-kargs-string": "",
4040
"image-type": "${artifact["platform"]}",
41-
"container-imgref": "ostree-remote-registry:fedora:${repo}:5.1",
41+
"container-imgref": "ostree-remote-registry:fedora:${repo}:${version}",
4242
"metal-image-size": "3072",
4343
"cloud-image-size": "10240",
4444
"deploy-via-container": "true",
@@ -71,10 +71,18 @@ properties([
7171
description: 'Space-separated list of target architectures',
7272
defaultValue: "x86_64 aarch64",
7373
trim: true),
74+
string(name: 'PODMAN_GIT_URL',
75+
description: 'Podman git repo',
76+
defaultValue: "https://github.com/containers/podman",
77+
trim: true),
7478
string(name: 'PODMAN_MACHINE_GIT_URL',
7579
description: 'Override the coreos-assembler git repo to use',
7680
defaultValue: "https://github.com/containers/podman-machine-os",
7781
trim: true),
82+
string(name: 'PODMAN_VERSION',
83+
description: 'Podman version',
84+
defaultValue: "main",
85+
trim: true),
7886
string(name: 'PODMAN_MACHINE_GIT_REF',
7987
description: 'Override the coreos-assembler git ref to use',
8088
defaultValue: "main",
@@ -123,6 +131,22 @@ def ncpus = ((cosa_memory_request_mb - 512) / 1536) as Integer
123131

124132

125133
node {
134+
change = checkout(
135+
changelog: true,
136+
poll: false,
137+
scm: [
138+
$class: 'GitSCM',
139+
branches: [[name: "origin/main"]],
140+
userRemoteConfigs: [[url: params.PODMAN_GIT_URL]],
141+
extensions: [[$class: 'CloneOption',
142+
noTags: true,
143+
reference: '',
144+
shallow: true]]
145+
]
146+
)
147+
148+
def version = shwrapCapture("grep '^const RawVersion' version/rawversion/version.go | cut -d\" -f2")
149+
126150
change = checkout(
127151
changelog: true,
128152
poll: false,
@@ -254,7 +278,7 @@ lock(resource: "build-podman-os") {
254278
}
255279
withCredentials([file(credentialsId: 'podman-push-registry-secret', variable: 'REGISTRY_SECRET')]) {
256280
stage("Push Manifest") {
257-
def manifest = "${params.CONTAINER_REGISTRY_STAGING_REPO}:5.1-${shortcommit}"
281+
def manifest = "${params.CONTAINER_REGISTRY_STAGING_REPO}:${version}-${shortcommit}"
258282
def cmds = "/usr/bin/buildah manifest create ${manifest}"
259283
parallel archinfo.keySet().collectEntries{arch -> [arch, {
260284
def image = "docker://${params.CONTAINER_REGISTRY_STAGING_REPO}:${arch}-${shortcommit}"
@@ -286,8 +310,8 @@ lock(resource: "build-podman-os") {
286310
// Release the manifest and container images
287311
shwrap("""
288312
skopeo copy --all --authfile \$REGISTRY_SECRET \
289-
docker://${params.CONTAINER_REGISTRY_STAGING_REPO}:5.1-${shortcommit} \
290-
docker://${params.CONTAINER_REGISTRY_REPO}:5.1
313+
docker://${params.CONTAINER_REGISTRY_STAGING_REPO}:${version}-${shortcommit} \
314+
docker://${params.CONTAINER_REGISTRY_REPO}:${version}
291315
""")
292316
}
293317
}
@@ -298,7 +322,7 @@ lock(resource: "build-podman-os") {
298322
shwrap("""
299323
export STORAGE_DRIVER=vfs # https://github.com/coreos/fedora-coreos-pipeline/issues/723#issuecomment-1297668507
300324
skopeo delete --authfile=\$REGISTRY_SECRET \
301-
docker://${params.CONTAINER_REGISTRY_STAGING_REPO}:5.1-${shortcommit}
325+
docker://${params.CONTAINER_REGISTRY_STAGING_REPO}:${version}-${shortcommit}
302326
""")
303327
}
304328
parallel archinfo.keySet().collectEntries{arch -> [arch, {

0 commit comments

Comments
 (0)