Compare commits

..

8 Commits

Author SHA1 Message Date
LinuxServer-CI
cbc08b4cdc Bot Updating Package Versions 2018-12-04 11:29:42 +00:00
LinuxServer-CI
85de02aa29 Bot Updating Templated Files 2018-12-04 11:25:44 +00:00
LinuxServer-CI
9ba53ce10e Bot Updating Templated Files 2018-12-04 10:47:51 +00:00
j0nnymoe
71bada833c Merge pull request #25 from thelamer/development
adding build logic templating to repository on development
2018-12-04 10:46:49 +00:00
thelamer
8788a724b0 adding build logic templating to repository on development 2018-12-03 20:27:33 -08:00
aptalca
49a9390a5d match bazarr's dev version 2018-11-05 16:19:28 -05:00
aptalca
a64b9e838a pull the master branch of heimdall 2018-11-05 16:03:55 -05:00
aptalca
9659004f69 Update Jenkinsfile 2018-11-05 15:47:59 -05:00
9 changed files with 116 additions and 141 deletions

View File

@@ -12,9 +12,8 @@ ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2
RUN \ RUN \
echo "**** install runtime packages ****" && \ echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \ apk add --no-cache \
curl \ curl \
nginx \
php7-ctype \ php7-ctype \
php7-pdo_sqlite \ php7-pdo_sqlite \
php7-tokenizer \ php7-tokenizer \
@@ -24,8 +23,8 @@ RUN \
mkdir -p \ mkdir -p \
/var/www/localhost/heimdall && \ /var/www/localhost/heimdall && \
if [ -z ${HEIMDALL_RELEASE+x} ]; then \ if [ -z ${HEIMDALL_RELEASE+x} ]; then \
HEIMDALL_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/releases/latest" \ HEIMDALL_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/commits/master" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \ | awk '/sha/{print $4;exit}' FS='[""]'); \
fi && \ fi && \
curl -o \ curl -o \
/tmp/heimdall.tar.gz -L \ /tmp/heimdall.tar.gz -L \

View File

@@ -15,9 +15,8 @@ ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2
RUN \ RUN \
echo "**** install runtime packages ****" && \ echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \ apk add --no-cache \
curl \ curl \
nginx \
php7-ctype \ php7-ctype \
php7-pdo_sqlite \ php7-pdo_sqlite \
php7-tokenizer \ php7-tokenizer \
@@ -27,8 +26,8 @@ RUN \
mkdir -p \ mkdir -p \
/var/www/localhost/heimdall && \ /var/www/localhost/heimdall && \
if [ -z ${HEIMDALL_RELEASE+x} ]; then \ if [ -z ${HEIMDALL_RELEASE+x} ]; then \
HEIMDALL_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/releases/latest" \ HEIMDALL_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/commits/master" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \ | awk '/sha/{print $4;exit}' FS='[""]'); \
fi && \ fi && \
curl -o \ curl -o \
/tmp/heimdall.tar.gz -L \ /tmp/heimdall.tar.gz -L \

View File

@@ -15,9 +15,8 @@ ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2
RUN \ RUN \
echo "**** install runtime packages ****" && \ echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \ apk add --no-cache \
curl \ curl \
nginx \
php7-ctype \ php7-ctype \
php7-pdo_sqlite \ php7-pdo_sqlite \
php7-tokenizer \ php7-tokenizer \
@@ -27,8 +26,8 @@ RUN \
mkdir -p \ mkdir -p \
/var/www/localhost/heimdall && \ /var/www/localhost/heimdall && \
if [ -z ${HEIMDALL_RELEASE+x} ]; then \ if [ -z ${HEIMDALL_RELEASE+x} ]; then \
HEIMDALL_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/releases/latest" \ HEIMDALL_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/commits/master" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \ | awk '/sha/{print $4;exit}' FS='[""]'); \
fi && \ fi && \
curl -o \ curl -o \
/tmp/heimdall.tar.gz -L \ /tmp/heimdall.tar.gz -L \

153
Jenkinsfile vendored
View File

@@ -38,7 +38,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: '''curl -s https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases | jq -r 'first(.[] | select(.prerelease == true)) | .tag_name' ''',
returnStdout: true).trim() returnStdout: true).trim()
env.LS_RELEASE_NOTES = sh( env.LS_RELEASE_NOTES = sh(
script: '''git log -1 --pretty=%B | sed -E ':a;N;$!ba;s/\\r{0,1}\\n/\\\\n/g' ''', script: '''git log -1 --pretty=%B | sed -E ':a;N;$!ba;s/\\r{0,1}\\n/\\\\n/g' ''',
@@ -82,10 +82,14 @@ pipeline {
script{ script{
env.PACKAGE_TAG = sh( env.PACKAGE_TAG = sh(
script: '''#!/bin/bash script: '''#!/bin/bash
if [ -e package_versions.txt ] ; then http_code=$(curl --write-out %{http_code} -s -o /dev/null \
cat package_versions.txt | md5sum | cut -c1-8 https://raw.githubusercontent.com/${LS_USER}/${LS_REPO}/development/package_versions.txt)
else if [[ "${http_code}" -ne 200 ]] ; then
echo none echo none
else
curl -s \
https://raw.githubusercontent.com/${LS_USER}/${LS_REPO}/development/package_versions.txt \
| md5sum | cut -c1-8
fi''', fi''',
returnStdout: true).trim() returnStdout: true).trim()
} }
@@ -94,67 +98,57 @@ 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 github commit trigger determine the current commit at head
stage("Set ENV github_stable"){ stage("Set ENV github_commit"){
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 https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_GIT_BRANCH} | jq -r '. | .sha' | cut -c1-8 ''',
returnStdout: true).trim() returnStdout: true).trim()
} }
} }
} }
// If this is a stable or devel github release generate the link for the build message // If this is a github commit trigger Set the external release link
stage("Set ENV github_link"){ stage("Set ENV commit_link"){
steps{ steps{
script{ script{
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/commit/' + env.EXT_RELEASE
} }
} }
} }
// Sanitize the release tag and strip illegal docker or github characters // If this is a development build use live docker endpoints
stage("Sanitize tag"){
steps{
script{
env.EXT_RELEASE_CLEAN = sh(
script: '''echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g' ''',
returnStdout: true).trim()
}
}
}
// If this is a master 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 {
script{ script{
env.IMAGE = env.DOCKERHUB_IMAGE env.IMAGE = env.DOCKERHUB_IMAGE
if (env.MULTIARCH == 'true') { 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 + '-ls' + env.LS_TAG_NUMBER + '|arm32v6-' + env.EXT_RELEASE + '-ls' + env.LS_TAG_NUMBER + '|arm64v8-' + env.EXT_RELEASE + '-ls' + env.LS_TAG_NUMBER
} else { } else {
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER env.CI_TAGS = env.EXT_RELEASE + '-ls' + env.LS_TAG_NUMBER
} }
env.META_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER env.META_TAG = env.EXT_RELEASE + '-ls' + env.LS_TAG_NUMBER
} }
} }
} }
// 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 {
script{ script{
env.IMAGE = env.DEV_DOCKERHUB_IMAGE env.IMAGE = env.DEV_DOCKERHUB_IMAGE
if (env.MULTIARCH == 'true') { 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 + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm32v6-' + env.EXT_RELEASE + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm64v8-' + env.EXT_RELEASE + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
} else { } else {
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA env.CI_TAGS = env.EXT_RELEASE + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
} }
env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA env.META_TAG = env.EXT_RELEASE + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DEV_DOCKERHUB_IMAGE + '/tags/' env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DEV_DOCKERHUB_IMAGE + '/tags/'
} }
} }
@@ -168,11 +162,11 @@ pipeline {
script{ script{
env.IMAGE = env.PR_DOCKERHUB_IMAGE env.IMAGE = env.PR_DOCKERHUB_IMAGE
if (env.MULTIARCH == 'true') { 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 + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm32v6-' + env.EXT_RELEASE + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm64v8-' + env.EXT_RELEASE + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
} else { } else {
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST env.CI_TAGS = env.EXT_RELEASE + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
} }
env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST env.META_TAG = env.EXT_RELEASE + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/pull/' + env.PULL_REQUEST env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/pull/' + env.PULL_REQUEST
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.PR_DOCKERHUB_IMAGE + '/tags/' env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.PR_DOCKERHUB_IMAGE + '/tags/'
} }
@@ -181,7 +175,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
@@ -192,13 +186,13 @@ 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 }')" ] || [ "$(md5sum ${TEMPDIR}/${CONTAINER_NAME}/README.md | awk '{ print $1 }')" != "$(md5sum README.md | awk '{ print $1 }')" ]; then 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 }')" ]; 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}/
cd ${TEMPDIR}/repo/${LS_REPO}/ cd ${TEMPDIR}/repo/${LS_REPO}/
@@ -220,7 +214,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 {
@@ -317,7 +311,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: ''
} }
@@ -331,32 +325,25 @@ pipeline {
LOCAL_CONTAINER=${IMAGE}:${META_TAG} LOCAL_CONTAINER=${IMAGE}:${META_TAG}
fi fi
if [ "${DIST_IMAGE}" == "alpine" ]; then if [ "${DIST_IMAGE}" == "alpine" ]; then
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\ docker run --rm -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} sh -c '\
apk info > packages && \ apk info > packages && \
apk info -v > versions && \ apk info -v > versions && \
paste -d " " packages versions > /tmp/package_versions.txt && \ paste -d " " packages versions > /tmp/package_versions.txt'
chmod 777 /tmp/package_versions.txt'
elif [ "${DIST_IMAGE}" == "ubuntu" ]; then elif [ "${DIST_IMAGE}" == "ubuntu" ]; then
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\ docker run --rm -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} sh -c '\
apt list -qq --installed > /tmp/package_versions.txt && \ apt -qq list --installed | awk "{print \$1,\$2}" > /tmp/package_versions.txt'
chmod 777 /tmp/package_versions.txt'
fi fi
NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 ) if [ "$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )" != "${PACKAGE_TAG}" ]; then
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 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 git --git-dir ${TEMPDIR}/${LS_REPO}/.git add package_versions.txt
git add package_versions.txt git --git-dir ${TEMPDIR}/${LS_REPO}/.git commit -m 'Bot Updating Package Versions'
git commit -m 'Bot Updating Package Versions' git --git-dir ${TEMPDIR}/${LS_REPO}/.git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
echo "true" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER} echo "true" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}
echo "Package tag updated, stopping build process"
else else
echo "false" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER} echo "false" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}
echo "Package tag is same as previous continue with build process"
fi fi
rm -Rf ${TEMPDIR}''' rm -Rf ${TEMPDIR}'''
script{ script{
@@ -369,7 +356,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: ''
@@ -383,7 +370,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: ''
@@ -411,9 +398,6 @@ pipeline {
string(credentialsId: 'spaces-key', variable: 'DO_KEY'), string(credentialsId: 'spaces-key', variable: 'DO_KEY'),
string(credentialsId: 'spaces-secret', variable: 'DO_SECRET') string(credentialsId: 'spaces-secret', variable: 'DO_SECRET')
]) { ]) {
script{
env.CI_URL = 'https://lsio-ci.ams3.digitaloceanspaces.com/' + env.IMAGE + '/' + env.META_TAG + '/index.html'
}
sh '''#! /bin/bash sh '''#! /bin/bash
set -e set -e
docker pull lsiodev/ci:latest docker pull lsiodev/ci:latest
@@ -442,6 +426,9 @@ pipeline {
-e DO_BUCKET="lsio-ci" \ -e DO_BUCKET="lsio-ci" \
-t lsiodev/ci:latest \ -t lsiodev/ci:latest \
python /ci/ci.py''' python /ci/ci.py'''
script{
env.CI_URL = 'https://lsio-ci.ams3.digitaloceanspaces.com/' + env.IMAGE + '/' + env.META_TAG + '/index.html'
}
} }
} }
} }
@@ -467,8 +454,8 @@ 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}"
} }
} }
@@ -498,24 +485,24 @@ pipeline {
docker tag lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v6-${META_TAG} docker tag lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v6-${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}:arm32v6-${META_TAG} ${IMAGE}:arm32v6-latest" sh "docker tag ${IMAGE}:arm32v6-${META_TAG} ${IMAGE}:arm32v6-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}:arm32v6-${META_TAG}" sh "docker push ${IMAGE}:arm32v6-${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}:arm32v6-latest" sh "docker push ${IMAGE}:arm32v6-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}:arm32v6-latest ${IMAGE}:arm64v8-latest" sh "docker manifest create ${IMAGE}:development ${IMAGE}:amd64-development ${IMAGE}:arm32v6-development ${IMAGE}:arm64v8-development"
sh "docker manifest annotate ${IMAGE}:latest ${IMAGE}:arm32v6-latest --os linux --arch arm" sh "docker manifest annotate ${IMAGE}:development ${IMAGE}:arm32v6-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}:${EXT_RELEASE}-ls${LS_TAG_NUMBER} || :"
sh "docker manifest create ${IMAGE}:${META_TAG} ${IMAGE}:amd64-${META_TAG} ${IMAGE}:arm32v6-${META_TAG} ${IMAGE}:arm64v8-${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 annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm32v6-${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}"
} }
} }
@@ -523,29 +510,29 @@ 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 + '-pkg-' + env.PACKAGE_TAG + '-ls' + env.LS_TAG_NUMBER env.LS_RELEASE != env.EXT_RELEASE + '-pkg-' + env.PACKAGE_TAG + '-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}-pkg-${PACKAGE_TAG}-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}'-pkg-'${PACKAGE_TAG}'-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}'-pkg-'${PACKAGE_TAG}'-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 curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_GIT_BRANCH} | jq '. | .commit.message' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\ echo '{"tag_name":"'${EXT_RELEASE}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
"target_commitish": "master",\ "target_commitish": "development",\
"name": "'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\ "name": "'${EXT_RELEASE}'-pkg-'${PACKAGE_TAG}'-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**'${EXT_REPO}' 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'''
} }

View File

@@ -64,11 +64,6 @@ docker create \
linuxserver/heimdall linuxserver/heimdall
``` ```
Using tags, you can switch between the stable releases of Heimdall and the master branch. No tag is required for the latest stable release.
Add the `development` tag, if required, to the `linuxserver/heimdall` line of the run/create command in the following format, `linuxserver/heimdall:development`.
The `development` tag will be the latest commit in the master branch of Heimdall.
HOWEVER, USE THE DEVELOPMENT TAG AT YOUR OWN PERIL !!!!!!!!!
### docker-compose ### docker-compose
@@ -143,7 +138,6 @@ This image now supports password protection through htpasswd. Run the following
## Versions ## Versions
* **16.01.18:** - Generate random app key in .env for new installs.
* **20.11.18:** - Upgrade baseimage packages during build. * **20.11.18:** - Upgrade baseimage packages during build.
* **04.11.18:** - Add php7-zip. * **04.11.18:** - Add php7-zip.
* **31.10.18:** - Add queue service. * **31.10.18:** - Add queue service.

View File

@@ -2,10 +2,10 @@
# jenkins variables # jenkins variables
project_name: docker-heimdall project_name: docker-heimdall
external_type: github_stable external_type: github_commit
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' - EXT_GIT_BRANCH = 'master'
- EXT_USER = 'linuxserver' - EXT_USER = 'linuxserver'

View File

@@ -1,11 +1,11 @@
musl musl-1.1.19-r10 musl musl-1.1.19-r10
busybox busybox-1.28.4-r3 busybox busybox-1.28.4-r1
alpine-baselayout alpine-baselayout-3.1.0-r0 alpine-baselayout alpine-baselayout-3.1.0-r0
alpine-keys alpine-keys-2.1-r1 alpine-keys alpine-keys-2.1-r1
libressl2.7-libcrypto libressl2.7-libcrypto-2.7.4-r0 libressl2.7-libcrypto libressl2.7-libcrypto-2.7.4-r0
libressl2.7-libssl libressl2.7-libssl-2.7.4-r0 libressl2.7-libssl libressl2.7-libssl-2.7.4-r0
libressl2.7-libtls libressl2.7-libtls-2.7.4-r0 libressl2.7-libtls libressl2.7-libtls-2.7.4-r0
ssl_client ssl_client-1.28.4-r3 ssl_client ssl_client-1.28.4-r1
zlib zlib-1.2.11-r1 zlib zlib-1.2.11-r1
apk-tools apk-tools-2.10.1-r0 apk-tools apk-tools-2.10.1-r0
scanelf scanelf-1.2.3-r0 scanelf scanelf-1.2.3-r0
@@ -28,8 +28,8 @@ tzdata tzdata-2018f-r0
libuuid libuuid-2.32-r0 libuuid libuuid-2.32-r0
apr apr-1.6.3-r1 apr apr-1.6.3-r1
expat expat-2.2.5-r0 expat expat-2.2.5-r0
apr-util apr-util-1.6.1-r3 apr-util apr-util-1.6.1-r2
apache2-utils apache2-utils-2.4.38-r1 apache2-utils apache2-utils-2.4.35-r0
nghttp2-libs nghttp2-libs-1.32.0-r0 nghttp2-libs nghttp2-libs-1.32.0-r0
libssh2 libssh2-1.8.0-r3 libssh2 libssh2-1.8.0-r3
libcurl libcurl-7.61.1-r1 libcurl libcurl-7.61.1-r1
@@ -40,29 +40,29 @@ logrotate logrotate-3.14.0-r0
libmagic libmagic-5.32-r0 libmagic libmagic-5.32-r0
nano nano-2.9.8-r0 nano nano-2.9.8-r0
pcre pcre-8.42-r0 pcre pcre-8.42-r0
nginx nginx-1.14.2-r0 nginx nginx-1.14.1-r0
libcrypto1.0 libcrypto1.0-1.0.2q-r0 libcrypto1.0 libcrypto1.0-1.0.2q-r0
libssl1.0 libssl1.0-1.0.2q-r0 libssl1.0 libssl1.0-1.0.2q-r0
openssl openssl-1.0.2q-r0 openssl openssl-1.0.2q-r0
php7-common php7-common-7.2.13-r0 php7-common php7-common-7.2.10-r0
libedit libedit-20170329.3.1-r3 libedit libedit-20170329.3.1-r3
libxml2 libxml2-2.9.8-r1 libxml2 libxml2-2.9.8-r1
php7 php7-7.2.13-r0 php7 php7-7.2.10-r0
php7-fileinfo php7-fileinfo-7.2.13-r0 php7-fileinfo php7-fileinfo-7.2.10-r0
php7-fpm php7-fpm-7.2.13-r0 php7-fpm php7-fpm-7.2.10-r0
php7-json php7-json-7.2.13-r0 php7-json php7-json-7.2.10-r0
php7-mbstring php7-mbstring-7.2.13-r0 php7-mbstring php7-mbstring-7.2.10-r0
php7-openssl php7-openssl-7.2.13-r0 php7-openssl php7-openssl-7.2.10-r0
php7-session php7-session-7.2.13-r0 php7-session php7-session-7.2.10-r0
php7-simplexml php7-simplexml-7.2.13-r0 php7-simplexml php7-simplexml-7.2.10-r0
php7-xml php7-xml-7.2.13-r0 php7-xml php7-xml-7.2.10-r0
php7-xmlwriter php7-xmlwriter-7.2.13-r0 php7-xmlwriter php7-xmlwriter-7.2.10-r0
curl curl-7.61.1-r1 curl curl-7.61.1-r1
php7-ctype php7-ctype-7.2.13-r0 php7-ctype php7-ctype-7.2.10-r0
php7-pdo php7-pdo-7.2.13-r0 php7-pdo php7-pdo-7.2.10-r0
sqlite-libs sqlite-libs-3.25.3-r0 sqlite-libs sqlite-libs-3.24.0-r0
php7-pdo_sqlite php7-pdo_sqlite-7.2.13-r0 php7-pdo_sqlite php7-pdo_sqlite-7.2.10-r0
php7-tokenizer php7-tokenizer-7.2.13-r0 php7-tokenizer php7-tokenizer-7.2.10-r0
libzip libzip-1.5.1-r1 libzip libzip-1.5.1-r1
php7-zip php7-zip-7.2.13-r0 php7-zip php7-zip-7.2.10-r0
tar tar-1.31-r0 tar tar-1.30-r0

View File

@@ -35,10 +35,10 @@ param_env_vars:
optional_block_1: true optional_block_1: true
optional_block_1_items: optional_block_1_items:
- | - |
Using tags, you can switch between the stable releases of Heimdall and the master branch. No tag is required for the latest stable release. Using tags, you can switch between the stable releases of Heimdall and the master branch. No tag is required for the latest stable release.
Add the `development` tag, if required, to the `linuxserver/heimdall` line of the run/create command in the following format, `linuxserver/heimdall:development`. Add the development tag, if required, to the linuxserver/heimdall line of the run/create command in the following format, linuxserver/heimdall:development
The `development` tag will be the latest commit in the master branch of Heimdall. The development tag will be the latest commit in the master branch of Heimdall.
HOWEVER, USE THE DEVELOPMENT TAG AT YOUR OWN PERIL !!!!!!!!! HOWEVER , USE THE DEVELOPMENT TAG AT YOUR OWN PERIL !!!!!!!!!
# application setup block # application setup block
app_setup_block_enabled: true app_setup_block_enabled: true
@@ -52,8 +52,6 @@ app_setup_block: |
# changelog # changelog
changelogs: changelogs:
- { date: "16.01.18:", desc: "Generate random app key in .env for new installs." }
- { date: "20.11.18:", desc: "Upgrade baseimage packages during build." }
- { date: "04.11.18:", desc: "Add php7-zip." } - { date: "04.11.18:", desc: "Add php7-zip." }
- { date: "31.10.18:", desc: "Add queue service." } - { date: "31.10.18:", desc: "Add queue service." }
- { date: "17.10.18:", desc: "Symlink avatars folder." } - { date: "17.10.18:", desc: "Symlink avatars folder." }

View File

@@ -4,6 +4,12 @@
mkdir -p \ mkdir -p \
/config/www/{backgrounds,icons,avatars,SupportedApps} /config/www/{backgrounds,icons,avatars,SupportedApps}
# copy .env if not exists
[[ ! -f /config/www/.env ]] && \
cp /var/www/localhost/heimdall/.env /config/www/.env
# set queue driver to database
sed -i 's/QUEUE_DRIVER=sync/QUEUE_DRIVER=database/' /config/www/.env
# create symlinks # create symlinks
symlinks=( \ symlinks=( \
@@ -20,13 +26,6 @@ do
[[ ! -L "$i" ]] && ln -s /config/www/"$(basename "$i")" "$i" [[ ! -L "$i" ]] && ln -s /config/www/"$(basename "$i")" "$i"
done done
# copy .env if not exists
[[ ! -f /config/www/.env ]] && \
cp /var/www/localhost/heimdall/.env.example /config/www/.env && \
php /var/www/localhost/heimdall/artisan key:generate
# set queue driver to database
sed -i 's/QUEUE_DRIVER=sync/QUEUE_DRIVER=database/' /config/www/.env
# permissions # permissions
chown -R abc:abc \ chown -R abc:abc \
/config \ /config \