Skip to content

Commit 1d5a4d3

Browse files
committed
Fix jenkins vars to use upstream release again
1 parent 08d0843 commit 1d5a4d3

3 files changed

Lines changed: 21 additions & 15 deletions

File tree

.github/workflows/external_trigger.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ jobs:
2929
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
3030
echo "> External trigger running off of main branch. To disable this trigger, add \`planka_main\` 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=$(echo v1.26.3)
33-
echo "Type is \`custom_version_command\`" >> $GITHUB_STEP_SUMMARY
32+
EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/plankanban/planka/releases/latest" | jq -r '. | .tag_name')
33+
echo "Type is \`github_stable\`" >> $GITHUB_STEP_SUMMARY
3434
if grep -q "^planka_main_${EXT_RELEASE}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
3535
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
3636
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` matches current external release; skipping trigger." >> $GITHUB_STEP_SUMMARY

Jenkinsfile

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,23 @@ pipeline {
145145
/* ########################
146146
External Release Tagging
147147
######################## */
148-
// If this is a custom command to determine version use that command
149-
stage("Set tag custom bash"){
150-
steps{
151-
script{
152-
env.EXT_RELEASE = sh(
153-
script: ''' echo v1.26.3 ''',
154-
returnStdout: true).trim()
155-
env.RELEASE_LINK = 'custom_command'
156-
}
157-
}
148+
// If this is a stable github release use the latest endpoint from github to determine the ext tag
149+
stage("Set ENV github_stable"){
150+
steps{
151+
script{
152+
env.EXT_RELEASE = sh(
153+
script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''',
154+
returnStdout: true).trim()
155+
}
156+
}
157+
}
158+
// If this is a stable or devel github release generate the link for the build message
159+
stage("Set ENV github_link"){
160+
steps{
161+
script{
162+
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE
163+
}
164+
}
158165
}
159166
// Sanitize the release tag and strip illegal docker or github characters
160167
stage("Sanitize tag"){
@@ -1023,7 +1030,7 @@ pipeline {
10231030
"type": "commit",\
10241031
"tagger": {"name": "LinuxServer-CI","email": "ci@linuxserver.io","date": "'${GITHUB_DATE}'"}}'
10251032
echo "Pushing New release for Tag"
1026-
echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json
1033+
curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. |.body' > releasebody.json
10271034
jq -n \
10281035
--arg tag_name "$META_TAG" \
10291036
--arg target_commitish "main" \

jenkins-vars.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
# jenkins variables
44
project_name: docker-planka
5-
external_type: na
6-
custom_version_command: "echo v1.26.3"
5+
external_type: github_stable
76
release_type: stable
87
release_tag: latest
98
ls_branch: main

0 commit comments

Comments
 (0)