Skip to content

Commit 52dac49

Browse files
committed
Update release check type
1 parent acb875e commit 52dac49

3 files changed

Lines changed: 11 additions & 25 deletions

File tree

.github/workflows/external_trigger.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ jobs:
2929
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
3030
echo "> External trigger running off of master branch. To disable this trigger, add \`deluge_master\` into the Github organizational variable \`SKIP_EXTERNAL_TRIGGER\`." >> $GITHUB_STEP_SUMMARY
3131
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY
32-
EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
33-
&& awk '/^P:'"deluge"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://')
34-
echo "Type is \`alpine_repo\`" >> $GITHUB_STEP_SUMMARY
32+
EXT_RELEASE=$(curl -sL "https://pypi.python.org/pypi/deluge/json" |jq -r '. | .info.version')
33+
echo "Type is \`pip_version\`" >> $GITHUB_STEP_SUMMARY
3534
if grep -q "^deluge_master_${EXT_RELEASE}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
3635
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
3736
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` matches current external release; skipping trigger." >> $GITHUB_STEP_SUMMARY
@@ -107,13 +106,6 @@ jobs:
107106
if [ "${EXT_RELEASE_SANITIZED}" == "${IMAGE_VERSION}" ]; then
108107
echo "Sanitized version \`${EXT_RELEASE_SANITIZED}\` already pushed, exiting" >> $GITHUB_STEP_SUMMARY
109108
exit 0
110-
elif [[ $(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/aarch64/APKINDEX.tar.gz" | tar -xz -C /tmp && awk '/^P:'"deluge"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://') != "${EXT_RELEASE}" ]]; then
111-
echo "New version \`${EXT_RELEASE}\` found; but not all arch repos updated yet; exiting" >> $GITHUB_STEP_SUMMARY
112-
FAILURE_REASON="New version ${EXT_RELEASE} for deluge tag latest is detected, however not all arch repos are updated yet. Will try again later."
113-
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
114-
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
115-
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
116-
exit 0
117109
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-deluge/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
118110
echo "New version \`${EXT_RELEASE}\` found; but there already seems to be an active build on Jenkins; exiting" >> $GITHUB_STEP_SUMMARY
119111
exit 0

Jenkinsfile

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@ pipeline {
2020
QUAYIO_API_TOKEN=credentials('quayio-repo-api-token')
2121
GIT_SIGNING_KEY=credentials('484fbca6-9a4f-455e-b9e3-97ac98785f5f')
2222
BUILD_VERSION_ARG = 'DELUGE_VERSION'
23+
EXT_PIP='deluge'
2324
LS_USER = 'linuxserver'
2425
LS_REPO = 'docker-deluge'
2526
CONTAINER_NAME = 'deluge'
2627
DOCKERHUB_IMAGE = 'linuxserver/deluge'
2728
DEV_DOCKERHUB_IMAGE = 'lsiodev/deluge'
2829
PR_DOCKERHUB_IMAGE = 'lspipepr/deluge'
2930
DIST_IMAGE = 'alpine'
30-
DIST_TAG = 'edge'
31-
DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/edge/community/'
32-
DIST_REPO_PACKAGES = 'deluge'
3331
MULTIARCH='true'
3432
CI='true'
3533
CI_WEB='true'
@@ -145,19 +143,17 @@ pipeline {
145143
/* ########################
146144
External Release Tagging
147145
######################## */
148-
// If this is an alpine repo change for external version determine an md5 from the version string
149-
stage("Set tag Alpine Repo"){
146+
// If this is a pip release set the external tag to the pip version
147+
stage("Set ENV pip_version"){
150148
steps{
151149
script{
152150
env.EXT_RELEASE = sh(
153-
script: '''curl -sL "${DIST_REPO}x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
154-
&& awk '/^P:'"${DIST_REPO_PACKAGES}"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://' ''',
151+
script: '''curl -sL https://pypi.python.org/pypi/${EXT_PIP}/json |jq -r '. | .info.version' ''',
155152
returnStdout: true).trim()
156-
env.RELEASE_LINK = 'alpine_repo'
153+
env.RELEASE_LINK = 'https://pypi.python.org/pypi/' + env.EXT_PIP
157154
}
158155
}
159-
}
160-
// Sanitize the release tag and strip illegal docker or github characters
156+
} // Sanitize the release tag and strip illegal docker or github characters
161157
stage("Sanitize tag"){
162158
steps{
163159
script{
@@ -1024,7 +1020,7 @@ pipeline {
10241020
"type": "commit",\
10251021
"tagger": {"name": "LinuxServer-CI","email": "[email protected]","date": "'${GITHUB_DATE}'"}}'
10261022
echo "Pushing New release for Tag"
1027-
echo "Updating external repo packages to ${EXT_RELEASE_CLEAN}" > releasebody.json
1023+
echo "Updating PIP version of ${EXT_PIP} to ${EXT_RELEASE_CLEAN}" > releasebody.json
10281024
jq -n \
10291025
--arg tag_name "$META_TAG" \
10301026
--arg target_commitish "master" \

jenkins-vars.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22

33
# jenkins variables
44
project_name: docker-deluge
5-
external_type: alpine_repo
5+
external_type: pip_version
66
release_type: stable
77
release_tag: latest
88
ls_branch: master
99
repo_vars:
1010
- BUILD_VERSION_ARG = 'DELUGE_VERSION'
11+
- EXT_PIP='deluge'
1112
- LS_USER = 'linuxserver'
1213
- LS_REPO = 'docker-deluge'
1314
- CONTAINER_NAME = 'deluge'
1415
- DOCKERHUB_IMAGE = 'linuxserver/deluge'
1516
- DEV_DOCKERHUB_IMAGE = 'lsiodev/deluge'
1617
- PR_DOCKERHUB_IMAGE = 'lspipepr/deluge'
1718
- DIST_IMAGE = 'alpine'
18-
- DIST_TAG = 'edge'
19-
- DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/edge/community/'
20-
- DIST_REPO_PACKAGES = 'deluge'
2119
- MULTIARCH='true'
2220
- CI='true'
2321
- CI_WEB='true'

0 commit comments

Comments
 (0)