Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jobs/build-podman-os.Jenkinsfile: get podman version from main #1040

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 29 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}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably going to want to pass in version as an argument to this function?

"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 @@ -123,6 +131,22 @@ def ncpus = ((cosa_memory_request_mb - 512) / 1536) as Integer


node {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is already a node { declaration higher up in this file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just me being a groovy noob :| . btw, there's another one below as well. Should I look at reusing either one or do you have a preference?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm weird. yeah, just re-use the one below

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now we have two change = checkout( statements with a scm trigger in it. I don't think that's what we want either.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, thinking about this further, I should grab podman version and upstream commit from the podman-next copr rpm that's fetched in the build process https://github.com/containers/podman-machine-os/blob/main/podman-image-daily/Containerfile#L31

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")

change = checkout(
changelog: true,
poll: false,
Expand Down Expand Up @@ -254,7 +278,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 +310,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 +322,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