52 lines
1.4 KiB
Groovy
52 lines
1.4 KiB
Groovy
#!groovy
|
|
|
|
def repository = "registry.c.test-chamber-13.lan"
|
|
def repositoryCreds = "harbor-repository-creds"
|
|
|
|
def dockerFile = """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,
|
|
alpine: 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-development-access",
|
|
kubeURL: "https://kubernetes.test-chamber-13.lan:6443",
|
|
namespace: "development",
|
|
selector: "app=gitea,app.kubernetes.io/name=gitea"
|
|
)
|
|
}
|
|
} |