This commit is contained in:
Tobias Manske 2021-03-25 03:27:51 +01:00
commit 0574ec0b70
Signed by: tobias
GPG Key ID: D5914DC71F2F9352
4 changed files with 41 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
build/

8
Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM alpine:3.13
# Install cwebp and avifenc
RUN apk -U add libwebp-tools libavif-apps dav1d # rav1e #(soon?)
ADD ./generate_all /usr/bin/generate_all
RUN mkdir /src
WORKDIR /src
CMD ["/usr/bin/generate_all"]

29
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,29 @@
pipeline {
agent any
stages {
stage('Cloning our Git') {
steps {
checkout([$class: 'GitSCM',
branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'SubmoduleOption',
disableSubmodules: false,
parentCredentials: false,
recursiveSubmodules: true,
reference: '',
trackingSubmodules: false]],
submoduleCfg: [],
userRemoteConfigs: [[url: 'https://git.tobiasmanske.de/user/rad4day/public/docker-alpine-avif-webp/']]])
}
}
stage('Build HTML') {
steps {
dockerImage = docker.build("alpine-avif-webp:latest")
docker.withRegistry('https://registry.chaoswg.org:5000', 'docker-registry-credentials') {
dockerImage.push()
}
}
}
}
}

3
generate_all Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env sh
find ./ -type f -name '*.jpg' -exec sh -c 'cwebp $1 -o "${1%.jpg}.webp"' _ {} \;
find ./ -type f -name '*.png' -exec sh -c 'avifenc --min 10 --max 30 $1 "${1%.png}.avif"' _ {} \;