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-darkice.jenkins
2024-11-10 23:42:38 -06:00

77 lines
2.5 KiB
Groovy

#!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"
def darkiceVersion = "1.5"
pipeline {
agent {
kubernetes {
yaml functions.podYaml(
repo: repository,
templateName: templateName,
kaniko: true
)
}
}
stages {
stage ('Initalize Jenkins') {
steps {
script {
workspace = pwd()
dockerFile = """FROM ${repository}/dockerhub/arm64v8/debian:latest as builder
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${darkiceVersion}/darkice-${darkiceVersion}.tar.gz | tar -z -x -f - -C /tmp/build \\
&& cd /tmp/build/darkice-${darkiceVersion}/ \\
&& ./configure CXXFLAGS="-std=c++11" --with-pulseaudio --with-lame --with-alsa --with-jack \\
&& make
FROM ${repository}/dockerhub/arm64v8/debian:latest
LABEL org.opencontainers.image.authors="The_Spider <spider@smoothnet.org>"
LABEL org.opencontainers.image.title="darkice"
COPY --from=builder /tmp/build/darkice-${darkiceVersion}/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",
],
buildArg: [
"--custom-platform=linux/arm/v8",
]
)
}
}
}
}
}
}