Skip to content

Commit e9f4337

Browse files
committed
Fix changelog date
1 parent 7929311 commit e9f4337

17 files changed

+543
-248
lines changed

.editorconfig

100755100644
File mode changed.

.github/CONTRIBUTING.md

100755100644
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Read, and fill the Pull Request template
77
* If this is a fix for a typo (in code, documentation, or the README) please file an issue and let us sort it out. We do not need a PR
88
* If the PR is addressing an existing issue include, closes #\<issue number>, in the body of the PR commit message
9-
* If you want to discuss changes, you can also bring it up in [#dev-talk](https://discordapp.com/channels/354974912613449730/757585807061155840) in our [Discord server](https://discord.gg/YWrKVTn)
9+
* If you want to discuss changes, you can also bring it up in [#dev-talk](https://discordapp.com/channels/354974912613449730/757585807061155840) in our [Discord server](https://linuxserver.io/discord)
1010

1111
## Common files
1212

@@ -105,10 +105,10 @@ docker build \
105105
-t linuxserver/code-server:latest .
106106
```
107107

108-
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
108+
The ARM variants can be built on x86_64 hardware and vice versa using `lscr.io/linuxserver/qemu-static`
109109

110110
```bash
111-
docker run --rm --privileged multiarch/qemu-user-static:register --reset
111+
docker run --rm --privileged lscr.io/linuxserver/qemu-static --reset
112112
```
113113

114114
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.

.github/FUNDING.yml

100755100644
File mode changed.

.github/ISSUE_TEMPLATE/config.yml

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Discord chat support
4-
url: https://discord.gg/YWrKVTn
4+
url: https://linuxserver.io/discord
55
about: Realtime support / chat with the community and the team.
66

77
- name: Discourse discussion forum

.github/ISSUE_TEMPLATE/issue.bug.yml

100755100644
File mode changed.

.github/ISSUE_TEMPLATE/issue.feature.yml

100755100644
File mode changed.

.github/workflows/call_issue_pr_tracker.yml

100755100644
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
pull_request_review:
99
types: [submitted,edited,dismissed]
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
manage-project:
1316
permissions:

.github/workflows/call_issues_cron.yml

100755100644
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
- cron: '31 1 * * *'
55
workflow_dispatch:
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
stale:
912
permissions:

.github/workflows/external_trigger.yml

Lines changed: 93 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: External Trigger Main
33
on:
44
workflow_dispatch:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
external-trigger-master:
811
runs-on: ubuntu-latest
@@ -11,44 +14,75 @@ jobs:
1114

1215
- name: External Trigger
1316
if: github.ref == 'refs/heads/master'
17+
env:
18+
SKIP_EXTERNAL_TRIGGER: ${{ vars.SKIP_EXTERNAL_TRIGGER }}
1419
run: |
15-
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_CODE_SERVER_MASTER }}" ]; then
16-
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_CODE_SERVER_MASTER is set; skipping trigger. ****"
17-
echo "Github secret \`PAUSE_EXTERNAL_TRIGGER_CODE_SERVER_MASTER\` is set; skipping trigger." >> $GITHUB_STEP_SUMMARY
20+
printf "# External trigger for docker-code-server\n\n" >> $GITHUB_STEP_SUMMARY
21+
if grep -q "^code-server_master_" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
22+
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
23+
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` contains \`code-server_master_\`; will skip trigger if version matches." >> $GITHUB_STEP_SUMMARY
24+
elif grep -q "^code-server_master" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
25+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
26+
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` contains \`code-server_master\`; skipping trigger." >> $GITHUB_STEP_SUMMARY
1827
exit 0
1928
fi
20-
echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_CODE_SERVER_MASTER\". ****"
21-
echo "External trigger running off of master branch. To disable this trigger, set a Github secret named \`PAUSE_EXTERNAL_TRIGGER_CODE_SERVER_MASTER\`" >> $GITHUB_STEP_SUMMARY
22-
echo "**** Retrieving external version ****"
29+
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
30+
echo "> External trigger running off of master branch. To disable this trigger, add \`code-server_master\` into the Github organizational variable \`SKIP_EXTERNAL_TRIGGER\`." >> $GITHUB_STEP_SUMMARY
31+
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY
2332
EXT_RELEASE=$(curl -u ${{ secrets.CR_USER }}:${{ secrets.CR_PAT }} -sX GET https://api.github.com/repos/coder/code-server/releases/latest | jq -r '.tag_name' | sed 's|^v||')
33+
echo "Type is \`custom_version_command\`" >> $GITHUB_STEP_SUMMARY
34+
if grep -q "^code-server_master_${EXT_RELEASE}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
35+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
36+
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` matches current external release; skipping trigger." >> $GITHUB_STEP_SUMMARY
37+
exit 0
38+
fi
2439
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
25-
echo "**** Can't retrieve external version, exiting ****"
40+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
41+
echo "> Can't retrieve external version, exiting" >> $GITHUB_STEP_SUMMARY
2642
FAILURE_REASON="Can't retrieve external version for code-server branch master"
2743
GHA_TRIGGER_URL="https://github.com/linuxserver/docker-code-server/actions/runs/${{ github.run_id }}"
2844
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
2945
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n**Trigger URL:** '"${GHA_TRIGGER_URL}"' \n"}],
3046
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
3147
exit 1
3248
fi
33-
EXT_RELEASE=$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g')
34-
echo "**** External version: ${EXT_RELEASE} ****"
35-
echo "External version: ${EXT_RELEASE}" >> $GITHUB_STEP_SUMMARY
36-
echo "**** Retrieving last pushed version ****"
49+
EXT_RELEASE_SANITIZED=$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g')
50+
echo "Sanitized external version: \`${EXT_RELEASE_SANITIZED}\`" >> $GITHUB_STEP_SUMMARY
51+
echo "Retrieving last pushed version" >> $GITHUB_STEP_SUMMARY
3752
image="linuxserver/code-server"
3853
tag="latest"
3954
token=$(curl -sX GET \
4055
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fcode-server%3Apull" \
4156
| jq -r '.token')
42-
multidigest=$(curl -s \
43-
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
44-
--header "Authorization: Bearer ${token}" \
45-
"https://ghcr.io/v2/${image}/manifests/${tag}" \
46-
| jq -r 'first(.manifests[].digest)')
47-
digest=$(curl -s \
57+
multidigest=$(curl -s \
58+
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
59+
--header "Accept: application/vnd.oci.image.index.v1+json" \
60+
--header "Authorization: Bearer ${token}" \
61+
"https://ghcr.io/v2/${image}/manifests/${tag}")
62+
if jq -e '.layers // empty' <<< "${multidigest}" >/dev/null 2>&1; then
63+
# If there's a layer element it's a single-arch manifest so just get that digest
64+
digest=$(jq -r '.config.digest' <<< "${multidigest}")
65+
else
66+
# Otherwise it's multi-arch or has manifest annotations
67+
if jq -e '.manifests[]?.annotations // empty' <<< "${multidigest}" >/dev/null 2>&1; then
68+
# Check for manifest annotations and delete if found
69+
multidigest=$(jq 'del(.manifests[] | select(.annotations))' <<< "${multidigest}")
70+
fi
71+
if [[ $(jq '.manifests | length' <<< "${multidigest}") -gt 1 ]]; then
72+
# If there's still more than one digest, it's multi-arch
73+
multidigest=$(jq -r ".manifests[] | select(.platform.architecture == \"amd64\").digest?" <<< "${multidigest}")
74+
else
75+
# Otherwise it's single arch
76+
multidigest=$(jq -r ".manifests[].digest?" <<< "${multidigest}")
77+
fi
78+
if digest=$(curl -s \
4879
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
80+
--header "Accept: application/vnd.oci.image.manifest.v1+json" \
4981
--header "Authorization: Bearer ${token}" \
50-
"https://ghcr.io/v2/${image}/manifests/${multidigest}" \
51-
| jq -r '.config.digest')
82+
"https://ghcr.io/v2/${image}/manifests/${multidigest}"); then
83+
digest=$(jq -r '.config.digest' <<< "${digest}");
84+
fi
85+
fi
5286
image_info=$(curl -sL \
5387
--header "Authorization: Bearer ${token}" \
5488
"https://ghcr.io/v2/${image}/blobs/${digest}")
@@ -60,45 +94,54 @@ jobs:
6094
IMAGE_RELEASE=$(echo ${image_info} | jq -r '.Labels.build_version' | awk '{print $3}')
6195
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')
6296
if [ -z "${IMAGE_VERSION}" ]; then
63-
echo "**** Can't retrieve last pushed version, exiting ****"
97+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
98+
echo "Can't retrieve last pushed version, exiting" >> $GITHUB_STEP_SUMMARY
6499
FAILURE_REASON="Can't retrieve last pushed version for code-server tag latest"
65100
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
66101
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
67102
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
68103
exit 1
69104
fi
70-
echo "**** Last pushed version: ${IMAGE_VERSION} ****"
71-
echo "Last pushed version: ${IMAGE_VERSION}" >> $GITHUB_STEP_SUMMARY
72-
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then
73-
echo "**** Version ${EXT_RELEASE} already pushed, exiting ****"
74-
echo "Version ${EXT_RELEASE} already pushed, exiting" >> $GITHUB_STEP_SUMMARY
105+
echo "Last pushed version: \`${IMAGE_VERSION}\`" >> $GITHUB_STEP_SUMMARY
106+
if [ "${EXT_RELEASE_SANITIZED}" == "${IMAGE_VERSION}" ]; then
107+
echo "Sanitized version \`${EXT_RELEASE_SANITIZED}\` already pushed, exiting" >> $GITHUB_STEP_SUMMARY
75108
exit 0
76109
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-code-server/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
77-
echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****"
78-
echo "New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting" >> $GITHUB_STEP_SUMMARY
110+
echo "New version \`${EXT_RELEASE}\` found; but there already seems to be an active build on Jenkins; exiting" >> $GITHUB_STEP_SUMMARY
79111
exit 0
80112
else
81-
echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****"
82-
echo "New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build" >> $GITHUB_STEP_SUMMARY
83-
response=$(curl -iX POST \
84-
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-code-server/job/master/buildWithParameters?PACKAGE_CHECK=false \
85-
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
86-
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
87-
echo "**** Sleeping 10 seconds until job starts ****"
88-
sleep 10
89-
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
90-
buildurl="${buildurl%$'\r'}"
91-
echo "**** Jenkins job build url: ${buildurl} ****"
92-
echo "Jenkins job build url: ${buildurl}" >> $GITHUB_STEP_SUMMARY
93-
echo "**** Attempting to change the Jenkins job description ****"
94-
curl -iX POST \
95-
"${buildurl}submitDescription" \
96-
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
97-
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
98-
--data-urlencode "Submit=Submit"
99-
echo "**** Notifying Discord ****"
100-
TRIGGER_REASON="A version change was detected for code-server tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
101-
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
102-
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
103-
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
113+
if [[ "${artifacts_found}" == "false" ]]; then
114+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
115+
echo "> New version detected, but not all artifacts are published yet; skipping trigger" >> $GITHUB_STEP_SUMMARY
116+
FAILURE_REASON="New version ${EXT_RELEASE} for code-server tag latest is detected, however not all artifacts are uploaded to upstream release yet. Will try again later."
117+
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
118+
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
119+
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
120+
else
121+
printf "\n## Trigger new build\n\n" >> $GITHUB_STEP_SUMMARY
122+
echo "New sanitized version \`${EXT_RELEASE_SANITIZED}\` found; old version was \`${IMAGE_VERSION}\`. Triggering new build" >> $GITHUB_STEP_SUMMARY
123+
if [[ "${artifacts_found}" == "true" ]]; then
124+
echo "All artifacts seem to be uploaded." >> $GITHUB_STEP_SUMMARY
125+
fi
126+
response=$(curl -iX POST \
127+
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-code-server/job/master/buildWithParameters?PACKAGE_CHECK=false \
128+
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
129+
echo "Jenkins [job queue url](${response%$'\r'})" >> $GITHUB_STEP_SUMMARY
130+
echo "Sleeping 10 seconds until job starts" >> $GITHUB_STEP_SUMMARY
131+
sleep 10
132+
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
133+
buildurl="${buildurl%$'\r'}"
134+
echo "Jenkins job [build url](${buildurl})" >> $GITHUB_STEP_SUMMARY
135+
echo "Attempting to change the Jenkins job description" >> $GITHUB_STEP_SUMMARY
136+
curl -iX POST \
137+
"${buildurl}submitDescription" \
138+
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
139+
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
140+
--data-urlencode "Submit=Submit"
141+
echo "**** Notifying Discord ****"
142+
TRIGGER_REASON="A version change was detected for code-server tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE_SANITIZED}"
143+
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
144+
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
145+
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
146+
fi
104147
fi

.github/workflows/external_trigger_scheduler.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
- cron: '32 * * * *'
66
workflow_dispatch:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
external-trigger-scheduler:
1013
runs-on: ubuntu-latest
@@ -15,31 +18,31 @@ jobs:
1518

1619
- name: External Trigger Scheduler
1720
run: |
18-
echo "**** Branches found: ****"
19-
git for-each-ref --format='%(refname:short)' refs/remotes
20-
for br in $(git for-each-ref --format='%(refname:short)' refs/remotes)
21+
printf "# External trigger scheduler for docker-code-server\n\n" >> $GITHUB_STEP_SUMMARY
22+
printf "Found the branches:\n\n%s\n" "$(git for-each-ref --format='- %(refname:lstrip=3)' refs/remotes)" >> $GITHUB_STEP_SUMMARY
23+
for br in $(git for-each-ref --format='%(refname:lstrip=3)' refs/remotes)
2124
do
22-
br=$(echo "$br" | sed 's|origin/||g')
23-
echo "**** Evaluating branch ${br} ****"
25+
if [[ "${br}" == "HEAD" ]]; then
26+
printf "\nSkipping %s.\n" ${br} >> $GITHUB_STEP_SUMMARY
27+
continue
28+
fi
29+
printf "\n## Evaluating \`%s\`\n\n" ${br} >> $GITHUB_STEP_SUMMARY
2430
ls_jenkins_vars=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-code-server/${br}/jenkins-vars.yml)
2531
ls_branch=$(echo "${ls_jenkins_vars}" | yq -r '.ls_branch')
2632
ls_trigger=$(echo "${ls_jenkins_vars}" | yq -r '.external_type')
2733
if [[ "${br}" == "${ls_branch}" ]] && [[ "${ls_trigger}" != "os" ]]; then
28-
echo "**** Branch ${br} appears to be live and trigger is not os; checking workflow. ****"
34+
echo "Branch appears to be live and trigger is not os; checking workflow." >> $GITHUB_STEP_SUMMARY
2935
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-code-server/${br}/.github/workflows/external_trigger.yml > /dev/null 2>&1; then
30-
echo "**** Workflow exists. Triggering external trigger workflow for branch ${br} ****."
31-
echo "Triggering external trigger workflow for branch ${br}" >> $GITHUB_STEP_SUMMARY
36+
echo "Triggering external trigger workflow for branch." >> $GITHUB_STEP_SUMMARY
3237
curl -iX POST \
3338
-H "Authorization: token ${{ secrets.CR_PAT }}" \
3439
-H "Accept: application/vnd.github.v3+json" \
3540
-d "{\"ref\":\"refs/heads/${br}\"}" \
3641
https://api.github.com/repos/linuxserver/docker-code-server/actions/workflows/external_trigger.yml/dispatches
3742
else
38-
echo "**** Workflow doesn't exist; skipping trigger. ****"
39-
echo "Skipping branch ${br} due to no external trigger workflow present." >> $GITHUB_STEP_SUMMARY
43+
echo "Skipping branch due to no external trigger workflow present." >> $GITHUB_STEP_SUMMARY
4044
fi
4145
else
42-
echo "**** ${br} is either a dev branch, or has no external version; skipping trigger. ****"
43-
echo "Skipping branch ${br} due to being detected as dev branch or having no external version." >> $GITHUB_STEP_SUMMARY
46+
echo "Skipping branch due to being detected as dev branch or having no external version." >> $GITHUB_STEP_SUMMARY
4447
fi
4548
done

0 commit comments

Comments
 (0)