|
|
@ -35,7 +35,7 @@ pipeline {
|
|
|
|
script{
|
|
|
|
script{
|
|
|
|
env.EXIT_STATUS = ''
|
|
|
|
env.EXIT_STATUS = ''
|
|
|
|
env.LS_RELEASE = sh(
|
|
|
|
env.LS_RELEASE = sh(
|
|
|
|
script: '''curl -s https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases/latest | jq -r '. | .tag_name' ''',
|
|
|
|
script: '''docker run --rm alexeiled/skopeo sh -c 'skopeo inspect docker://docker.io/'${DOCKERHUB_IMAGE}':latest 2>/dev/null' | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''',
|
|
|
|
returnStdout: true).trim()
|
|
|
|
returnStdout: true).trim()
|
|
|
|
env.LS_RELEASE_NOTES = sh(
|
|
|
|
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' ''',
|
|
|
|
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' ''',
|
|
|
@ -230,7 +230,7 @@ pipeline {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
mkdir -p ${TEMPDIR}/gitbook
|
|
|
|
mkdir -p ${TEMPDIR}/gitbook
|
|
|
|
git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/gitbook/docker-documentation
|
|
|
|
git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/gitbook/docker-documentation
|
|
|
|
if [ "${BRANCH_NAME}" = "master" ] && [ ! -f ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md ] || [ "$(md5sum ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" ]; then
|
|
|
|
if [[ "${BRANCH_NAME}" == "master" ]] && [[ (! -f ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then
|
|
|
|
cp ${TEMPDIR}/${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md ${TEMPDIR}/gitbook/docker-documentation/images/
|
|
|
|
cp ${TEMPDIR}/${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md ${TEMPDIR}/gitbook/docker-documentation/images/
|
|
|
|
cd ${TEMPDIR}/gitbook/docker-documentation/
|
|
|
|
cd ${TEMPDIR}/gitbook/docker-documentation/
|
|
|
|
git add images/docker-${CONTAINER_NAME}.md
|
|
|
|
git add images/docker-${CONTAINER_NAME}.md
|
|
|
@ -305,15 +305,13 @@ pipeline {
|
|
|
|
sh '''#! /bin/bash
|
|
|
|
sh '''#! /bin/bash
|
|
|
|
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
|
|
|
|
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
sh "curl https://lsio-ci.ams3.digitaloceanspaces.com/qemu-arm-static -o qemu-arm-static"
|
|
|
|
|
|
|
|
sh "chmod +x qemu-*"
|
|
|
|
|
|
|
|
sh "docker build --no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
|
|
|
|
sh "docker build --no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
|
|
|
|
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
|
|
|
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
|
|
|
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
|
|
|
|
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
|
|
|
|
sh "docker push lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
|
|
|
|
sh "docker push lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
|
|
|
|
sh '''docker rmi \
|
|
|
|
sh '''docker rmi \
|
|
|
|
${IMAGE}:arm32v7-${META_TAG} \
|
|
|
|
${IMAGE}:arm32v7-${META_TAG} \
|
|
|
|
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} '''
|
|
|
|
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -334,15 +332,13 @@ pipeline {
|
|
|
|
sh '''#! /bin/bash
|
|
|
|
sh '''#! /bin/bash
|
|
|
|
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
|
|
|
|
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
sh "curl https://lsio-ci.ams3.digitaloceanspaces.com/qemu-aarch64-static -o qemu-aarch64-static"
|
|
|
|
|
|
|
|
sh "chmod +x qemu-*"
|
|
|
|
|
|
|
|
sh "docker build --no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
|
|
|
|
sh "docker build --no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
|
|
|
|
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
|
|
|
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
|
|
|
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
|
|
|
|
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
|
|
|
|
sh "docker push lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
|
|
|
|
sh "docker push lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
|
|
|
|
sh '''docker rmi \
|
|
|
|
sh '''docker rmi \
|
|
|
|
${IMAGE}:arm64v8-${META_TAG} \
|
|
|
|
${IMAGE}:arm64v8-${META_TAG} \
|
|
|
|
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} '''
|
|
|
|
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -506,7 +502,7 @@ pipeline {
|
|
|
|
sh "docker push ${IMAGE}:${META_TAG}"
|
|
|
|
sh "docker push ${IMAGE}:${META_TAG}"
|
|
|
|
sh '''docker rmi \
|
|
|
|
sh '''docker rmi \
|
|
|
|
${IMAGE}:${META_TAG} \
|
|
|
|
${IMAGE}:${META_TAG} \
|
|
|
|
${IMAGE}:latest '''
|
|
|
|
${IMAGE}:latest || :'''
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -563,7 +559,7 @@ pipeline {
|
|
|
|
${IMAGE}:arm64v8-${META_TAG} \
|
|
|
|
${IMAGE}:arm64v8-${META_TAG} \
|
|
|
|
${IMAGE}:arm64v8-latest \
|
|
|
|
${IMAGE}:arm64v8-latest \
|
|
|
|
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \
|
|
|
|
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \
|
|
|
|
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} '''
|
|
|
|
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -572,25 +568,25 @@ pipeline {
|
|
|
|
when {
|
|
|
|
when {
|
|
|
|
branch "master"
|
|
|
|
branch "master"
|
|
|
|
expression {
|
|
|
|
expression {
|
|
|
|
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-ls' + env.LS_TAG_NUMBER
|
|
|
|
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
|
|
|
}
|
|
|
|
}
|
|
|
|
environment name: 'CHANGE_ID', value: ''
|
|
|
|
environment name: 'CHANGE_ID', value: ''
|
|
|
|
environment name: 'EXIT_STATUS', value: ''
|
|
|
|
environment name: 'EXIT_STATUS', value: ''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
steps {
|
|
|
|
echo "Pushing New tag for current commit ${EXT_RELEASE_CLEAN}-pkg-${PACKAGE_TAG}-ls${LS_TAG_NUMBER}"
|
|
|
|
echo "Pushing New tag for current commit ${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}"
|
|
|
|
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \
|
|
|
|
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}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
|
|
|
|
-d '{"tag":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
|
|
|
|
"object": "'${COMMIT_SHA}'",\
|
|
|
|
"object": "'${COMMIT_SHA}'",\
|
|
|
|
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}' to master",\
|
|
|
|
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to master",\
|
|
|
|
"type": "commit",\
|
|
|
|
"type": "commit",\
|
|
|
|
"tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' '''
|
|
|
|
"tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' '''
|
|
|
|
echo "Pushing New release for Tag"
|
|
|
|
echo "Pushing New release for Tag"
|
|
|
|
sh '''#! /bin/bash
|
|
|
|
sh '''#! /bin/bash
|
|
|
|
echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json
|
|
|
|
echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json
|
|
|
|
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
|
|
|
|
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
|
|
|
|
"target_commitish": "master",\
|
|
|
|
"target_commitish": "master",\
|
|
|
|
"name": "'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
|
|
|
|
"name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
|
|
|
|
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**Remote Changes:**\\n\\n' > start
|
|
|
|
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**Remote Changes:**\\n\\n' > start
|
|
|
|
printf '","draft": false,"prerelease": false}' >> releasebody.json
|
|
|
|
printf '","draft": false,"prerelease": false}' >> releasebody.json
|
|
|
|
paste -d'\\0' start releasebody.json > releasebody.json.done
|
|
|
|
paste -d'\\0' start releasebody.json > releasebody.json.done
|
|
|
|