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-gitea.jenkins

51 lines
1.4 KiB
Groovy

#!groovy
def repository = "registry.c.test-chamber-13.lan"
def repositoryCreds = "harbor-repository-creds"
def DF = """FROM ${repository}/dockerhub/gitea/gitea:latest-rootless
USER root
COPY test-chamber-13.lan.root.crt /usr/local/share/ca-certificates/test-chamber-13.lan.root.crt
RUN apk add --no-cache --virtual=.packagecache ca-certificates && \\
update-ca-certificates --fresh && \\
apk del .packagecache
USER git
"""
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()
stage ('Write cert to local file') {
writeFile(file: workspace + "/test-chamber-13.lan.root.crt", text: functions.getLocalRootCA())
}
functions.buildContainer(
repository: repository,
imageDest: "${repository}/library/gitea:latest-rootless",
dockerFile: dockerFile,
repoCreds: repositoryCreds
)
functions.deletePod(
kubeAuth: "k8s-monitoring-access",
kubeURL: "https://kubernetes.test-chamber-13.lan:6443",
namespace: "monitoring",
selector: "app=gitea,app.kubernetes.io/name=gitea"
)
}
}