mirror of
https://github.com/linuxserver/docker-code-server.git
synced 2024-11-23 04:25:40 +01:00
create development builds
This commit is contained in:
parent
e65bcbf996
commit
6bf1eb5d73
@ -14,17 +14,18 @@ RUN \
|
|||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get install -y \
|
apt-get install -y \
|
||||||
git \
|
git \
|
||||||
|
jq \
|
||||||
nano \
|
nano \
|
||||||
net-tools \
|
net-tools \
|
||||||
sudo && \
|
sudo && \
|
||||||
echo "**** install code-server ****" && \
|
echo "**** install code-server ****" && \
|
||||||
if [ -z ${CODE_RELEASE+x} ]; then \
|
if [ -z ${CODE_RELEASE+x} ]; then \
|
||||||
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases/latest" \
|
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases" \
|
||||||
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
|
| jq -r 'first(.[] | select(.prerelease == true)) | .tag_name'); \
|
||||||
fi && \
|
fi && \
|
||||||
curl -o \
|
curl -o \
|
||||||
/tmp/code.tar.gz -L \
|
/tmp/code.tar.gz -L \
|
||||||
"https://github.com/cdr/code-server/releases/download/${CODE_RELEASE}/code-server${CODE_RELEASE}-linux-x64.tar.gz" && \
|
"https://github.com/cdr/code-server/releases/download/${CODE_RELEASE}/code-server${CODE_RELEASE}-linux-x86_64.tar.gz" && \
|
||||||
tar xzf /tmp/code.tar.gz -C \
|
tar xzf /tmp/code.tar.gz -C \
|
||||||
/usr/bin/ --strip-components=1 \
|
/usr/bin/ --strip-components=1 \
|
||||||
--wildcards code-server*/code-server && \
|
--wildcards code-server*/code-server && \
|
||||||
|
92
Jenkinsfile
vendored
92
Jenkinsfile
vendored
@ -10,9 +10,8 @@ pipeline {
|
|||||||
environment {
|
environment {
|
||||||
BUILDS_DISCORD=credentials('build_webhook_url')
|
BUILDS_DISCORD=credentials('build_webhook_url')
|
||||||
GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab')
|
GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab')
|
||||||
EXT_GIT_BRANCH = 'master'
|
JSON_URL = 'https://api.github.com/repos/cdr/code-server/releases'
|
||||||
EXT_USER = 'cdr'
|
JSON_PATH = 'first(.[] | select(.prerelease == true)) | .tag_name'
|
||||||
EXT_REPO = 'code-server'
|
|
||||||
CONTAINER_NAME = 'code-server'
|
CONTAINER_NAME = 'code-server'
|
||||||
BUILD_VERSION_ARG = 'CODE_RELEASE'
|
BUILD_VERSION_ARG = 'CODE_RELEASE'
|
||||||
LS_USER = 'linuxserver'
|
LS_USER = 'linuxserver'
|
||||||
@ -38,7 +37,7 @@ pipeline {
|
|||||||
script{
|
script{
|
||||||
env.EXIT_STATUS = ''
|
env.EXIT_STATUS = ''
|
||||||
env.LS_RELEASE = sh(
|
env.LS_RELEASE = sh(
|
||||||
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' || : ''',
|
script: '''docker run --rm alexeiled/skopeo sh -c 'skopeo inspect docker://docker.io/'${DOCKERHUB_IMAGE}':development 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' ''',
|
||||||
@ -110,21 +109,14 @@ pipeline {
|
|||||||
/* ########################
|
/* ########################
|
||||||
External Release Tagging
|
External Release Tagging
|
||||||
######################## */
|
######################## */
|
||||||
// If this is a stable github release use the latest endpoint from github to determine the ext tag
|
// If this is a custom json endpoint parse the return to get external tag
|
||||||
stage("Set ENV github_stable"){
|
stage("Set ENV custom_json"){
|
||||||
steps{
|
steps{
|
||||||
script{
|
script{
|
||||||
env.EXT_RELEASE = sh(
|
env.EXT_RELEASE = sh(
|
||||||
script: '''curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''',
|
script: '''curl -s ${JSON_URL} | jq -r ". | ${JSON_PATH}" ''',
|
||||||
returnStdout: true).trim()
|
returnStdout: true).trim()
|
||||||
}
|
env.RELEASE_LINK = env.JSON_URL
|
||||||
}
|
|
||||||
}
|
|
||||||
// If this is a stable or devel github release generate the link for the build message
|
|
||||||
stage("Set ENV github_link"){
|
|
||||||
steps{
|
|
||||||
script{
|
|
||||||
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -138,10 +130,10 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If this is a master build use live docker endpoints
|
// If this is a development build use live docker endpoints
|
||||||
stage("Set ENV live build"){
|
stage("Set ENV live build"){
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "development"
|
||||||
environment name: 'CHANGE_ID', value: ''
|
environment name: 'CHANGE_ID', value: ''
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
@ -159,7 +151,7 @@ pipeline {
|
|||||||
// If this is a dev build use dev docker endpoints
|
// If this is a dev build use dev docker endpoints
|
||||||
stage("Set ENV dev build"){
|
stage("Set ENV dev build"){
|
||||||
when {
|
when {
|
||||||
not {branch "master"}
|
not {branch "development"}
|
||||||
environment name: 'CHANGE_ID', value: ''
|
environment name: 'CHANGE_ID', value: ''
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
@ -226,7 +218,7 @@ pipeline {
|
|||||||
// Use helper containers to render templated files
|
// Use helper containers to render templated files
|
||||||
stage('Update-Templates') {
|
stage('Update-Templates') {
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "development"
|
||||||
environment name: 'CHANGE_ID', value: ''
|
environment name: 'CHANGE_ID', value: ''
|
||||||
expression {
|
expression {
|
||||||
env.CONTAINER_NAME != null
|
env.CONTAINER_NAME != null
|
||||||
@ -237,16 +229,16 @@ pipeline {
|
|||||||
set -e
|
set -e
|
||||||
TEMPDIR=$(mktemp -d)
|
TEMPDIR=$(mktemp -d)
|
||||||
docker pull linuxserver/jenkins-builder:latest
|
docker pull linuxserver/jenkins-builder:latest
|
||||||
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/jenkins linuxserver/jenkins-builder:latest
|
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=development -v ${TEMPDIR}:/ansible/jenkins linuxserver/jenkins-builder:latest
|
||||||
docker pull linuxserver/doc-builder:latest
|
docker pull linuxserver/doc-builder:latest
|
||||||
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/readme linuxserver/doc-builder:latest
|
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=development -v ${TEMPDIR}:/ansible/readme linuxserver/doc-builder:latest
|
||||||
if [ "$(md5sum ${TEMPDIR}/${LS_REPO}/Jenkinsfile | awk '{ print $1 }')" != "$(md5sum Jenkinsfile | awk '{ print $1 }')" ] || \
|
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 }')" ] || \
|
[ "$(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}" ] || \
|
[ "$(cat ${TEMPDIR}/${LS_REPO}/LICENSE | md5sum | cut -c1-8)" != "${LICENSE_TAG}" ] || \
|
||||||
[ "$(cat ${TEMPDIR}/${LS_REPO}/.github/FUNDING.yml | md5sum | cut -c1-8)" != "${FUNDING_TAG}" ]; then
|
[ "$(cat ${TEMPDIR}/${LS_REPO}/.github/FUNDING.yml | md5sum | cut -c1-8)" != "${FUNDING_TAG}" ]; then
|
||||||
mkdir -p ${TEMPDIR}/repo
|
mkdir -p ${TEMPDIR}/repo
|
||||||
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_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 master
|
git --git-dir ${TEMPDIR}/repo/${LS_REPO}/.git checkout -f development
|
||||||
cp ${TEMPDIR}/${CONTAINER_NAME}/README.md ${TEMPDIR}/repo/${LS_REPO}/
|
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}/Jenkinsfile ${TEMPDIR}/repo/${LS_REPO}/
|
||||||
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/LICENSE ${TEMPDIR}/repo/${LS_REPO}/
|
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/LICENSE ${TEMPDIR}/repo/${LS_REPO}/
|
||||||
@ -280,7 +272,7 @@ pipeline {
|
|||||||
// Exit the build if the Templated files were just updated
|
// Exit the build if the Templated files were just updated
|
||||||
stage('Template-exit') {
|
stage('Template-exit') {
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "development"
|
||||||
environment name: 'CHANGE_ID', value: ''
|
environment name: 'CHANGE_ID', value: ''
|
||||||
environment name: 'FILES_UPDATED', value: 'true'
|
environment name: 'FILES_UPDATED', value: 'true'
|
||||||
expression {
|
expression {
|
||||||
@ -379,7 +371,7 @@ pipeline {
|
|||||||
// Take the image we just built and dump package versions for comparison
|
// Take the image we just built and dump package versions for comparison
|
||||||
stage('Update-packages') {
|
stage('Update-packages') {
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "development"
|
||||||
environment name: 'CHANGE_ID', value: ''
|
environment name: 'CHANGE_ID', value: ''
|
||||||
environment name: 'EXIT_STATUS', value: ''
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
}
|
}
|
||||||
@ -407,7 +399,7 @@ pipeline {
|
|||||||
echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github"
|
echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github"
|
||||||
if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then
|
if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then
|
||||||
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/${LS_REPO}
|
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/${LS_REPO}
|
||||||
git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f master
|
git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f development
|
||||||
cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/
|
cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/
|
||||||
cd ${TEMPDIR}/${LS_REPO}/
|
cd ${TEMPDIR}/${LS_REPO}/
|
||||||
wait
|
wait
|
||||||
@ -431,7 +423,7 @@ pipeline {
|
|||||||
// Exit the build if the package file was just updated
|
// Exit the build if the package file was just updated
|
||||||
stage('PACKAGE-exit') {
|
stage('PACKAGE-exit') {
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "development"
|
||||||
environment name: 'CHANGE_ID', value: ''
|
environment name: 'CHANGE_ID', value: ''
|
||||||
environment name: 'PACKAGE_UPDATED', value: 'true'
|
environment name: 'PACKAGE_UPDATED', value: 'true'
|
||||||
environment name: 'EXIT_STATUS', value: ''
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
@ -445,7 +437,7 @@ pipeline {
|
|||||||
// Exit the build if this is just a package check and there are no changes to push
|
// Exit the build if this is just a package check and there are no changes to push
|
||||||
stage('PACKAGECHECK-exit') {
|
stage('PACKAGECHECK-exit') {
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "development"
|
||||||
environment name: 'CHANGE_ID', value: ''
|
environment name: 'CHANGE_ID', value: ''
|
||||||
environment name: 'PACKAGE_UPDATED', value: 'false'
|
environment name: 'PACKAGE_UPDATED', value: 'false'
|
||||||
environment name: 'EXIT_STATUS', value: ''
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
@ -530,12 +522,12 @@ pipeline {
|
|||||||
sh '''#! /bin/bash
|
sh '''#! /bin/bash
|
||||||
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
|
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
|
||||||
'''
|
'''
|
||||||
sh "docker tag ${IMAGE}:${META_TAG} ${IMAGE}:latest"
|
sh "docker tag ${IMAGE}:${META_TAG} ${IMAGE}:development"
|
||||||
sh "docker push ${IMAGE}:latest"
|
sh "docker push ${IMAGE}:development"
|
||||||
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}:development || :'''
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -565,32 +557,32 @@ pipeline {
|
|||||||
docker tag lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v7-${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}
|
docker tag lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG}
|
||||||
fi'''
|
fi'''
|
||||||
sh "docker tag ${IMAGE}:amd64-${META_TAG} ${IMAGE}:amd64-latest"
|
sh "docker tag ${IMAGE}:amd64-${META_TAG} ${IMAGE}:amd64-development"
|
||||||
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ${IMAGE}:arm32v7-latest"
|
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ${IMAGE}:arm32v7-development"
|
||||||
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ${IMAGE}:arm64v8-latest"
|
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ${IMAGE}:arm64v8-development"
|
||||||
sh "docker push ${IMAGE}:amd64-${META_TAG}"
|
sh "docker push ${IMAGE}:amd64-${META_TAG}"
|
||||||
sh "docker push ${IMAGE}:arm32v7-${META_TAG}"
|
sh "docker push ${IMAGE}:arm32v7-${META_TAG}"
|
||||||
sh "docker push ${IMAGE}:arm64v8-${META_TAG}"
|
sh "docker push ${IMAGE}:arm64v8-${META_TAG}"
|
||||||
sh "docker push ${IMAGE}:amd64-latest"
|
sh "docker push ${IMAGE}:amd64-development"
|
||||||
sh "docker push ${IMAGE}:arm32v7-latest"
|
sh "docker push ${IMAGE}:arm32v7-development"
|
||||||
sh "docker push ${IMAGE}:arm64v8-latest"
|
sh "docker push ${IMAGE}:arm64v8-development"
|
||||||
sh "docker manifest push --purge ${IMAGE}:latest || :"
|
sh "docker manifest push --purge ${IMAGE}:development || :"
|
||||||
sh "docker manifest create ${IMAGE}:latest ${IMAGE}:amd64-latest ${IMAGE}:arm32v7-latest ${IMAGE}:arm64v8-latest"
|
sh "docker manifest create ${IMAGE}:development ${IMAGE}:amd64-development ${IMAGE}:arm32v7-development ${IMAGE}:arm64v8-development"
|
||||||
sh "docker manifest annotate ${IMAGE}:latest ${IMAGE}:arm32v7-latest --os linux --arch arm"
|
sh "docker manifest annotate ${IMAGE}:development ${IMAGE}:arm32v7-development --os linux --arch arm"
|
||||||
sh "docker manifest annotate ${IMAGE}:latest ${IMAGE}:arm64v8-latest --os linux --arch arm64 --variant v8"
|
sh "docker manifest annotate ${IMAGE}:development ${IMAGE}:arm64v8-development --os linux --arch arm64 --variant v8"
|
||||||
sh "docker manifest push --purge ${IMAGE}:${META_TAG} || :"
|
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 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}: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 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}:development"
|
||||||
sh "docker manifest push --purge ${IMAGE}:${META_TAG}"
|
sh "docker manifest push --purge ${IMAGE}:${META_TAG}"
|
||||||
sh '''docker rmi \
|
sh '''docker rmi \
|
||||||
${IMAGE}:amd64-${META_TAG} \
|
${IMAGE}:amd64-${META_TAG} \
|
||||||
${IMAGE}:amd64-latest \
|
${IMAGE}:amd64-development \
|
||||||
${IMAGE}:arm32v7-${META_TAG} \
|
${IMAGE}:arm32v7-${META_TAG} \
|
||||||
${IMAGE}:arm32v7-latest \
|
${IMAGE}:arm32v7-development \
|
||||||
${IMAGE}:arm64v8-${META_TAG} \
|
${IMAGE}:arm64v8-${META_TAG} \
|
||||||
${IMAGE}:arm64v8-latest \
|
${IMAGE}:arm64v8-development \
|
||||||
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} || :'''
|
||||||
}
|
}
|
||||||
@ -599,7 +591,7 @@ pipeline {
|
|||||||
// If this is a public release tag it in the LS Github
|
// If this is a public release tag it in the LS Github
|
||||||
stage('Github-Tag-Push-Release') {
|
stage('Github-Tag-Push-Release') {
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "development"
|
||||||
expression {
|
expression {
|
||||||
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
||||||
}
|
}
|
||||||
@ -611,17 +603,17 @@ pipeline {
|
|||||||
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}'-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}'-ls'${LS_TAG_NUMBER}' to master",\
|
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to development",\
|
||||||
"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
|
||||||
curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
|
echo "Data change at JSON endpoint ${JSON_URL}" > releasebody.json
|
||||||
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
|
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
|
||||||
"target_commitish": "master",\
|
"target_commitish": "development",\
|
||||||
"name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
|
"name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
|
||||||
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**'${EXT_REPO}' 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": true}' >> releasebody.json
|
||||||
paste -d'\\0' start releasebody.json > releasebody.json.done
|
paste -d'\\0' start releasebody.json > releasebody.json.done
|
||||||
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done'''
|
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done'''
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,14 @@ The architectures supported by this image are:
|
|||||||
| :----: | --- |
|
| :----: | --- |
|
||||||
| x86-64 | amd64-latest |
|
| x86-64 | amd64-latest |
|
||||||
|
|
||||||
|
## Version Tags
|
||||||
|
|
||||||
|
This image provides various versions that are available via tags. `latest` tag usually provides the latest stable version. Others are considered under development and caution must be exercised when using them.
|
||||||
|
|
||||||
|
| Tag | Description |
|
||||||
|
| :----: | --- |
|
||||||
|
| latest | Stable releases |
|
||||||
|
| development | Prereleases from their GitHub |
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
@ -2,14 +2,13 @@
|
|||||||
|
|
||||||
# jenkins variables
|
# jenkins variables
|
||||||
project_name: docker-code-server
|
project_name: docker-code-server
|
||||||
external_type: github_stable
|
external_type: custom_json
|
||||||
release_type: stable
|
release_type: prerelease
|
||||||
release_tag: latest
|
release_tag: development
|
||||||
ls_branch: master
|
ls_branch: development
|
||||||
repo_vars:
|
repo_vars:
|
||||||
- EXT_GIT_BRANCH = 'master'
|
- JSON_URL = 'https://api.github.com/repos/cdr/code-server/releases'
|
||||||
- EXT_USER = 'cdr'
|
- JSON_PATH = 'first(.[] | select(.prerelease == true)) | .tag_name'
|
||||||
- EXT_REPO = 'code-server'
|
|
||||||
- CONTAINER_NAME = 'code-server'
|
- CONTAINER_NAME = 'code-server'
|
||||||
- BUILD_VERSION_ARG = 'CODE_RELEASE'
|
- BUILD_VERSION_ARG = 'CODE_RELEASE'
|
||||||
- LS_USER = 'linuxserver'
|
- LS_USER = 'linuxserver'
|
||||||
|
@ -24,10 +24,10 @@ available_architectures:
|
|||||||
- { arch: "{{ arch_x86_64 }}", tag: "amd64-latest"}
|
- { arch: "{{ arch_x86_64 }}", tag: "amd64-latest"}
|
||||||
|
|
||||||
# development version
|
# development version
|
||||||
development_versions: false
|
development_versions: true
|
||||||
development_versions_items:
|
development_versions_items:
|
||||||
- { tag: "latest", desc: "Stable releases" }
|
- { tag: "latest", desc: "Stable releases" }
|
||||||
- { tag: "development", desc: "Releases from the `develop` branch" }
|
- { tag: "development", desc: "Prereleases from their GitHub" }
|
||||||
|
|
||||||
# container parameters
|
# container parameters
|
||||||
common_param_env_vars_enabled: true
|
common_param_env_vars_enabled: true
|
||||||
|
Loading…
Reference in New Issue
Block a user