Skip to content

Commit 8912331

Browse files
committed
change trigger and base
1 parent 7d6adf3 commit 8912331

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

.github/workflows/external_trigger.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ jobs:
1818
fi
1919
echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_SQLITEBROWSER_MASTER\". ****"
2020
echo "**** Retrieving external version ****"
21-
EXT_RELEASE=$(curl -sX GET http://ppa.launchpad.net/linuxgndu/sqlitebrowser/ubuntu/dists/bionic/main/binary-amd64/Packages.gz | gunzip -c |grep -A 7 -m 1 'Package: sqlitebrowser' | awk -F ': ' '/Version/{print $2;exit}')
21+
EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
22+
&& awk '/^P:'"sqlitebrowser"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://')
2223
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
2324
echo "**** Can't retrieve external version, exiting ****"
2425
FAILURE_REASON="Can't retrieve external version for sqlitebrowser branch master"

Jenkinsfile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ pipeline {
2424
DOCKERHUB_IMAGE = 'linuxserver/sqlitebrowser'
2525
DEV_DOCKERHUB_IMAGE = 'lsiodev/sqlitebrowser'
2626
PR_DOCKERHUB_IMAGE = 'lspipepr/sqlitebrowser'
27-
DIST_IMAGE = 'ubuntu'
27+
DIST_IMAGE = 'alpine'
28+
DIST_TAG = '3.15'
29+
DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.15/community/'
30+
DIST_REPO_PACKAGES = 'sqlitebrowser'
2831
MULTIARCH='true'
2932
CI='true'
3033
CI_WEB='true'
@@ -99,14 +102,15 @@ pipeline {
99102
/* ########################
100103
External Release Tagging
101104
######################## */
102-
// If this is a custom command to determine version use that command
103-
stage("Set tag custom bash"){
105+
// If this is an alpine repo change for external version determine an md5 from the version string
106+
stage("Set tag Alpine Repo"){
104107
steps{
105108
script{
106109
env.EXT_RELEASE = sh(
107-
script: ''' curl -sX GET http://ppa.launchpad.net/linuxgndu/sqlitebrowser/ubuntu/dists/bionic/main/binary-amd64/Packages.gz | gunzip -c |grep -A 7 -m 1 'Package: sqlitebrowser' | awk -F ': ' '/Version/{print $2;exit}' ''',
110+
script: '''curl -sL "${DIST_REPO}x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
111+
&& awk '/^P:'"${DIST_REPO_PACKAGES}"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://' ''',
108112
returnStdout: true).trim()
109-
env.RELEASE_LINK = 'custom_command'
113+
env.RELEASE_LINK = 'alpine_repo'
110114
}
111115
}
112116
}
@@ -909,11 +913,11 @@ pipeline {
909913
"tagger": {"name": "LinuxServer Jenkins","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' '''
910914
echo "Pushing New release for Tag"
911915
sh '''#! /bin/bash
912-
echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json
916+
echo "Updating external repo packages to ${EXT_RELEASE_CLEAN}" > releasebody.json
913917
echo '{"tag_name":"'${META_TAG}'",\
914918
"target_commitish": "master",\
915919
"name": "'${META_TAG}'",\
916-
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n\\n**Remote Changes:**\\n\\n' > start
920+
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n\\n**Repo Changes:**\\n\\n' > start
917921
printf '","draft": false,"prerelease": false}' >> releasebody.json
918922
paste -d'\\0' start releasebody.json > releasebody.json.done
919923
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done'''

jenkins-vars.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
# jenkins variables
44
project_name: docker-sqlitebrowser
5-
external_type: na
6-
custom_version_command: "curl -sX GET http://ppa.launchpad.net/linuxgndu/sqlitebrowser/ubuntu/dists/bionic/main/binary-amd64/Packages.gz | gunzip -c |grep -A 7 -m 1 'Package: sqlitebrowser' | awk -F ': ' '/Version/{print $2;exit}'"
5+
external_type: alpine_repo
76
release_type: stable
87
release_tag: latest
98
ls_branch: master
@@ -15,7 +14,10 @@ repo_vars:
1514
- DOCKERHUB_IMAGE = 'linuxserver/sqlitebrowser'
1615
- DEV_DOCKERHUB_IMAGE = 'lsiodev/sqlitebrowser'
1716
- PR_DOCKERHUB_IMAGE = 'lspipepr/sqlitebrowser'
18-
- DIST_IMAGE = 'ubuntu'
17+
- DIST_IMAGE = 'alpine'
18+
- DIST_TAG = '3.15'
19+
- DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.15/community/'
20+
- DIST_REPO_PACKAGES = 'sqlitebrowser'
1921
- MULTIARCH='true'
2022
- CI='true'
2123
- CI_WEB='true'

0 commit comments

Comments
 (0)