-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
branching 3.9 to bump master to 3.10
- Loading branch information
Showing
2 changed files
with
18 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,10 +118,10 @@ pipeline { | |
} | ||
} | ||
} | ||
// If this is a master build use live docker endpoints | ||
// If this is a 3.9 build use live docker endpoints | ||
stage("Set ENV live build"){ | ||
when { | ||
branch "master" | ||
branch "3.9" | ||
environment name: 'CHANGE_ID', value: '' | ||
} | ||
steps { | ||
|
@@ -139,7 +139,7 @@ pipeline { | |
// If this is a dev build use dev docker endpoints | ||
stage("Set ENV dev build"){ | ||
when { | ||
not {branch "master"} | ||
not {branch "3.9"} | ||
environment name: 'CHANGE_ID', value: '' | ||
} | ||
steps { | ||
|
@@ -206,7 +206,7 @@ pipeline { | |
// Use helper containers to render templated files | ||
stage('Update-Templates') { | ||
when { | ||
branch "master" | ||
branch "3.9" | ||
environment name: 'CHANGE_ID', value: '' | ||
expression { | ||
env.CONTAINER_NAME != null | ||
|
@@ -217,15 +217,15 @@ pipeline { | |
set -e | ||
TEMPDIR=$(mktemp -d) | ||
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=3.9 -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=master -v ${TEMPDIR}:/ansible/readme linuxserver/doc-builder:latest | ||
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=3.9 -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 master | ||
git --git-dir ${TEMPDIR}/repo/${LS_REPO}/.git checkout -f 3.9 | ||
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}/ | ||
|
@@ -257,7 +257,7 @@ pipeline { | |
// Exit the build if the Templated files were just updated | ||
stage('Template-exit') { | ||
when { | ||
branch "master" | ||
branch "3.9" | ||
environment name: 'CHANGE_ID', value: '' | ||
environment name: 'FILES_UPDATED', value: 'true' | ||
expression { | ||
|
@@ -356,7 +356,7 @@ pipeline { | |
// Take the image we just built and dump package versions for comparison | ||
stage('Update-packages') { | ||
when { | ||
branch "master" | ||
branch "3.9" | ||
environment name: 'CHANGE_ID', value: '' | ||
environment name: 'EXIT_STATUS', value: '' | ||
} | ||
|
@@ -384,7 +384,7 @@ pipeline { | |
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 | ||
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 3.9 | ||
cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/ | ||
cd ${TEMPDIR}/${LS_REPO}/ | ||
wait | ||
|
@@ -408,7 +408,7 @@ pipeline { | |
// Exit the build if the package file was just updated | ||
stage('PACKAGE-exit') { | ||
when { | ||
branch "master" | ||
branch "3.9" | ||
environment name: 'CHANGE_ID', value: '' | ||
environment name: 'PACKAGE_UPDATED', value: 'true' | ||
environment name: 'EXIT_STATUS', value: '' | ||
|
@@ -422,7 +422,7 @@ pipeline { | |
// Exit the build if this is just a package check and there are no changes to push | ||
stage('PACKAGECHECK-exit') { | ||
when { | ||
branch "master" | ||
branch "3.9" | ||
environment name: 'CHANGE_ID', value: '' | ||
environment name: 'PACKAGE_UPDATED', value: 'false' | ||
environment name: 'EXIT_STATUS', value: '' | ||
|
@@ -567,7 +567,7 @@ pipeline { | |
// If this is a public release tag it in the LS Github | ||
stage('Github-Tag-Push-Release') { | ||
when { | ||
branch "master" | ||
branch "3.9" | ||
expression { | ||
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER | ||
} | ||
|
@@ -579,17 +579,17 @@ 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 master",\ | ||
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to 3.9",\ | ||
"type": "commit",\ | ||
"tagger": {"name": "LinuxServer Jenkins","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' ''' | ||
echo "Pushing New release for Tag" | ||
sh '''#! /bin/bash | ||
echo "Updating base packages to ${PACKAGE_TAG}" > releasebody.json | ||
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ | ||
"target_commitish": "master",\ | ||
"target_commitish": "3.9",\ | ||
"name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ | ||
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**OS 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 | ||
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done''' | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters