Skip to content

Commit 55f4ff4

Browse files
committed
create development builds
1 parent 9ad72eb commit 55f4ff4

File tree

5 files changed

+41
-45
lines changed

5 files changed

+41
-45
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN \
1818
echo "**** install duplicati ****" && \
1919
if [ -z ${DUPLICATI_RELEASE+x} ]; then \
2020
DUPLICATI_RELEASE=$(curl -sX GET "https://api.github.com/repos/duplicati/duplicati/releases" \
21-
| awk '/tag_name.*(beta|release)/{print $4;exit}' FS='[""]'); \
21+
| jq -r 'first(.[] | select(.tag_name | contains("canary"))) | .tag_name'); \
2222
fi && \
2323
mkdir -p \
2424
/app/duplicati && \

Dockerfile.aarch64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ RUN \
2121
echo "**** install duplicati ****" && \
2222
if [ -z ${DUPLICATI_RELEASE+x} ]; then \
2323
DUPLICATI_RELEASE=$(curl -sX GET "https://api.github.com/repos/duplicati/duplicati/releases" \
24-
| awk '/tag_name.*(beta|release)/{print $4;exit}' FS='[""]'); \
24+
| jq -r 'first(.[] | select(.tag_name | contains("canary"))) | .tag_name'); \
2525
fi && \
2626
mkdir -p \
2727
/app/duplicati && \

Dockerfile.armhf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ RUN \
2121
echo "**** install duplicati ****" && \
2222
if [ -z ${DUPLICATI_RELEASE+x} ]; then \
2323
DUPLICATI_RELEASE=$(curl -sX GET "https://api.github.com/repos/duplicati/duplicati/releases" \
24-
| awk '/tag_name.*(beta|release)/{print $4;exit}' FS='[""]'); \
24+
| jq -r 'first(.[] | select(.tag_name | contains("canary"))) | .tag_name'); \
2525
fi && \
2626
mkdir -p \
2727
/app/duplicati && \

