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

43 lines
1.2 KiB
Groovy

#!groovy
def repository = "registry.c.test-chamber-13.lan"
def repositoryCreds = "harbor-repository-creds"
def dockerFile = """FROM ${repository}/dockerhub/library/php:latest
LABEL org.opencontainers.image.authors="The_Spider <spider@smoothnet.org>"
COPY test-chamber-13.lan.root.crt /usr/local/share/ca-certificates/test-chamber-13.lan.root.crt
RUN apt-get update && \\
apt-get upgrade -y && \\
apt-get autoremove -y && \\
apt-get clean && \\
rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* && \\
docker-php-ext-install mysqli
"""
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())
functions.buildContainer(
repository: "registry.hub.docker.com",
imageDest: "registry.hub.docker.com/thespider/php-mysqli:latest",
dockerFile: dockerFile,
repoCreds: "dockerhub-repository-creds",
)
}
}