From 31e9192300c9f3a39c4c5e2f0bcf773c556a7423 Mon Sep 17 00:00:00 2001 From: nhyatt Date: Sun, 10 Nov 2024 22:32:38 -0600 Subject: [PATCH] build darkice? --- build-darkice.jenkins | 72 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 build-darkice.jenkins diff --git a/build-darkice.jenkins b/build-darkice.jenkins new file mode 100644 index 0000000..588a5ca --- /dev/null +++ b/build-darkice.jenkins @@ -0,0 +1,72 @@ +#!groovy + +def repository = "registry.c.test-chamber-13.lan" +def repositoryCreds = "harbor-repository-creds" + +def workspace +def dockerFile + +def label = "kubernetes-${UUID.randomUUID().toString()}" +def templateName = "pipeline-worker" +pipeline { + agent { + kubernetes { + yaml functions.podYaml( + repo: repository, + templateName: templateName, + kaniko: true + ) + } + } + + stages { + stage ('Initalize Jenkins') { + steps { + script { + workspace = pwd() + dockerFile = """FROM ${repository}/dockerhub/library/debian:latest as builder +ARG DARKICE_VERSION="1.5" + +RUN apt-get update \\ + && apt-get --no-install-recommends --yes install ca-certificates curl build-essential tar pkg-config alsa-utils lame libmp3lame-dev libpulse-dev libjack-jackd2-dev libaudio-dev libasound2-dev libshout3-dev libmp3lame-dev \\ + && mkdir /tmp/build \\ + && curl -L https://github.com/rafael2k/darkice/releases/download/v\${DARKICE_VERSION}/darkice-\${DARKICE_VERSION}.tar.gz | tar -z -x -f - -C /tmp/build \\ + && cd /tmp/build/darkice-\${DARKICE_VERSION}/ \\ + && ./configure CXXFLAGS="-std=c++11" --with-pulseaudio --with-lame --with-alsa --with-jack \\ + && make + +FROM ${repository}/dockerhub/library/debian:latest + +LABEL org.opencontainers.image.authors="The_Spider " +LABEL org.opencontainers.image.title="darkice" + +COPY --from builder /tmp/build/darkice-\${DARKICE_VERSION}/src/darkice /usr/bin/local/ + +ENTRYPOINT [ "/bin/bash", "-c", "/usr/local/bin/darkice" ] +""" + } + } + } + + stage ('Build & Push') { + steps { + container ('kaniko') { + script { + declarativeFunctions.buildContainerMultipleDestinations( + dockerFile: dockerFile, + repositoryAccess: [ + [ + repository: repository, + credentials: repositoryCreds + ], + ], + destination: [ + "${repository}/library/darkice:latest", + ] + ) + } + } + } + } + } +}