Skip to content

Commit

Permalink
Merge pull request #57 from linuxserver/development-prerelease
Browse files Browse the repository at this point in the history
build pre-releases instead of commits
  • Loading branch information
Roxedus authored Mar 14, 2021
2 parents 4746e5e + 814c80d commit b656911
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/external_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fi
echo "**** External trigger running off of development branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_BAZARR_DEVELOPMENT\". ****"
echo "**** Retrieving external version ****"
EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/morpheus65535/bazarr/commits/development" | jq -r '. | .sha' | cut -c1-8)
EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/morpheus65535/bazarr/releases" | jq -r '.[0] | .tag_name')
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
echo "**** Can't retrieve external version, exiting ****"
FAILURE_REASON="Can't retrieve external version for bazarr branch development"
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN \
apk add --no-cache --virtual=build-dependencies \
g++ \
gcc \
jq \
libxml2-dev \
libxslt-dev \
py3-pip \
Expand All @@ -29,8 +30,8 @@ RUN \
unzip && \
echo "**** install bazarr ****" && \
if [ -z ${BAZARR_VERSION+x} ]; then \
BAZARR_VERSION=$(curl -sX GET https://api.github.com/repos/morpheus65535/bazarr/commits/development \
| awk '/sha/{print $4;exit}' FS='[""]'); \
BAZARR_VERSION=$(curl -sX GET https://api.github.com/repos/morpheus65535/bazarr/releases \
| jq -r '.[0] | .tag_name'); \
fi && \
curl -o \
/tmp/bazarr.tar.gz -L \
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN \
apk add --no-cache --virtual=build-dependencies \
g++ \
gcc \
jq \
libxml2-dev \
libxslt-dev \
py3-pip \
Expand All @@ -29,8 +30,8 @@ RUN \
unzip && \
echo "**** install bazarr ****" && \
if [ -z ${BAZARR_VERSION+x} ]; then \
BAZARR_VERSION=$(curl -sX GET https://api.github.com/repos/morpheus65535/bazarr/commits/development \
| awk '/sha/{print $4;exit}' FS='[""]'); \
BAZARR_VERSION=$(curl -sX GET https://api.github.com/repos/morpheus65535/bazarr/releases \
| jq -r '.[0] | .tag_name'); \
fi && \
curl -o \
/tmp/bazarr.tar.gz -L \
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN \
apk add --no-cache --virtual=build-dependencies \
g++ \
gcc \
jq \
libxml2-dev \
libxslt-dev \
py3-pip \
Expand All @@ -29,8 +30,8 @@ RUN \
unzip && \
echo "**** install bazarr ****" && \
if [ -z ${BAZARR_VERSION+x} ]; then \
BAZARR_VERSION=$(curl -sX GET https://api.github.com/repos/morpheus65535/bazarr/commits/development \
| awk '/sha/{print $4;exit}' FS='[""]'); \
BAZARR_VERSION=$(curl -sX GET https://api.github.com/repos/morpheus65535/bazarr/releases \
| jq -r '.[0] | .tag_name'); \
fi && \
curl -o \
/tmp/bazarr.tar.gz -L \
Expand Down
36 changes: 17 additions & 19 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ pipeline {
DEV_DOCKERHUB_IMAGE = 'lsiodev/bazarr'
PR_DOCKERHUB_IMAGE = 'lspipepr/bazarr'
DIST_IMAGE = 'alpine'
DIST_TAG = '3.8'
DIST_PACKAGES = 'none'
MULTIARCH='true'
CI='true'
CI_WEB='true'
Expand Down Expand Up @@ -103,23 +101,23 @@ pipeline {
/* ########################
External Release Tagging
######################## */
// If this is a github commit trigger determine the current commit at head
stage("Set ENV github_commit"){
steps{
script{
env.EXT_RELEASE = sh(
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()
}
}
// If this is a devel github release use the first in an array from github to determine the ext tag
stage("Set ENV github_devel"){
steps{
script{
env.EXT_RELEASE = sh(
script: '''curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases | jq -r '.[0] | .tag_name' ''',
returnStdout: true).trim()
}
}
}
// If this is a github commit trigger Set the external release link
stage("Set ENV commit_link"){
steps{
script{
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/commit/' + env.EXT_RELEASE
}
}
// 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"){
Expand Down Expand Up @@ -748,7 +746,7 @@ pipeline {
"tagger": {"name": "LinuxServer Jenkins","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' '''
echo "Pushing New release for Tag"
sh '''#! /bin/bash
curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_GIT_BRANCH} | jq '. | .commit.message' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases | jq '.[0] |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
echo '{"tag_name":"'${META_TAG}'",\
"target_commitish": "development",\
"name": "'${META_TAG}'",\
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **13.03.21:** - Build from Github pre-releases.
* **23.01.21:** - Rebasing to alpine 3.13.
* **23.01.21:** - Deprecate `UMASK_SET` in favor of UMASK in baseimage, see above for more information.
* **19.12.19:** - Rebasing to alpine 3.12.
Expand Down
4 changes: 1 addition & 3 deletions jenkins-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# jenkins variables
project_name: docker-bazarr
external_type: github_commit
external_type: github_devel
release_type: prerelease
release_tag: development
ls_branch: development
Expand All @@ -18,8 +18,6 @@ repo_vars:
- DEV_DOCKERHUB_IMAGE = 'lsiodev/bazarr'
- PR_DOCKERHUB_IMAGE = 'lspipepr/bazarr'
- DIST_IMAGE = 'alpine'
- DIST_TAG = '3.8'
- DIST_PACKAGES = 'none'
- MULTIARCH='true'
- CI='true'
- CI_WEB='true'
Expand Down
1 change: 1 addition & 0 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ app_setup_block: |
# changelog
changelogs:
- { date: "13.03.21:", desc: "Build from Github pre-releases." }
- { date: "23.01.21:", desc: "Rebasing to alpine 3.13." }
- { date: "23.01.21:", desc: "Deprecate `UMASK_SET` in favor of UMASK in baseimage, see above for more information." }
- { date: "19.12.19:", desc: "Rebasing to alpine 3.12." }
Expand Down

0 comments on commit b656911

Please sign in to comment.