Skip to content

Commit

Permalink
Merge pull request #9 from linuxserver/alpine321-initial
Browse files Browse the repository at this point in the history
release alpine 3.21 tag as stable release
  • Loading branch information
aptalca authored Dec 6, 2024
2 parents 8c13b5f + 56e0c62 commit 61247f4
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 65 deletions.
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
## Readme

If you would like to change our readme, please __**do not**__ directly edit the readme, as it is auto-generated on each commit.
Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-python/edit/alpine320/readme-vars.yml).
Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-python/edit/alpine321/readme-vars.yml).

These variables are used in a template for our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) as part of an ansible play.
Most of these variables are also carried over to [docs.linuxserver.io](https://docs.linuxserver.io)
Expand Down Expand Up @@ -115,7 +115,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Update the changelog

If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-python/tree/alpine320/root), add an entry to the changelog
If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-python/tree/alpine321/root), add an entry to the changelog

```yml
changelogs:
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

------------------------------

- [ ] I have read the [contributing](https://github.com/linuxserver/docker-python/blob/alpine320/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications
- [ ] I have read the [contributing](https://github.com/linuxserver/docker-python/blob/alpine321/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications

------------------------------

Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/external_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}],
Expand All @@ -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')
Expand Down Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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
Expand All @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ jobs:
- uses: actions/first-interaction@v1
with:
issue-message: 'Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.'
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-python/blob/alpine320/.github/PULL_REQUEST_TEMPLATE.md)!'
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-python/blob/alpine321/.github/PULL_REQUEST_TEMPLATE.md)!'
repo-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM ghcr.io/linuxserver/baseimage-alpine:3.20 as buildstage
FROM ghcr.io/linuxserver/baseimage-alpine:3.21 as buildstage

# set version label
ARG PYTHON_VERSION
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.20 as buildstage
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.21 as buildstage

# set version label
ARG PYTHON_VERSION
Expand Down
Loading

0 comments on commit 61247f4

Please sign in to comment.