-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from linuxserver/alpine321-initial
release alpine 3.21 tag as stable release
- Loading branch information
Showing
10 changed files
with
67 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,31 +4,31 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
external-trigger-alpine320: | ||
external-trigger-alpine321: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: External Trigger | ||
if: github.ref == 'refs/heads/alpine320' | ||
if: github.ref == 'refs/heads/alpine321' | ||
env: | ||
SKIP_EXTERNAL_TRIGGER: ${{ vars.SKIP_EXTERNAL_TRIGGER }} | ||
run: | | ||
printf "# External trigger for docker-python\n\n" >> $GITHUB_STEP_SUMMARY | ||
if grep -q "^python_alpine320" <<< "${SKIP_EXTERNAL_TRIGGER}"; then | ||
if grep -q "^python_alpine321" <<< "${SKIP_EXTERNAL_TRIGGER}"; then | ||
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY | ||
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` contains \`python_alpine320\`; skipping trigger." >> $GITHUB_STEP_SUMMARY | ||
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` contains \`python_alpine321\`; skipping trigger." >> $GITHUB_STEP_SUMMARY | ||
exit 0 | ||
fi | ||
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY | ||
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 | ||
echo "> External trigger running off of alpine321 branch. To disable this trigger, add \`python_alpine321\` into the Github organizational variable \`SKIP_EXTERNAL_TRIGGER\`." >> $GITHUB_STEP_SUMMARY | ||
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY | ||
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) | ||
echo "Type is \`custom_version_command\`" >> $GITHUB_STEP_SUMMARY | ||
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then | ||
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY | ||
echo "> Can't retrieve external version, exiting" >> $GITHUB_STEP_SUMMARY | ||
FAILURE_REASON="Can't retrieve external version for python branch alpine320" | ||
FAILURE_REASON="Can't retrieve external version for python branch alpine321" | ||
GHA_TRIGGER_URL="https://github.com/linuxserver/docker-python/actions/runs/${{ github.run_id }}" | ||
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680, | ||
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n**Trigger URL:** '"${GHA_TRIGGER_URL}"' \n"}], | ||
|
@@ -39,7 +39,7 @@ jobs: | |
echo "External version: \`${EXT_RELEASE}\`" >> $GITHUB_STEP_SUMMARY | ||
echo "Retrieving last pushed version" >> $GITHUB_STEP_SUMMARY | ||
image="linuxserver/python" | ||
tag="alpine320" | ||
tag="alpine321" | ||
token=$(curl -sX GET \ | ||
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fpython%3Apull" \ | ||
| jq -r '.token') | ||
|
@@ -68,7 +68,7 @@ jobs: | |
if [ -z "${IMAGE_VERSION}" ]; then | ||
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY | ||
echo "Can't retrieve last pushed version, exiting" >> $GITHUB_STEP_SUMMARY | ||
FAILURE_REASON="Can't retrieve last pushed version for python tag alpine320" | ||
FAILURE_REASON="Can't retrieve last pushed version for python tag alpine321" | ||
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680, | ||
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}], | ||
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }} | ||
|
@@ -78,14 +78,14 @@ jobs: | |
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then | ||
echo "Version \`${EXT_RELEASE}\` already pushed, exiting" >> $GITHUB_STEP_SUMMARY | ||
exit 0 | ||
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-python/job/alpine320/lastBuild/api/json | jq -r '.building') == "true" ]; then | ||
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-python/job/alpine321/lastBuild/api/json | jq -r '.building') == "true" ]; then | ||
echo "New version \`${EXT_RELEASE}\` found; but there already seems to be an active build on Jenkins; exiting" >> $GITHUB_STEP_SUMMARY | ||
exit 0 | ||
else | ||
if [[ "${artifacts_found}" == "false" ]]; then | ||
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY | ||
echo "> New version detected, but not all artifacts are published yet; skipping trigger" >> $GITHUB_STEP_SUMMARY | ||
FAILURE_REASON="New version ${EXT_RELEASE} for python tag alpine320 is detected, however not all artifacts are uploaded to upstream release yet. Will try again later." | ||
FAILURE_REASON="New version ${EXT_RELEASE} for python tag alpine321 is detected, however not all artifacts are uploaded to upstream release yet. Will try again later." | ||
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903, | ||
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}], | ||
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }} | ||
|
@@ -96,7 +96,7 @@ jobs: | |
echo "All artifacts seem to be uploaded." >> $GITHUB_STEP_SUMMARY | ||
fi | ||
response=$(curl -iX POST \ | ||
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-python/job/alpine320/buildWithParameters?PACKAGE_CHECK=false \ | ||
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-python/job/alpine321/buildWithParameters?PACKAGE_CHECK=false \ | ||
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|") | ||
echo "Jenkins [job queue url](${response%$'\r'})" >> $GITHUB_STEP_SUMMARY | ||
echo "Sleeping 10 seconds until job starts" >> $GITHUB_STEP_SUMMARY | ||
|
@@ -111,7 +111,7 @@ jobs: | |
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ | ||
--data-urlencode "Submit=Submit" | ||
echo "**** Notifying Discord ****" | ||
TRIGGER_REASON="A version change was detected for python tag alpine320. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}" | ||
TRIGGER_REASON="A version change was detected for python tag alpine321. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}" | ||
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903, | ||
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}], | ||
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.