Rename to calibre
This commit is contained in:
parent
77b3ae63d0
commit
17ff73aaf7
58
Jenkinsfile
vendored
58
Jenkinsfile
vendored
@ -31,7 +31,7 @@ pipeline {
|
||||
script{
|
||||
env.EXIT_STATUS = ''
|
||||
env.LS_RELEASE = sh(
|
||||
script: '''docker run --rm alexeiled/skopeo sh -c 'skopeo inspect docker://docker.io/'${DOCKERHUB_IMAGE}':mod 2>/dev/null' | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''',
|
||||
script: '''docker run --rm alexeiled/skopeo sh -c 'skopeo inspect docker://docker.io/'${DOCKERHUB_IMAGE}':calibre 2>/dev/null' | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''',
|
||||
returnStdout: true).trim()
|
||||
env.LS_RELEASE_NOTES = sh(
|
||||
script: '''cat readme-vars.yml | awk -F \\" '/date: "[0-9][0-9].[0-9][0-9].[0-9][0-9]:/ {print $4;exit;}' | sed -E ':a;N;$!ba;s/\\r{0,1}\\n/\\\\n/g' ''',
|
||||
@ -123,10 +123,10 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
// If this is a mod build use live docker endpoints
|
||||
// If this is a calibre build use live docker endpoints
|
||||
stage("Set ENV live build"){
|
||||
when {
|
||||
branch "mod"
|
||||
branch "calibre"
|
||||
environment name: 'CHANGE_ID', value: ''
|
||||
}
|
||||
steps {
|
||||
@ -144,7 +144,7 @@ pipeline {
|
||||
// If this is a dev build use dev docker endpoints
|
||||
stage("Set ENV dev build"){
|
||||
when {
|
||||
not {branch "mod"}
|
||||
not {branch "calibre"}
|
||||
environment name: 'CHANGE_ID', value: ''
|
||||
}
|
||||
steps {
|
||||
@ -211,7 +211,7 @@ pipeline {
|
||||
// Use helper containers to render templated files
|
||||
stage('Update-Templates') {
|
||||
when {
|
||||
branch "mod"
|
||||
branch "calibre"
|
||||
environment name: 'CHANGE_ID', value: ''
|
||||
expression {
|
||||
env.CONTAINER_NAME != null
|
||||
@ -222,15 +222,15 @@ pipeline {
|
||||
set -e
|
||||
TEMPDIR=$(mktemp -d)
|
||||
docker pull linuxserver/jenkins-builder:latest
|
||||
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=mod -v ${TEMPDIR}:/ansible/jenkins linuxserver/jenkins-builder:latest
|
||||
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=calibre -v ${TEMPDIR}:/ansible/jenkins linuxserver/jenkins-builder:latest
|
||||
docker pull linuxserver/doc-builder:latest
|
||||
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=mod -v ${TEMPDIR}:/ansible/readme linuxserver/doc-builder:latest
|
||||
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=calibre -v ${TEMPDIR}:/ansible/readme linuxserver/doc-builder:latest
|
||||
if [ "$(md5sum ${TEMPDIR}/${LS_REPO}/Jenkinsfile | awk '{ print $1 }')" != "$(md5sum Jenkinsfile | awk '{ print $1 }')" ] || \
|
||||
[ "$(md5sum ${TEMPDIR}/${CONTAINER_NAME}/README.md | awk '{ print $1 }')" != "$(md5sum README.md | awk '{ print $1 }')" ] || \
|
||||
[ "$(cat ${TEMPDIR}/${LS_REPO}/LICENSE | md5sum | cut -c1-8)" != "${LICENSE_TAG}" ]; then
|
||||
mkdir -p ${TEMPDIR}/repo
|
||||
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
|
||||
git --git-dir ${TEMPDIR}/repo/${LS_REPO}/.git checkout -f mod
|
||||
git --git-dir ${TEMPDIR}/repo/${LS_REPO}/.git checkout -f calibre
|
||||
cp ${TEMPDIR}/${CONTAINER_NAME}/README.md ${TEMPDIR}/repo/${LS_REPO}/
|
||||
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile ${TEMPDIR}/repo/${LS_REPO}/
|
||||
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/LICENSE ${TEMPDIR}/repo/${LS_REPO}/
|
||||
@ -262,7 +262,7 @@ pipeline {
|
||||
// Exit the build if the Templated files were just updated
|
||||
stage('Template-exit') {
|
||||
when {
|
||||
branch "mod"
|
||||
branch "calibre"
|
||||
environment name: 'CHANGE_ID', value: ''
|
||||
environment name: 'FILES_UPDATED', value: 'true'
|
||||
expression {
|
||||
@ -429,12 +429,12 @@ pipeline {
|
||||
sh '''#! /bin/bash
|
||||
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
|
||||
'''
|
||||
sh "docker tag ${IMAGE}:${META_TAG} ${IMAGE}:mod"
|
||||
sh "docker push ${IMAGE}:mod"
|
||||
sh "docker tag ${IMAGE}:${META_TAG} ${IMAGE}:calibre"
|
||||
sh "docker push ${IMAGE}:calibre"
|
||||
sh "docker push ${IMAGE}:${META_TAG}"
|
||||
sh '''docker rmi \
|
||||
${IMAGE}:${META_TAG} \
|
||||
${IMAGE}:mod || :'''
|
||||
${IMAGE}:calibre || :'''
|
||||
|
||||
}
|
||||
}
|
||||
@ -464,32 +464,32 @@ pipeline {
|
||||
docker tag lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v7-${META_TAG}
|
||||
docker tag lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG}
|
||||
fi'''
|
||||
sh "docker tag ${IMAGE}:amd64-${META_TAG} ${IMAGE}:amd64-mod"
|
||||
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ${IMAGE}:arm32v7-mod"
|
||||
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ${IMAGE}:arm64v8-mod"
|
||||
sh "docker tag ${IMAGE}:amd64-${META_TAG} ${IMAGE}:amd64-calibre"
|
||||
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ${IMAGE}:arm32v7-calibre"
|
||||
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ${IMAGE}:arm64v8-calibre"
|
||||
sh "docker push ${IMAGE}:amd64-${META_TAG}"
|
||||
sh "docker push ${IMAGE}:arm32v7-${META_TAG}"
|
||||
sh "docker push ${IMAGE}:arm64v8-${META_TAG}"
|
||||
sh "docker push ${IMAGE}:amd64-mod"
|
||||
sh "docker push ${IMAGE}:arm32v7-mod"
|
||||
sh "docker push ${IMAGE}:arm64v8-mod"
|
||||
sh "docker manifest push --purge ${IMAGE}:mod || :"
|
||||
sh "docker manifest create ${IMAGE}:mod ${IMAGE}:amd64-mod ${IMAGE}:arm32v7-mod ${IMAGE}:arm64v8-mod"
|
||||
sh "docker manifest annotate ${IMAGE}:mod ${IMAGE}:arm32v7-mod --os linux --arch arm"
|
||||
sh "docker manifest annotate ${IMAGE}:mod ${IMAGE}:arm64v8-mod --os linux --arch arm64 --variant v8"
|
||||
sh "docker push ${IMAGE}:amd64-calibre"
|
||||
sh "docker push ${IMAGE}:arm32v7-calibre"
|
||||
sh "docker push ${IMAGE}:arm64v8-calibre"
|
||||
sh "docker manifest push --purge ${IMAGE}:calibre || :"
|
||||
sh "docker manifest create ${IMAGE}:calibre ${IMAGE}:amd64-calibre ${IMAGE}:arm32v7-calibre ${IMAGE}:arm64v8-calibre"
|
||||
sh "docker manifest annotate ${IMAGE}:calibre ${IMAGE}:arm32v7-calibre --os linux --arch arm"
|
||||
sh "docker manifest annotate ${IMAGE}:calibre ${IMAGE}:arm64v8-calibre --os linux --arch arm64 --variant v8"
|
||||
sh "docker manifest push --purge ${IMAGE}:${META_TAG} || :"
|
||||
sh "docker manifest create ${IMAGE}:${META_TAG} ${IMAGE}:amd64-${META_TAG} ${IMAGE}:arm32v7-${META_TAG} ${IMAGE}:arm64v8-${META_TAG}"
|
||||
sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm32v7-${META_TAG} --os linux --arch arm"
|
||||
sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8"
|
||||
sh "docker manifest push --purge ${IMAGE}:mod"
|
||||
sh "docker manifest push --purge ${IMAGE}:calibre"
|
||||
sh "docker manifest push --purge ${IMAGE}:${META_TAG}"
|
||||
sh '''docker rmi \
|
||||
${IMAGE}:amd64-${META_TAG} \
|
||||
${IMAGE}:amd64-mod \
|
||||
${IMAGE}:amd64-calibre \
|
||||
${IMAGE}:arm32v7-${META_TAG} \
|
||||
${IMAGE}:arm32v7-mod \
|
||||
${IMAGE}:arm32v7-calibre \
|
||||
${IMAGE}:arm64v8-${META_TAG} \
|
||||
${IMAGE}:arm64v8-mod \
|
||||
${IMAGE}:arm64v8-calibre \
|
||||
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \
|
||||
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
|
||||
}
|
||||
@ -498,7 +498,7 @@ pipeline {
|
||||
// If this is a public release tag it in the LS Github
|
||||
stage('Github-Tag-Push-Release') {
|
||||
when {
|
||||
branch "mod"
|
||||
branch "calibre"
|
||||
expression {
|
||||
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
||||
}
|
||||
@ -510,14 +510,14 @@ pipeline {
|
||||
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \
|
||||
-d '{"tag":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
|
||||
"object": "'${COMMIT_SHA}'",\
|
||||
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to mod",\
|
||||
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to calibre",\
|
||||
"type": "commit",\
|
||||
"tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' '''
|
||||
echo "Pushing New release for Tag"
|
||||
sh '''#! /bin/bash
|
||||
curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
|
||||
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
|
||||
"target_commitish": "mod",\
|
||||
"target_commitish": "calibre",\
|
||||
"name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
|
||||
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**'${EXT_REPO}' Changes:**\\n\\n' > start
|
||||
printf '","draft": false,"prerelease": true}' >> releasebody.json
|
||||
|
@ -4,8 +4,8 @@
|
||||
project_name: docker-calibre-web
|
||||
external_type: github_stable
|
||||
release_type: prerelease
|
||||
release_tag: mod
|
||||
ls_branch: mod
|
||||
release_tag: calibre
|
||||
ls_branch: calibre
|
||||
skip_package_check: true
|
||||
repo_vars:
|
||||
- EXT_GIT_BRANCH = 'master'
|
||||
|
Loading…
Reference in New Issue
Block a user