upate build env to github stable ingestion

This commit is contained in:
thelamer 2020-02-08 14:33:47 -08:00
parent 9ca8f035bf
commit 6579ec4abc
7 changed files with 40 additions and 23 deletions

View File

@ -17,7 +17,7 @@ RUN \
wget && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
curl \
inotify-tools \
jq \
perl \
@ -32,13 +32,14 @@ RUN \
JSON::Any && \
echo "**** install ddclient ****" && \
if [ -z ${DDCLIENT_VERSION+x} ]; then \
DDCLIENT_VERSION=3.9.1; \
DDCLIENT_VERSION=$(curl -sX GET "https://api.github.com/repos/ddclient/ddclient/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
mkdir -p \
/tmp/ddclient && \
curl -o \
/tmp/ddclient.tar.gz -L \
"https://github.com/ddclient/ddclient/archive/v${DDCLIENT_VERSION}.tar.gz" && \
"https://github.com/ddclient/ddclient/archive/${DDCLIENT_VERSION}.tar.gz" && \
tar xf \
/tmp/ddclient.tar.gz -C \
/tmp/ddclient --strip-components=1 && \

View File

@ -17,7 +17,7 @@ RUN \
wget && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
curl \
inotify-tools \
jq \
perl \
@ -32,13 +32,14 @@ RUN \
JSON::Any && \
echo "**** install ddclient ****" && \
if [ -z ${DDCLIENT_VERSION+x} ]; then \
DDCLIENT_VERSION=3.9.1; \
DDCLIENT_VERSION=$(curl -sX GET "https://api.github.com/repos/ddclient/ddclient/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
mkdir -p \
/tmp/ddclient && \
curl -o \
/tmp/ddclient.tar.gz -L \
"https://github.com/ddclient/ddclient/archive/v${DDCLIENT_VERSION}.tar.gz" && \
"https://github.com/ddclient/ddclient/archive/${DDCLIENT_VERSION}.tar.gz" && \
tar xf \
/tmp/ddclient.tar.gz -C \
/tmp/ddclient --strip-components=1 && \

View File

@ -17,7 +17,7 @@ RUN \
wget && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
curl \
inotify-tools \
jq \
perl \
@ -32,13 +32,14 @@ RUN \
JSON::Any && \
echo "**** install ddclient ****" && \
if [ -z ${DDCLIENT_VERSION+x} ]; then \
DDCLIENT_VERSION=3.9.1; \
DDCLIENT_VERSION=$(curl -sX GET "https://api.github.com/repos/ddclient/ddclient/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
mkdir -p \
/tmp/ddclient && \
curl -o \
/tmp/ddclient.tar.gz -L \
"https://github.com/ddclient/ddclient/archive/v${DDCLIENT_VERSION}.tar.gz" && \
"https://github.com/ddclient/ddclient/archive/${DDCLIENT_VERSION}.tar.gz" && \
tar xf \
/tmp/ddclient.tar.gz -C \
/tmp/ddclient --strip-components=1 && \

34
Jenkinsfile vendored
View File

@ -16,6 +16,9 @@ pipeline {
GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab')
GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0')
GITLAB_NAMESPACE=credentials('gitlab-namespace-id')
EXT_GIT_BRANCH = 'master'
EXT_USER = 'ddclient'
EXT_REPO = 'ddclient'
BUILD_VERSION_ARG = 'DDCLIENT_VERSION'
LS_USER = 'linuxserver'
LS_REPO = 'docker-ddclient'
@ -98,16 +101,23 @@ pipeline {
/* ########################
External Release Tagging
######################## */
// If this is a custom command to determine version use that command
stage("Set tag custom bash"){
steps{
script{
env.EXT_RELEASE = sh(
script: ''' curl -sL 'http://sourceforge.net/projects/ddclient/best_release.json' | jq -r '.platform_releases.linux.filename' | awk -F '(ddclient-|.zip)' '{print $3}' ''',
returnStdout: true).trim()
env.RELEASE_LINK = 'custom_command'
}
}
// If this is a stable github release use the latest endpoint from github to determine the ext tag
stage("Set ENV github_stable"){
steps{
script{
env.EXT_RELEASE = sh(
script: '''curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''',
returnStdout: true).trim()
}
}
}
// 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
}
}
}
// Sanitize the release tag and strip illegal docker or github characters
stage("Sanitize tag"){
@ -671,11 +681,11 @@ pipeline {
"tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' '''
echo "Pushing New release for Tag"
sh '''#! /bin/bash
echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json
curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
"target_commitish": "master",\
"name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**Remote 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
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'''

View File

@ -201,6 +201,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
## Versions
* **08.02.20:** - Fix permissions.
* **06.02.19:** - Fix permissions.
* **19.12.19:** - Rebasing to alpine 3.11.
* **28.06.19:** - Rebasing to alpine 3.10.

View File

@ -2,12 +2,14 @@
# jenkins variables
project_name: docker-ddclient
external_type: na
custom_version_command: "curl -sL 'http://sourceforge.net/projects/ddclient/best_release.json' | jq -r '.platform_releases.linux.filename' | awk -F '(ddclient-|.zip)' '{print $3}'"
external_type: github_stable
release_type: stable
release_tag: latest
ls_branch: master
repo_vars:
- EXT_GIT_BRANCH = 'master'
- EXT_USER = 'ddclient'
- EXT_REPO = 'ddclient'
- BUILD_VERSION_ARG = 'DDCLIENT_VERSION'
- LS_USER = 'linuxserver'
- LS_REPO = 'docker-ddclient'

View File

@ -46,6 +46,7 @@ app_setup_block: |
# changelog
changelogs:
- { date: "08.02.20:", desc: "Fix permissions." }
- { date: "06.02.19:", desc: "Fix permissions." }
- { date: "19.12.19:", desc: "Rebasing to alpine 3.11." }
- { date: "28.06.19:", desc: "Rebasing to alpine 3.10." }