Jenkinsfile

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pipeline {
1111
BUILDS_DISCORD=credentials('build_webhook_url')
1212
GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab')
1313
JSON_URL = 'https://api.github.com/repos/duplicati/duplicati/releases'
14-
JSON_PATH = 'first(.[] | select(.tag_name | contains("beta"))) | .tag_name'
14+
JSON_PATH = 'first(.[] | select(.tag_name | contains("canary"))) | .tag_name'
1515
BUILD_VERSION_ARG = 'DUPLICATI_RELEASE'
1616
LS_USER = 'linuxserver'
1717
LS_REPO = 'docker-duplicati'
@@ -37,7 +37,7 @@ pipeline {
3737
script{
3838
env.EXIT_STATUS = ''
3939
env.LS_RELEASE = sh(
40-
script: '''curl -s https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases/latest | jq -r '. | .tag_name' ''',
40+
script: '''curl -s https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases | jq -r 'first(.[] | select(.prerelease == true)) | .tag_name' ''',
4141
returnStdout: true).trim()
4242
env.LS_RELEASE_NOTES = sh(
4343
script: '''git log -1 --pretty=%B | sed -E ':a;N;$!ba;s/\\r{0,1}\\n/\\\\n/g' ''',
@@ -81,14 +81,10 @@ pipeline {
8181
script{
8282
env.PACKAGE_TAG = sh(
8383
script: '''#!/bin/bash
84-
http_code=$(curl --write-out %{http_code} -s -o /dev/null \
85-
https://raw.githubusercontent.com/${LS_USER}/${LS_REPO}/master/package_versions.txt)
86-
if [[ "${http_code}" -ne 200 ]] ; then
87-
echo none
84+
if [ -e package_versions.txt ] ; then
85+
cat package_versions.txt | md5sum | cut -c1-8
8886
else
89-
curl -s \
90-
https://raw.githubusercontent.com/${LS_USER}/${LS_REPO}/master/package_versions.txt \
91-
| md5sum | cut -c1-8
87+
echo none
9288
fi''',
9389
returnStdout: true).trim()
9490
}
@@ -118,10 +114,10 @@ pipeline {
118114
}
119115
}
120116
}
121-
// If this is a master build use live docker endpoints
117+
// If this is a development build use live docker endpoints
122118
stage("Set ENV live build"){
123119
when {
124-
branch "master"
120+
branch "development"
125121
environment name: 'CHANGE_ID', value: ''
126122
}
127123
steps {
@@ -139,7 +135,7 @@ pipeline {
139135
// If this is a dev build use dev docker endpoints
140136
stage("Set ENV dev build"){
141137
when {
142-
not {branch "master"}
138+
not {branch "development"}
143139
environment name: 'CHANGE_ID', value: ''
144140
}
145141
steps {
@@ -177,7 +173,7 @@ pipeline {
177173
// Use helper containers to render templated files
178174
stage('Update-Templates') {
179175
when {
180-
branch "master"
176+
branch "development"
181177
environment name: 'CHANGE_ID', value: ''
182178
expression {
183179
env.CONTAINER_NAME != null
@@ -188,13 +184,13 @@ pipeline {
188184
set -e
189185
TEMPDIR=$(mktemp -d)
190186
docker pull linuxserver/jenkins-builder:latest
191-
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/jenkins linuxserver/jenkins-builder:latest
187+
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=development -v ${TEMPDIR}:/ansible/jenkins linuxserver/jenkins-builder:latest
192188
docker pull linuxserver/doc-builder:latest
193-
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/readme linuxserver/doc-builder:latest
189+
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=development -v ${TEMPDIR}:/ansible/readme linuxserver/doc-builder:latest
194190
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
195191
mkdir -p ${TEMPDIR}/repo
196192
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
197-
git --git-dir ${TEMPDIR}/repo/${LS_REPO}/.git checkout -f master
193+
git --git-dir ${TEMPDIR}/repo/${LS_REPO}/.git checkout -f development
198194
cp ${TEMPDIR}/${CONTAINER_NAME}/README.md ${TEMPDIR}/repo/${LS_REPO}/
199195
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile ${TEMPDIR}/repo/${LS_REPO}/
200196
cd ${TEMPDIR}/repo/${LS_REPO}/
@@ -216,7 +212,7 @@ pipeline {
216212
// Exit the build if the Templated files were just updated
217213
stage('Template-exit') {
218214
when {
219-
branch "master"
215+
branch "development"
220216
environment name: 'CHANGE_ID', value: ''
221217
environment name: 'FILES_UPDATED', value: 'true'
222218
expression {
@@ -313,7 +309,7 @@ pipeline {
313309
// Take the image we just built and dump package versions for comparison
314310
stage('Update-packages') {
315311
when {
316-
branch "master"
312+
branch "development"
317313
environment name: 'CHANGE_ID', value: ''
318314
environment name: 'EXIT_STATUS', value: ''
319315
}
@@ -341,7 +337,7 @@ pipeline {
341337
echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github"
342338
if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then
343339
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/${LS_REPO}
344-
git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f master
340+
git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f development
345341
cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/
346342
cd ${TEMPDIR}/${LS_REPO}/
347343
wait
@@ -365,7 +361,7 @@ pipeline {
365361
// Exit the build if the package file was just updated
366362
stage('PACKAGE-exit') {
367363
when {
368-
branch "master"
364+
branch "development"
369365
environment name: 'CHANGE_ID', value: ''
370366
environment name: 'PACKAGE_UPDATED', value: 'true'
371367
environment name: 'EXIT_STATUS', value: ''
@@ -379,7 +375,7 @@ pipeline {
379375
// Exit the build if this is just a package check and there are no changes to push
380376
stage('PACKAGECHECK-exit') {
381377
when {
382-
branch "master"
378+
branch "development"
383379
environment name: 'CHANGE_ID', value: ''
384380
environment name: 'PACKAGE_UPDATED', value: 'false'
385381
environment name: 'EXIT_STATUS', value: ''
@@ -463,8 +459,8 @@ pipeline {
463459
sh '''#! /bin/bash
464460
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
465461
'''
466-
sh "docker tag ${IMAGE}:${META_TAG} ${IMAGE}:latest"
467-
sh "docker push ${IMAGE}:latest"
462+
sh "docker tag ${IMAGE}:${META_TAG} ${IMAGE}:development"
463+
sh "docker push ${IMAGE}:development"
468464
sh "docker push ${IMAGE}:${META_TAG}"
469465
}
470466
}
@@ -494,32 +490,32 @@ pipeline {
494490
docker tag lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v6-${META_TAG}
495491
docker tag lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG}
496492
fi'''
497-
sh "docker tag ${IMAGE}:amd64-${META_TAG} ${IMAGE}:amd64-latest"
498-
sh "docker tag ${IMAGE}:arm32v6-${META_TAG} ${IMAGE}:arm32v6-latest"
499-
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ${IMAGE}:arm64v8-latest"
493+
sh "docker tag ${IMAGE}:amd64-${META_TAG} ${IMAGE}:amd64-development"
494+
sh "docker tag ${IMAGE}:arm32v6-${META_TAG} ${IMAGE}:arm32v6-development"
495+
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ${IMAGE}:arm64v8-development"
500496
sh "docker push ${IMAGE}:amd64-${META_TAG}"
501497
sh "docker push ${IMAGE}:arm32v6-${META_TAG}"
502498
sh "docker push ${IMAGE}:arm64v8-${META_TAG}"
503-
sh "docker push ${IMAGE}:amd64-latest"
504-
sh "docker push ${IMAGE}:arm32v6-latest"
505-
sh "docker push ${IMAGE}:arm64v8-latest"
506-
sh "docker manifest push --purge ${IMAGE}:latest || :"
507-
sh "docker manifest create ${IMAGE}:latest ${IMAGE}:amd64-latest ${IMAGE}:arm32v6-latest ${IMAGE}:arm64v8-latest"
508-
sh "docker manifest annotate ${IMAGE}:latest ${IMAGE}:arm32v6-latest --os linux --arch arm"
509-
sh "docker manifest annotate ${IMAGE}:latest ${IMAGE}:arm64v8-latest --os linux --arch arm64 --variant v8"
499+
sh "docker push ${IMAGE}:amd64-development"
500+
sh "docker push ${IMAGE}:arm32v6-development"
501+
sh "docker push ${IMAGE}:arm64v8-development"
502+
sh "docker manifest push --purge ${IMAGE}:development || :"
503+
sh "docker manifest create ${IMAGE}:development ${IMAGE}:amd64-development ${IMAGE}:arm32v6-development ${IMAGE}:arm64v8-development"
504+
sh "docker manifest annotate ${IMAGE}:development ${IMAGE}:arm32v6-development --os linux --arch arm"
505+
sh "docker manifest annotate ${IMAGE}:development ${IMAGE}:arm64v8-development --os linux --arch arm64 --variant v8"
510506
sh "docker manifest push --purge ${IMAGE}:${META_TAG} || :"
511507
sh "docker manifest create ${IMAGE}:${META_TAG} ${IMAGE}:amd64-${META_TAG} ${IMAGE}:arm32v6-${META_TAG} ${IMAGE}:arm64v8-${META_TAG}"
512508
sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm32v6-${META_TAG} --os linux --arch arm"
513509
sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8"
514-
sh "docker manifest push --purge ${IMAGE}:latest"
510+
sh "docker manifest push --purge ${IMAGE}:development"
515511
sh "docker manifest push --purge ${IMAGE}:${META_TAG}"
516512
}
517513
}
518514
}
519515
// If this is a public release tag it in the LS Github
520516
stage('Github-Tag-Push-Release') {
521517
when {
522-
branch "master"
518+
branch "development"
523519
expression {
524520
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-ls' + env.LS_TAG_NUMBER
525521
}
@@ -531,17 +527,17 @@ pipeline {
531527
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \
532528
-d '{"tag":"'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
533529
"object": "'${COMMIT_SHA}'",\
534-
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}' to master",\
530+
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}' to development",\
535531
"type": "commit",\
536532
"tagger": {"name": "LinuxServer Jenkins","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' '''
537533
echo "Pushing New release for Tag"
538534
sh '''#! /bin/bash
539535
echo "Data change at JSON endpoint ${JSON_URL}" > releasebody.json
540536
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
541-
"target_commitish": "master",\
537+
"target_commitish": "development",\
542538
"name": "'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
543539
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**Remote Changes:**\\n\\n' > start
544-
printf '","draft": false,"prerelease": false}' >> releasebody.json
540+
printf '","draft": false,"prerelease": true}' >> releasebody.json
545541
paste -d'\\0' start releasebody.json > releasebody.json.done
546542
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done'''
547543
}

jenkins-vars.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
# jenkins variables
44
project_name: docker-duplicati
55
external_type: custom_json
6-
release_type: stable
7-
release_tag: latest
8-
ls_branch: master
6+
release_type: prerelease
7+
release_tag: development
8+
ls_branch: development
99
repo_vars:
1010
- JSON_URL = 'https://api.github.com/repos/duplicati/duplicati/releases'
11-
- JSON_PATH = 'first(.[] | select(.tag_name | contains("beta"))) | .tag_name'
11+
- JSON_PATH = 'first(.[] | select(.tag_name | contains("canary"))) | .tag_name'
1212
- BUILD_VERSION_ARG = 'DUPLICATI_RELEASE'
1313
- LS_USER = 'linuxserver'
1414
- LS_REPO = 'docker-duplicati'

0 commit comments

Comments
 (0)