shifting to os type and hard coding overlay version to avoid tag collision

pull/17/head
thelamer 2019-03-15 23:49:36 -07:00
rodzic ab70b6bb7f
commit c7ea03d59a
5 zmienionych plików z 16 dodań i 43 usunięć

Wyświetl plik

@ -29,7 +29,7 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
LABEL MAINTAINER="sparkyballs,TheLamer" LABEL MAINTAINER="sparkyballs,TheLamer"
# set version for s6 overlay # set version for s6 overlay
ARG OVERLAY_VERSION ARG OVERLAY_VERSION="v1.22.0.0"
ARG OVERLAY_ARCH="amd64" ARG OVERLAY_ARCH="amd64"
# set environment variables # set environment variables
@ -87,10 +87,6 @@ RUN \
echo "**** generate locale ****" && \ echo "**** generate locale ****" && \
locale-gen en_US.UTF-8 && \ locale-gen en_US.UTF-8 && \
echo "**** add s6 overlay ****" && \ echo "**** add s6 overlay ****" && \
if [ -z ${OVERLAY_VERSION+x} ]; then \
OVERLAY_VERSION=$(curl -sX GET "https://api.github.com/repos/just-containers/s6-overlay/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \ curl -o \
/tmp/s6-overlay.tar.gz -L \ /tmp/s6-overlay.tar.gz -L \
"https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}.tar.gz" && \ "https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}.tar.gz" && \

Wyświetl plik

@ -31,7 +31,7 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
LABEL MAINTAINER="sparkyballs,TheLamer" LABEL MAINTAINER="sparkyballs,TheLamer"
# set version for s6 overlay # set version for s6 overlay
ARG OVERLAY_VERSION ARG OVERLAY_VERSION="v1.22.0.0"
ARG OVERLAY_ARCH="aarch64" ARG OVERLAY_ARCH="aarch64"
# set environment variables # set environment variables
@ -89,10 +89,6 @@ RUN \
echo "**** generate locale ****" && \ echo "**** generate locale ****" && \
locale-gen en_US.UTF-8 && \ locale-gen en_US.UTF-8 && \
echo "**** add s6 overlay ****" && \ echo "**** add s6 overlay ****" && \
if [ -z ${OVERLAY_VERSION+x} ]; then \
OVERLAY_VERSION=$(curl -sX GET "https://api.github.com/repos/just-containers/s6-overlay/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \ curl -o \
/tmp/s6-overlay.tar.gz -L \ /tmp/s6-overlay.tar.gz -L \
"https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}.tar.gz" && \ "https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}.tar.gz" && \

Wyświetl plik

@ -31,7 +31,7 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
LABEL MAINTAINER="sparkyballs,TheLamer" LABEL MAINTAINER="sparkyballs,TheLamer"
# set version for s6 overlay # set version for s6 overlay
ARG OVERLAY_VERSION ARG OVERLAY_VERSION="v1.22.0.0"
ARG OVERLAY_ARCH="arm" ARG OVERLAY_ARCH="arm"
# set environment variables # set environment variables
@ -89,10 +89,6 @@ RUN \
echo "**** generate locale ****" && \ echo "**** generate locale ****" && \
locale-gen en_US.UTF-8 && \ locale-gen en_US.UTF-8 && \
echo "**** add s6 overlay ****" && \ echo "**** add s6 overlay ****" && \
if [ -z ${OVERLAY_VERSION+x} ]; then \
OVERLAY_VERSION=$(curl -sX GET "https://api.github.com/repos/just-containers/s6-overlay/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \ curl -o \
/tmp/s6-overlay.tar.gz -L \ /tmp/s6-overlay.tar.gz -L \
"https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}.tar.gz" && \ "https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}.tar.gz" && \

34
Jenkinsfile vendored
Wyświetl plik

@ -10,10 +10,7 @@ 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' BUILD_VERSION_ARG = 'OS'
EXT_USER = 'just-containers'
EXT_REPO = 's6-overlay'
BUILD_VERSION_ARG = 'OVERLAY_VERSION'
LS_USER = 'linuxserver' LS_USER = 'linuxserver'
LS_REPO = 'docker-baseimage-ubuntu' LS_REPO = 'docker-baseimage-ubuntu'
CONTAINER_NAME = 'baseimage-ubuntu' CONTAINER_NAME = 'baseimage-ubuntu'
@ -94,23 +91,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 an os release set release type to none to indicate no external release
stage("Set ENV github_stable"){ stage("Set ENV os"){
steps{ steps{
script{ script{
env.EXT_RELEASE = sh( env.EXT_RELEASE = env.PACKAGE_TAG
script: '''curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''', env.RELEASE_LINK = 'none'
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 // Sanitize the release tag and strip illegal docker or github characters
stage("Sanitize tag"){ stage("Sanitize tag"){
@ -533,11 +521,11 @@ pipeline {
"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 "Updating base packages to ${PACKAGE_TAG}" > releasebody.json
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\ echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
"target_commitish": "xenial",\ "target_commitish": "xenial",\
"name": "'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\ "name": "'${EXT_RELEASE_CLEAN}'-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**OS Changes:**\\n\\n' > start
printf '","draft": false,"prerelease": true}' >> 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'''

Wyświetl plik

@ -2,15 +2,12 @@
# jenkins variables # jenkins variables
project_name: docker-baseimage-ubuntu project_name: docker-baseimage-ubuntu
external_type: github_stable external_type: os
release_type: prerelease release_type: prerelease
release_tag: xenial release_tag: xenial
ls_branch: xenial ls_branch: xenial
repo_vars: repo_vars:
- EXT_GIT_BRANCH = 'master' - BUILD_VERSION_ARG = 'OS'
- EXT_USER = 'just-containers'
- EXT_REPO = 's6-overlay'
- BUILD_VERSION_ARG = 'OVERLAY_VERSION'
- LS_USER = 'linuxserver' - LS_USER = 'linuxserver'
- LS_REPO = 'docker-baseimage-ubuntu' - LS_REPO = 'docker-baseimage-ubuntu'
- CONTAINER_NAME = 'baseimage-ubuntu' - CONTAINER_NAME = 'baseimage-ubuntu'