Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from commits to releases #103

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/external_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
echo "> External trigger running off of glitch branch. To disable this trigger, add \`mastodon_glitch\` 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/glitch-soc/mastodon/commits/main" | jq -r '. | .sha' | cut -c1-8)
echo "Type is \`github_commit\`" >> $GITHUB_STEP_SUMMARY
EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/glitch-soc/mastodon/releases/latest" | jq -r '. | .tag_name')
echo "Type is \`github_stable\`" >> $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
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ RUN \
echo "**** install mastodon ****" && \
mkdir -p /app/www && \
if [ -z ${MASTODON_VERSION+x} ]; then \
MASTODON_VERSION=$(curl -sX GET https://api.github.com/repos/glitch-soc/mastodon/commits/main \
| jq -r '. | .sha'); \
MASTODON_VERSION=$(curl -sX GET "https://api.github.com/repos/glitch-soc/mastodon/commits/main" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -s -o \
/tmp/mastodon.tar.gz -L \
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ RUN \
echo "**** install mastodon ****" && \
mkdir -p /app/www && \
if [ -z ${MASTODON_VERSION+x} ]; then \
MASTODON_VERSION=$(curl -sX GET https://api.github.com/repos/glitch-soc/mastodon/commits/main \
| jq -r '. | .sha'); \
MASTODON_VERSION=$(curl -sX GET "https://api.github.com/repos/glitch-soc/mastodon/commits/main" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -s -o \
/tmp/mastodon.tar.gz -L \
Expand Down
22 changes: 11 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pipeline {
CI_PORT='80'
CI_SSL='false'
CI_DELAY='120'
CI_DOCKERENV='TZ=US/Pacific'
CI_DOCKERENV=''
CI_AUTH=''
CI_WEBPATH=''
}
Expand Down Expand Up @@ -129,21 +129,21 @@ pipeline {
/* ########################
External Release Tagging
######################## */
// If this is a github commit trigger determine the current commit at head
stage("Set ENV github_commit"){
// If this is a stable github release use the latest endpoint from github to determine the ext tag
stage("Set ENV github_stable"){
steps{
script{
env.EXT_RELEASE = sh(
script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_GIT_BRANCH} | jq -r '. | .sha' | cut -c1-8 ''',
script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''',
returnStdout: true).trim()
}
}
}
// If this is a github commit trigger Set the external release link
stage("Set ENV commit_link"){
// If this is a stable or devel github release generate the link for the build message
stage("Set ENV github_link"){
steps{
script{
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/commit/' + env.EXT_RELEASE
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE
}
}
}
Expand Down Expand Up @@ -585,7 +585,7 @@ pipeline {
--label \"org.opencontainers.image.title=Mastodon\" \
--label \"org.opencontainers.image.description=[Mastodon](https://github.com/mastodon/mastodon/) is a free, open-source social network server based on ActivityPub where users can follow friends and discover new ones.. \" \
--no-cache --pull -t ${IMAGE}:${META_TAG} --platform=linux/amd64 \
--provenance=false --sbom=false --builder=container --load \
--provenance=false --sbom=false --builder=default --load \
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
sh '''#! /bin/bash
set -e
Expand Down Expand Up @@ -649,7 +649,7 @@ pipeline {
--label \"org.opencontainers.image.title=Mastodon\" \
--label \"org.opencontainers.image.description=[Mastodon](https://github.com/mastodon/mastodon/) is a free, open-source social network server based on ActivityPub where users can follow friends and discover new ones.. \" \
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} --platform=linux/amd64 \
--provenance=false --sbom=false --builder=container --load \
--provenance=false --sbom=false --builder=default --load \
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
sh '''#! /bin/bash
set -e
Expand Down Expand Up @@ -706,7 +706,7 @@ pipeline {
--label \"org.opencontainers.image.title=Mastodon\" \
--label \"org.opencontainers.image.description=[Mastodon](https://github.com/mastodon/mastodon/) is a free, open-source social network server based on ActivityPub where users can follow friends and discover new ones.. \" \
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} --platform=linux/arm64 \
--provenance=false --sbom=false --builder=container --load \
--provenance=false --sbom=false --builder=default --load \
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
sh '''#! /bin/bash
set -e
Expand Down Expand Up @@ -974,7 +974,7 @@ pipeline {
"tagger": {"name": "LinuxServer-CI","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' '''
echo "Pushing New release for Tag"
sh '''#! /bin/bash
curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_RELEASE_CLEAN} | jq '.commit.message' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
echo '{"tag_name":"'${META_TAG}'",\
"target_commitish": "glitch",\
"name": "'${META_TAG}'",\
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **03.12.24:** - Switch from commit builds to releases to match upstream changes.
* **27.05.24:** - Existing users should update their nginx confs to avoid http2 deprecation warnings.
* **23.05.24:** - Rebase to Alpine 3.20.
* **02.05.24:** - Rebase to Alpine 3.19, enable [Active Record Encryption](https://github.com/mastodon/mastodon/pull/29831/files).
Expand Down
9 changes: 5 additions & 4 deletions jenkins-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

# jenkins variables
project_name: docker-mastodon
external_type: github_commit
external_type: github_stable
release_type: prerelease
release_tag: glitch
ls_branch: glitch
build_armhf: false
image_provenance: false
image_sbom: false
image_builder: default
repo_vars:
- EXT_GIT_BRANCH = 'main'
- EXT_USER = 'glitch-soc'
Expand All @@ -25,7 +27,6 @@ repo_vars:
- CI_PORT='80'
- CI_SSL='false'
- CI_DELAY='120'
- CI_DOCKERENV='TZ=US/Pacific'
- CI_DOCKERENV=''
- CI_AUTH=''
- CI_WEBPATH=''

1 change: 1 addition & 0 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ init_diagram: |
"mastodon:glitch" <- Base Images
# changelog
changelogs:
- {date: "03.12.24:", desc: "Switch from commit builds to releases to match upstream changes."}
- {date: "27.05.24:", desc: "Existing users should update their nginx confs to avoid http2 deprecation warnings."}
- {date: "23.05.24:", desc: "Rebase to Alpine 3.20."}
- {date: "02.05.24:", desc: "Rebase to Alpine 3.19, enable [Active Record Encryption](https://github.com/mastodon/mastodon/pull/29831/files)."}
Expand Down
Loading