Skip to content

Commit 60a4058

Browse files
authored
Merge pull request #5 from linuxserver/alpine320-ext
update external trigger
2 parents 0802b75 + 721e4a7 commit 60a4058

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

.github/workflows/external_trigger.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
2424
echo "> External trigger running off of alpine320 branch. To disable this trigger, add \`python_alpine320\` into the Github organizational variable \`SKIP_EXTERNAL_TRIGGER\`." >> $GITHUB_STEP_SUMMARY
2525
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY
26-
EXT_RELEASE=$(curl -s "https://endoflife.date/api/python.json" | jq -r '. | .[0].latest')
27-
echo "Type is \`custom_json\`" >> $GITHUB_STEP_SUMMARY
26+
EXT_RELEASE=$(curl -u ${{ secrets.CR_USER }}:${{ secrets.CR_PAT }} -sX GET https://api.github.com/repos/python/cpython/tags | jq -r '.[] | select(.name | contains("rc") or contains("a") or contains("b") | not) | .name' | sed 's|^v||g' | sort -rV | head -1)
27+
echo "Type is \`custom_version_command\`" >> $GITHUB_STEP_SUMMARY
2828
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
2929
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
3030
echo "> Can't retrieve external version, exiting" >> $GITHUB_STEP_SUMMARY

Jenkinsfile

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ pipeline {
1919
DOCKERHUB_TOKEN=credentials('docker-hub-ci-pat')
2020
QUAYIO_API_TOKEN=credentials('quayio-repo-api-token')
2121
GIT_SIGNING_KEY=credentials('484fbca6-9a4f-455e-b9e3-97ac98785f5f')
22-
JSON_URL = 'https://endoflife.date/api/python.json'
23-
JSON_PATH = '.[0].latest'
2422
BUILD_VERSION_ARG = 'PYTHON_VERSION'
2523
LS_USER = 'linuxserver'
2624
LS_REPO = 'docker-python'
@@ -128,16 +126,16 @@ pipeline {
128126
/* ########################
129127
External Release Tagging
130128
######################## */
131-
// If this is a custom json endpoint parse the return to get external tag
132-
stage("Set ENV custom_json"){
133-
steps{
134-
script{
135-
env.EXT_RELEASE = sh(
136-
script: '''curl -s ${JSON_URL} | jq -r ". | ${JSON_PATH}" ''',
137-
returnStdout: true).trim()
138-
env.RELEASE_LINK = env.JSON_URL
139-
}
140-
}
129+
// If this is a custom command to determine version use that command
130+
stage("Set tag custom bash"){
131+
steps{
132+
script{
133+
env.EXT_RELEASE = sh(
134+
script: ''' curl -sX GET https://api.github.com/repos/python/cpython/tags | jq -r '.[] | select(.name | contains("rc") or contains("a") or contains("b") | not) | .name' | sed 's|^v||g' | sort -rV | head -1 ''',
135+
returnStdout: true).trim()
136+
env.RELEASE_LINK = 'custom_command'
137+
}
138+
}
141139
}
142140
// Sanitize the release tag and strip illegal docker or github characters
143141
stage("Sanitize tag"){
@@ -768,7 +766,7 @@ pipeline {
768766
"tagger": {"name": "LinuxServer-CI","email": "ci@linuxserver.io","date": "'${GITHUB_DATE}'"}}' '''
769767
echo "Pushing New release for Tag"
770768
sh '''#! /bin/bash
771-
echo "Data change at JSON endpoint ${JSON_URL}" > releasebody.json
769+
echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json
772770
echo '{"tag_name":"'${META_TAG}'",\
773771
"target_commitish": "alpine320",\
774772
"name": "'${META_TAG}'",\

jenkins-vars.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22

33
# jenkins variables
44
project_name: docker-python
5-
external_type: custom_json
5+
external_type: na
6+
custom_version_command: "curl -sX GET https://api.github.com/repos/python/cpython/tags | jq -r '.[] | select(.name | contains(\"rc\") or contains(\"a\") or contains(\"b\") | not) | .name' | sed 's|^v||g' | sort -rV | head -1"
67
release_type: stable
78
release_tag: alpine320
89
ls_branch: alpine320
910
skip_package_check: true
1011
unraid_template_sync: false
1112
unraid_template: false
1213
repo_vars:
13-
- JSON_URL = 'https://endoflife.date/api/python.json'
14-
- JSON_PATH = '.[0].latest'
1514
- BUILD_VERSION_ARG = 'PYTHON_VERSION'
1615
- LS_USER = 'linuxserver'
1716
- LS_REPO = 'docker-python'

0 commit comments

Comments
 (0)