This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
build-containers/build-ubi.jenkins

50 lines
1.4 KiB
Plaintext

def repository = "registry.c.test-chamber-13.lan"
def repositoryCreds = "harbor-repository-creds"
def ubiOS = ["8"]
def ubiImages = ["ubi-minimal", "ubi"]
def label = "kubernetes-${UUID.randomUUID().toString()}"
def templateName = "pipeline-worker"
podTemplate (
label: label,
name: templateName,
yaml: functions.podYaml(
repo: repository,
templateName: templateName,
kaniko: true
)
){
node (label) {
def workspace = pwd()
writeFile(file: workspace + "/test-chamber-13.lan.root.crt", text: functions.getLocalRootCA())
for (rhOS in ubiOS) {
for (image in ubiImages) {
def updateCmd
if (image == "ubi-minimal") {
updateCmd = "microdnf"
} else {
updateCmd = "dnf"
}
def dockerFile = """FROM registry.access.redhat.com/ubi${rhOS}/${image}:latest
COPY test-chamber-13.lan.root.crt /etc/pki/ca-trust/source/anchors/test-chamber-13.lan.root.crt
RUN update-ca-trust extract && \\
${updateCmd} update -y && \\
${updateCmd} clean all
"""
functions.buildContainer(
repository: repository,
imageDest: "${repository}/library/rhubi/${image}:${rhOS}",
dockerFile: dockerFile,
repoCreds: repositoryCreds,
)
}
}
}
}