adds calibre
This commit is contained in:
parent
9afa322d0b
commit
3d98442bd8
68
build-book-converter.jenkins
Normal file
68
build-book-converter.jenkins
Normal file
@ -0,0 +1,68 @@
|
||||
#!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()
|
||||
def calibreVer = "5.40.0"
|
||||
dockerFile = """FROM ${repository}/dockerhub/library/ubuntu:focal
|
||||
|
||||
LABEL org.opencontainers.image.authors="The_Spider <spider@smoothnet.org>"
|
||||
LABEL org.opencontainers.image.title="calibre"
|
||||
LABEL org.opencontainers.image.description="Docker container for converting ebooks"
|
||||
LABEL org.opencontainers.image.base.name="docker.io/library/ubuntu:focal"
|
||||
|
||||
RUN apt-get update && \\
|
||||
apt-get upgrade -y && \\
|
||||
apt-get install -y --no-install-recommends curl xz-utils libgl1 libxcb1 && \\
|
||||
mkdir -p /opt/calibre && \\
|
||||
curl -Lks "https://nexus.c.test-chamber-13.lan/repository/calibre/${calibreVer}/calibre-${calibreVer}-x86_64.txz" -o /tmp/calibre.tar.xz && \\
|
||||
tar -J -x -f /tmp/calibre.tar.xz -C /opt/calibre && \\
|
||||
rm -f /tmp/calibre.tar.xz
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ('Build & Push') {
|
||||
steps {
|
||||
container ('kaniko') {
|
||||
script {
|
||||
declarativeFunctions.buildContainerMultipleDestinations(
|
||||
dockerFile: dockerFile,
|
||||
repositoryAccess: [
|
||||
[
|
||||
repository: repository,
|
||||
credentials: repositoryCreds
|
||||
],
|
||||
],
|
||||
destination: [
|
||||
"${repository}/library/calibre:latest",
|
||||
]
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user