|
|
|
@ -124,7 +124,7 @@ pipeline {
|
|
|
|
|
script{
|
|
|
|
|
env.IMAGE = env.DOCKERHUB_IMAGE
|
|
|
|
|
if (env.MULTIARCH == 'true') {
|
|
|
|
|
env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm32v6-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
|
|
|
|
env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
|
|
|
|
} else {
|
|
|
|
|
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
|
|
|
|
}
|
|
|
|
@ -142,7 +142,7 @@ pipeline {
|
|
|
|
|
script{
|
|
|
|
|
env.IMAGE = env.DEV_DOCKERHUB_IMAGE
|
|
|
|
|
if (env.MULTIARCH == 'true') {
|
|
|
|
|
env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm32v6-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
|
|
|
|
|
env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
|
|
|
|
|
} else {
|
|
|
|
|
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
|
|
|
|
|
}
|
|
|
|
@ -160,7 +160,7 @@ pipeline {
|
|
|
|
|
script{
|
|
|
|
|
env.IMAGE = env.PR_DOCKERHUB_IMAGE
|
|
|
|
|
if (env.MULTIARCH == 'true') {
|
|
|
|
|
env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm32v6-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
|
|
|
|
|
env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
|
|
|
|
|
} else {
|
|
|
|
|
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
|
|
|
|
|
}
|
|
|
|
@ -170,6 +170,35 @@ pipeline {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Run ShellCheck
|
|
|
|
|
stage('ShellCheck') {
|
|
|
|
|
when {
|
|
|
|
|
environment name: 'CI', value: 'true'
|
|
|
|
|
}
|
|
|
|
|
steps {
|
|
|
|
|
withCredentials([
|
|
|
|
|
string(credentialsId: 'spaces-key', variable: 'DO_KEY'),
|
|
|
|
|
string(credentialsId: 'spaces-secret', variable: 'DO_SECRET')
|
|
|
|
|
]) {
|
|
|
|
|
script{
|
|
|
|
|
env.SHELLCHECK_URL = 'https://lsio-ci.ams3.digitaloceanspaces.com/' + env.IMAGE + '/' + env.META_TAG + '/shellcheck-result.xml'
|
|
|
|
|
}
|
|
|
|
|
sh '''curl -sL https://raw.githubusercontent.com/linuxserver/docker-shellcheck/master/checkrun.sh | /bin/bash'''
|
|
|
|
|
sh '''#! /bin/bash
|
|
|
|
|
set -e
|
|
|
|
|
docker pull lsiodev/spaces-file-upload:latest
|
|
|
|
|
docker run --rm \
|
|
|
|
|
-e DESTINATION=\"${IMAGE}/${META_TAG}/shellcheck-result.xml\" \
|
|
|
|
|
-e FILE_NAME="shellcheck-result.xml" \
|
|
|
|
|
-e MIMETYPE="text/xml" \
|
|
|
|
|
-v ${WORKSPACE}:/mnt \
|
|
|
|
|
-e SECRET_KEY=\"${DO_SECRET}\" \
|
|
|
|
|
-e ACCESS_KEY=\"${DO_KEY}\" \
|
|
|
|
|
-t lsiodev/spaces-file-upload:latest \
|
|
|
|
|
python /upload.py'''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Use helper containers to render templated files
|
|
|
|
|
stage('Update-Templates') {
|
|
|
|
|
when {
|
|
|
|
@ -244,7 +273,7 @@ pipeline {
|
|
|
|
|
environment name: 'EXIT_STATUS', value: ''
|
|
|
|
|
}
|
|
|
|
|
steps {
|
|
|
|
|
sh "docker build --no-cache -t ${IMAGE}:${META_TAG} \
|
|
|
|
|
sh "docker build --no-cache --pull -t ${IMAGE}:${META_TAG} \
|
|
|
|
|
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -257,7 +286,7 @@ pipeline {
|
|
|
|
|
parallel {
|
|
|
|
|
stage('Build X86') {
|
|
|
|
|
steps {
|
|
|
|
|
sh "docker build --no-cache -t ${IMAGE}:amd64-${META_TAG} \
|
|
|
|
|
sh "docker build --no-cache --pull -t ${IMAGE}:amd64-${META_TAG} \
|
|
|
|
|
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -280,13 +309,13 @@ pipeline {
|
|
|
|
|
'''
|
|
|
|
|
sh "curl https://lsio-ci.ams3.digitaloceanspaces.com/qemu-arm-static -o qemu-arm-static"
|
|
|
|
|
sh "chmod +x qemu-*"
|
|
|
|
|
sh "docker build --no-cache -f Dockerfile.armhf -t ${IMAGE}:arm32v6-${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} ."
|
|
|
|
|
sh "docker tag ${IMAGE}:arm32v6-${META_TAG} lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER}"
|
|
|
|
|
sh "docker push lsiodev/buildcache:arm32v6-${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 rmi \
|
|
|
|
|
${IMAGE}:arm32v6-${META_TAG} \
|
|
|
|
|
lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER} '''
|
|
|
|
|
${IMAGE}:arm32v7-${META_TAG} \
|
|
|
|
|
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} '''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -309,7 +338,7 @@ pipeline {
|
|
|
|
|
'''
|
|
|
|
|
sh "curl https://lsio-ci.ams3.digitaloceanspaces.com/qemu-aarch64-static -o qemu-aarch64-static"
|
|
|
|
|
sh "chmod +x qemu-*"
|
|
|
|
|
sh "docker build --no-cache -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} ."
|
|
|
|
|
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
|
|
|
|
|
sh "docker push lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
|
|
|
|
@ -339,13 +368,13 @@ pipeline {
|
|
|
|
|
fi
|
|
|
|
|
if [ "${DIST_IMAGE}" == "alpine" ]; then
|
|
|
|
|
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
|
|
|
|
|
apk info > packages && \
|
|
|
|
|
apk info -v > versions && \
|
|
|
|
|
paste -d " " packages versions > /tmp/package_versions.txt && \
|
|
|
|
|
apk info -v > /tmp/package_versions.txt && \
|
|
|
|
|
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
|
|
|
|
|
chmod 777 /tmp/package_versions.txt'
|
|
|
|
|
elif [ "${DIST_IMAGE}" == "ubuntu" ]; then
|
|
|
|
|
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
|
|
|
|
|
apt list -qq --installed | cut -d" " -f1-2 > /tmp/package_versions.txt && \
|
|
|
|
|
apt list -qq --installed | sed "s#/.*now ##g" | cut -d" " -f1 > /tmp/package_versions.txt && \
|
|
|
|
|
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
|
|
|
|
|
chmod 777 /tmp/package_versions.txt'
|
|
|
|
|
fi
|
|
|
|
|
NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )
|
|
|
|
@ -425,9 +454,9 @@ pipeline {
|
|
|
|
|
set -e
|
|
|
|
|
docker pull lsiodev/ci:latest
|
|
|
|
|
if [ "${MULTIARCH}" == "true" ]; then
|
|
|
|
|
docker pull lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER}
|
|
|
|
|
docker pull lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}
|
|
|
|
|
docker pull lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}
|
|
|
|
|
docker tag lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v6-${META_TAG}
|
|
|
|
|
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
|
|
|
|
|
docker run --rm \
|
|
|
|
@ -504,38 +533,38 @@ pipeline {
|
|
|
|
|
'''
|
|
|
|
|
sh '''#! /bin/bash
|
|
|
|
|
if [ "${CI}" == "false" ]; then
|
|
|
|
|
docker pull lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER}
|
|
|
|
|
docker pull lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}
|
|
|
|
|
docker pull lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}
|
|
|
|
|
docker tag lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v6-${META_TAG}
|
|
|
|
|
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-latest"
|
|
|
|
|
sh "docker tag ${IMAGE}:arm32v6-${META_TAG} ${IMAGE}:arm32v6-latest"
|
|
|
|
|
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ${IMAGE}:arm32v7-latest"
|
|
|
|
|
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ${IMAGE}:arm64v8-latest"
|
|
|
|
|
sh "docker push ${IMAGE}:amd64-${META_TAG}"
|
|
|
|
|
sh "docker push ${IMAGE}:arm32v6-${META_TAG}"
|
|
|
|
|
sh "docker push ${IMAGE}:arm32v7-${META_TAG}"
|
|
|
|
|
sh "docker push ${IMAGE}:arm64v8-${META_TAG}"
|
|
|
|
|
sh "docker push ${IMAGE}:amd64-latest"
|
|
|
|
|
sh "docker push ${IMAGE}:arm32v6-latest"
|
|
|
|
|
sh "docker push ${IMAGE}:arm32v7-latest"
|
|
|
|
|
sh "docker push ${IMAGE}:arm64v8-latest"
|
|
|
|
|
sh "docker manifest push --purge ${IMAGE}:latest || :"
|
|
|
|
|
sh "docker manifest create ${IMAGE}:latest ${IMAGE}:amd64-latest ${IMAGE}:arm32v6-latest ${IMAGE}:arm64v8-latest"
|
|
|
|
|
sh "docker manifest annotate ${IMAGE}:latest ${IMAGE}:arm32v6-latest --os linux --arch arm"
|
|
|
|
|
sh "docker manifest create ${IMAGE}:latest ${IMAGE}:amd64-latest ${IMAGE}:arm32v7-latest ${IMAGE}:arm64v8-latest"
|
|
|
|
|
sh "docker manifest annotate ${IMAGE}:latest ${IMAGE}:arm32v7-latest --os linux --arch arm"
|
|
|
|
|
sh "docker manifest annotate ${IMAGE}:latest ${IMAGE}:arm64v8-latest --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}:arm32v6-${META_TAG} ${IMAGE}:arm64v8-${META_TAG}"
|
|
|
|
|
sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm32v6-${META_TAG} --os linux --arch arm"
|
|
|
|
|
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}:latest"
|
|
|
|
|
sh "docker manifest push --purge ${IMAGE}:${META_TAG}"
|
|
|
|
|
sh '''docker rmi \
|
|
|
|
|
${IMAGE}:amd64-${META_TAG} \
|
|
|
|
|
${IMAGE}:amd64-latest \
|
|
|
|
|
${IMAGE}:arm32v6-${META_TAG} \
|
|
|
|
|
${IMAGE}:arm32v6-latest \
|
|
|
|
|
${IMAGE}:arm32v7-${META_TAG} \
|
|
|
|
|
${IMAGE}:arm32v7-latest \
|
|
|
|
|
${IMAGE}:arm64v8-${META_TAG} \
|
|
|
|
|
${IMAGE}:arm64v8-latest \
|
|
|
|
|
lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER} \
|
|
|
|
|
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \
|
|
|
|
|
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} '''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -606,7 +635,7 @@ pipeline {
|
|
|
|
|
}
|
|
|
|
|
steps {
|
|
|
|
|
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/issues/${PULL_REQUEST}/comments \
|
|
|
|
|
-d '{"body": "I am a bot, here are the test results for this PR '${CI_URL}'"}' '''
|
|
|
|
|
-d '{"body": "I am a bot, here are the test results for this PR: \\n'${CI_URL}' \\n'${SHELLCHECK_URL}'"}' '''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -621,12 +650,12 @@ pipeline {
|
|
|
|
|
}
|
|
|
|
|
else if (currentBuild.currentResult == "SUCCESS"){
|
|
|
|
|
sh ''' curl -X POST --data '{"avatar_url": "https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png","embeds": [{"color": 1681177,\
|
|
|
|
|
"description": "**Build:** '${BUILD_NUMBER}'\\n**CI Results:** '${CI_URL}'\\n**Status:** Success\\n**Job:** '${RUN_DISPLAY_URL}'\\n**Change:** '${CODE_URL}'\\n**External Release:**: '${RELEASE_LINK}'\\n**DockerHub:** '${DOCKERHUB_LINK}'\\n"}],\
|
|
|
|
|
"description": "**Build:** '${BUILD_NUMBER}'\\n**CI Results:** '${CI_URL}'\\n**ShellCheck Results:** '${SHELLCHECK_URL}'\\n**Status:** Success\\n**Job:** '${RUN_DISPLAY_URL}'\\n**Change:** '${CODE_URL}'\\n**External Release:**: '${RELEASE_LINK}'\\n**DockerHub:** '${DOCKERHUB_LINK}'\\n"}],\
|
|
|
|
|
"username": "Jenkins"}' ${BUILDS_DISCORD} '''
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
sh ''' curl -X POST --data '{"avatar_url": "https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png","embeds": [{"color": 16711680,\
|
|
|
|
|
"description": "**Build:** '${BUILD_NUMBER}'\\n**CI Results:** '${CI_URL}'\\n**Status:** failure\\n**Job:** '${RUN_DISPLAY_URL}'\\n**Change:** '${CODE_URL}'\\n**External Release:**: '${RELEASE_LINK}'\\n**DockerHub:** '${DOCKERHUB_LINK}'\\n"}],\
|
|
|
|
|
"description": "**Build:** '${BUILD_NUMBER}'\\n**CI Results:** '${CI_URL}'\\n**ShellCheck Results:** '${SHELLCHECK_URL}'\\n**Status:** failure\\n**Job:** '${RUN_DISPLAY_URL}'\\n**Change:** '${CODE_URL}'\\n**External Release:**: '${RELEASE_LINK}'\\n**DockerHub:** '${DOCKERHUB_LINK}'\\n"}],\
|
|
|
|
|
"username": "Jenkins"}' ${BUILDS_DISCORD} '''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|