Skip to content

Commit

Permalink
jobs/build-podman-os.Jenkinsfile: get podman version from main
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
lsm5 committed Sep 20, 2024
1 parent 99772cd commit c72b9a3
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions jobs/build-podman-os.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def generate_diskvar_json(shortcommit, arch, artifacts, staging_repo, repo) {
"container-tag": "${arch}-${shortcommit}",
"extra-kargs-string": "",
"image-type": "${artifact["platform"]}",
"container-imgref": "ostree-remote-registry:fedora:${repo}:5.1",
"container-imgref": "ostree-remote-registry:fedora:${repo}:${version}",
"metal-image-size": "3072",
"cloud-image-size": "10240",
"deploy-via-container": "true",
Expand Down Expand Up @@ -71,10 +71,18 @@ properties([
description: 'Space-separated list of target architectures',
defaultValue: "x86_64 aarch64",
trim: true),
string(name: 'PODMAN_GIT_URL',
description: 'Podman git repo',
defaultValue: "https://github.com/containers/podman",
trim: true),
string(name: 'PODMAN_MACHINE_GIT_URL',
description: 'Override the coreos-assembler git repo to use',
defaultValue: "https://github.com/containers/podman-machine-os",
trim: true),
string(name: 'PODMAN_VERSION',
description: 'Podman version',
defaultValue: "main",
trim: true),
string(name: 'PODMAN_MACHINE_GIT_REF',
description: 'Override the coreos-assembler git ref to use',
defaultValue: "main",
Expand Down Expand Up @@ -122,6 +130,24 @@ def cosa_memory_request_mb = 4.5 * 1024 as Integer
def ncpus = ((cosa_memory_request_mb - 512) / 1536) as Integer


node {
change = checkout(
changelog: true,
poll: false,
scm: [
$class: 'GitSCM',
branches: [[name: "origin/main"]],
userRemoteConfigs: [[url: params.PODMAN_GIT_URL]],
extensions: [[$class: 'CloneOption',
noTags: true,
reference: '',
shallow: true]]
]
)

def version = shwrapCapture("grep '^const RawVersion' version/rawversion/version.go | cut -d\" -f2")
}

node {
change = checkout(
changelog: true,
Expand Down Expand Up @@ -254,7 +280,7 @@ lock(resource: "build-podman-os") {
}
withCredentials([file(credentialsId: 'podman-push-registry-secret', variable: 'REGISTRY_SECRET')]) {
stage("Push Manifest") {
def manifest = "${params.CONTAINER_REGISTRY_STAGING_REPO}:5.1-${shortcommit}"
def manifest = "${params.CONTAINER_REGISTRY_STAGING_REPO}:${version}-${shortcommit}"
def cmds = "/usr/bin/buildah manifest create ${manifest}"
parallel archinfo.keySet().collectEntries{arch -> [arch, {
def image = "docker://${params.CONTAINER_REGISTRY_STAGING_REPO}:${arch}-${shortcommit}"
Expand Down Expand Up @@ -286,8 +312,8 @@ lock(resource: "build-podman-os") {
// Release the manifest and container images
shwrap("""
skopeo copy --all --authfile \$REGISTRY_SECRET \
docker://${params.CONTAINER_REGISTRY_STAGING_REPO}:5.1-${shortcommit} \
docker://${params.CONTAINER_REGISTRY_REPO}:5.1
docker://${params.CONTAINER_REGISTRY_STAGING_REPO}:${version}-${shortcommit} \
docker://${params.CONTAINER_REGISTRY_REPO}:${version}
""")
}
}
Expand All @@ -298,7 +324,7 @@ lock(resource: "build-podman-os") {
shwrap("""
export STORAGE_DRIVER=vfs # https://github.com/coreos/fedora-coreos-pipeline/issues/723#issuecomment-1297668507
skopeo delete --authfile=\$REGISTRY_SECRET \
docker://${params.CONTAINER_REGISTRY_STAGING_REPO}:5.1-${shortcommit}
docker://${params.CONTAINER_REGISTRY_STAGING_REPO}:${version}-${shortcommit}
""")
}
parallel archinfo.keySet().collectEntries{arch -> [arch, {
Expand Down

0 comments on commit c72b9a3

Please sign in to comment.