diff --git a/build-php.jenkins b/build-php.jenkins new file mode 100644 index 0000000..7cca294 --- /dev/null +++ b/build-php.jenkins @@ -0,0 +1,43 @@ +#!groovy + +def repository = "registry.c.test-chamber-13.lan" +def repositoryCreds = "harbor-repository-creds" + +def dockerFile = """FROM ${repository}/dockerhub/library/alpine:latest + +LABEL org.opencontainers.image.authors="The_Spider " + +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: repository, + imageDest: "${repository}/library/php-mysqli:latest", + dockerFile: dockerFile, + repoCreds: repositoryCreds, + ) + } +} \ No newline at end of file