Skip to content

Commit 150d59c

Browse files
committed
Move Ubuntu build to legacy branch
1 parent 365f789 commit 150d59c

12 files changed

+203
-106
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
## Readme
2525

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

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

116116
## Update the changelog
117117

118-
If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-wireguard/tree/master/root), add an entry to the changelog
118+
If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-wireguard/tree/legacy/root), add an entry to the changelog
119119

120120
```yml
121121
changelogs:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
------------------------------
2323

24-
- [ ] I have read the [contributing](https://github.com/linuxserver/docker-wireguard/blob/master/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications
24+
- [ ] I have read the [contributing](https://github.com/linuxserver/docker-wireguard/blob/legacy/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications
2525

2626
------------------------------
2727

.github/workflows/call_issue_pr_tracker.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: Issue & PR Tracker
22

33
on:
44
issues:
5-
types: [opened,reopened,labeled,unlabeled]
5+
types: [opened,reopened,labeled,unlabeled,closed]
66
pull_request_target:
7-
types: [opened,reopened,review_requested,review_request_removed,labeled,unlabeled]
7+
types: [opened,reopened,review_requested,review_request_removed,labeled,unlabeled,closed]
8+
pull_request_review:
9+
types: [submitted,edited,dismissed]
810

911
jobs:
1012
manage-project:

.github/workflows/external_trigger.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,26 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
external-trigger-master:
7+
external-trigger-legacy:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/[email protected]
1111

1212
- name: External Trigger
13-
if: github.ref == 'refs/heads/master'
13+
if: github.ref == 'refs/heads/legacy'
1414
run: |
15-
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_WIREGUARD_MASTER }}" ]; then
16-
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_WIREGUARD_MASTER is set; skipping trigger. ****"
15+
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_WIREGUARD_LEGACY }}" ]; then
16+
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_WIREGUARD_LEGACY is set; skipping trigger. ****"
17+
echo "Github secret \`PAUSE_EXTERNAL_TRIGGER_WIREGUARD_LEGACY\` is set; skipping trigger." >> $GITHUB_STEP_SUMMARY
1718
exit 0
1819
fi
19-
echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_WIREGUARD_MASTER\". ****"
20+
echo "**** External trigger running off of legacy branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_WIREGUARD_LEGACY\". ****"
21+
echo "External trigger running off of legacy branch. To disable this trigger, set a Github secret named \`PAUSE_EXTERNAL_TRIGGER_WIREGUARD_LEGACY\`" >> $GITHUB_STEP_SUMMARY
2022
echo "**** Retrieving external version ****"
2123
EXT_RELEASE=$(curl -u ${{ secrets.CR_USER }}:${{ secrets.CR_PAT }} -sX GET https://api.github.com/repos/WireGuard/wireguard-tools/tags | jq -r .[0].name)
2224
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
2325
echo "**** Can't retrieve external version, exiting ****"
24-
FAILURE_REASON="Can't retrieve external version for wireguard branch master"
26+
FAILURE_REASON="Can't retrieve external version for wireguard branch legacy"
2527
GHA_TRIGGER_URL="https://github.com/linuxserver/docker-wireguard/actions/runs/${{ github.run_id }}"
2628
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
2729
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n**Trigger URL:** '"${GHA_TRIGGER_URL}"' \n"}],
@@ -30,9 +32,10 @@ jobs:
3032
fi
3133
EXT_RELEASE=$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g')
3234
echo "**** External version: ${EXT_RELEASE} ****"
35+
echo "External version: ${EXT_RELEASE}" >> $GITHUB_STEP_SUMMARY
3336
echo "**** Retrieving last pushed version ****"
3437
image="linuxserver/wireguard"
35-
tag="latest"
38+
tag="legacy"
3639
token=$(curl -sX GET \
3740
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fwireguard%3Apull" \
3841
| jq -r '.token')
@@ -58,38 +61,43 @@ jobs:
5861
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')
5962
if [ -z "${IMAGE_VERSION}" ]; then
6063
echo "**** Can't retrieve last pushed version, exiting ****"
61-
FAILURE_REASON="Can't retrieve last pushed version for wireguard tag latest"
64+
FAILURE_REASON="Can't retrieve last pushed version for wireguard tag legacy"
6265
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
6366
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
6467
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
6568
exit 1
6669
fi
6770
echo "**** Last pushed version: ${IMAGE_VERSION} ****"
71+
echo "Last pushed version: ${IMAGE_VERSION}" >> $GITHUB_STEP_SUMMARY
6872
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then
6973
echo "**** Version ${EXT_RELEASE} already pushed, exiting ****"
74+
echo "Version ${EXT_RELEASE} already pushed, exiting" >> $GITHUB_STEP_SUMMARY
7075
exit 0
71-
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
76+
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/legacy/lastBuild/api/json | jq -r '.building') == "true" ]; then
7277
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
7379
exit 0
7480
else
7581
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
7683
response=$(curl -iX POST \
77-
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/master/buildWithParameters?PACKAGE_CHECK=false \
84+
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/legacy/buildWithParameters?PACKAGE_CHECK=false \
7885
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
7986
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
8087
echo "**** Sleeping 10 seconds until job starts ****"
8188
sleep 10
8289
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
8390
buildurl="${buildurl%$'\r'}"
8491
echo "**** Jenkins job build url: ${buildurl} ****"
92+
echo "Jenkins job build url: ${buildurl}" >> $GITHUB_STEP_SUMMARY
8593
echo "**** Attempting to change the Jenkins job description ****"
8694
curl -iX POST \
8795
"${buildurl}submitDescription" \
8896
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
8997
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
9098
--data-urlencode "Submit=Submit"
9199
echo "**** Notifying Discord ****"
92-
TRIGGER_REASON="A version change was detected for wireguard tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
100+
TRIGGER_REASON="A version change was detected for wireguard tag legacy. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
93101
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
94102
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
95103
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}

.github/workflows/external_trigger_scheduler.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: External Trigger Scheduler
22

33
on:
44
schedule:
5-
- cron: '25 * * * *'
5+
- cron: '51 * * * *'
66
workflow_dispatch:
77

88
jobs:
@@ -17,27 +17,29 @@ jobs:
1717
run: |
1818
echo "**** Branches found: ****"
1919
git for-each-ref --format='%(refname:short)' refs/remotes
20-
echo "**** Pulling the yq docker image ****"
21-
docker pull ghcr.io/linuxserver/yq
2220
for br in $(git for-each-ref --format='%(refname:short)' refs/remotes)
2321
do
2422
br=$(echo "$br" | sed 's|origin/||g')
2523
echo "**** Evaluating branch ${br} ****"
26-
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-wireguard/${br}/jenkins-vars.yml \
27-
| docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch)
28-
if [ "$br" == "$ls_branch" ]; then
29-
echo "**** Branch ${br} appears to be live; checking workflow. ****"
24+
ls_jenkins_vars=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-wireguard/${br}/jenkins-vars.yml)
25+
ls_branch=$(echo "${ls_jenkins_vars}" | yq -r '.ls_branch')
26+
ls_trigger=$(echo "${ls_jenkins_vars}" | yq -r '.external_type')
27+
if [[ "${br}" == "${ls_branch}" ]] && [[ "${ls_trigger}" != "os" ]]; then
28+
echo "**** Branch ${br} appears to be live and trigger is not os; checking workflow. ****"
3029
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-wireguard/${br}/.github/workflows/external_trigger.yml > /dev/null 2>&1; then
3130
echo "**** Workflow exists. Triggering external trigger workflow for branch ${br} ****."
31+
echo "Triggering external trigger workflow for branch ${br}" >> $GITHUB_STEP_SUMMARY
3232
curl -iX POST \
3333
-H "Authorization: token ${{ secrets.CR_PAT }}" \
3434
-H "Accept: application/vnd.github.v3+json" \
3535
-d "{\"ref\":\"refs/heads/${br}\"}" \
3636
https://api.github.com/repos/linuxserver/docker-wireguard/actions/workflows/external_trigger.yml/dispatches
3737
else
3838
echo "**** Workflow doesn't exist; skipping trigger. ****"
39+
echo "Skipping branch ${br} due to no external trigger workflow present." >> $GITHUB_STEP_SUMMARY
3940
fi
4041
else
41-
echo "**** ${br} appears to be a dev branch; skipping trigger. ****"
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
4244
fi
4345
done

.github/workflows/greetings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ jobs:
99
- uses: actions/first-interaction@v1
1010
with:
1111
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.'
12-
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-wireguard/blob/master/.github/PULL_REQUEST_TEMPLATE.md)!'
12+
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-wireguard/blob/legacy/.github/PULL_REQUEST_TEMPLATE.md)!'
1313
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/package_trigger.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,36 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
package-trigger-master:
7+
package-trigger-legacy:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/[email protected]
1111

1212
- name: Package Trigger
13-
if: github.ref == 'refs/heads/master'
13+
if: github.ref == 'refs/heads/legacy'
1414
run: |
15-
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_WIREGUARD_MASTER }}" ]; then
16-
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_WIREGUARD_MASTER is set; skipping trigger. ****"
15+
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_WIREGUARD_LEGACY }}" ]; then
16+
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_WIREGUARD_LEGACY is set; skipping trigger. ****"
17+
echo "Github secret \`PAUSE_PACKAGE_TRIGGER_WIREGUARD_LEGACY\` is set; skipping trigger." >> $GITHUB_STEP_SUMMARY
1718
exit 0
1819
fi
19-
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
20+
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/legacy/lastBuild/api/json | jq -r '.building') == "true" ]; then
2021
echo "**** There already seems to be an active build on Jenkins; skipping package trigger ****"
22+
echo "There already seems to be an active build on Jenkins; skipping package trigger" >> $GITHUB_STEP_SUMMARY
2123
exit 0
2224
fi
23-
echo "**** Package trigger running off of master branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_WIREGUARD_MASTER\". ****"
25+
echo "**** Package trigger running off of legacy branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_WIREGUARD_LEGACY\". ****"
26+
echo "Package trigger running off of legacy branch. To disable, set a Github secret named \`PAUSE_PACKAGE_TRIGGER_WIREGUARD_LEGACY\`" >> $GITHUB_STEP_SUMMARY
2427
response=$(curl -iX POST \
25-
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/master/buildWithParameters?PACKAGE_CHECK=true \
28+
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/legacy/buildWithParameters?PACKAGE_CHECK=true \
2629
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
2730
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
2831
echo "**** Sleeping 10 seconds until job starts ****"
2932
sleep 10
3033
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
3134
buildurl="${buildurl%$'\r'}"
3235
echo "**** Jenkins job build url: ${buildurl} ****"
36+
echo "Jenkins job build url: ${buildurl}" >> $GITHUB_STEP_SUMMARY
3337
echo "**** Attempting to change the Jenkins job description ****"
3438
curl -iX POST \
3539
"${buildurl}submitDescription" \

.github/workflows/package_trigger_scheduler.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,16 @@ jobs:
1717
run: |
1818
echo "**** Branches found: ****"
1919
git for-each-ref --format='%(refname:short)' refs/remotes
20-
echo "**** Pulling the yq docker image ****"
21-
docker pull ghcr.io/linuxserver/yq
2220
for br in $(git for-each-ref --format='%(refname:short)' refs/remotes)
2321
do
2422
br=$(echo "$br" | sed 's|origin/||g')
2523
echo "**** Evaluating branch ${br} ****"
26-
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-wireguard/${br}/jenkins-vars.yml \
27-
| docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch)
24+
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-wireguard/${br}/jenkins-vars.yml | yq -r '.ls_branch')
2825
if [ "${br}" == "${ls_branch}" ]; then
2926
echo "**** Branch ${br} appears to be live; checking workflow. ****"
3027
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-wireguard/${br}/.github/workflows/package_trigger.yml > /dev/null 2>&1; then
3128
echo "**** Workflow exists. Triggering package trigger workflow for branch ${br}. ****"
29+
echo "Triggering package trigger workflow for branch ${br}" >> $GITHUB_STEP_SUMMARY
3230
triggered_branches="${triggered_branches}${br} "
3331
curl -iX POST \
3432
-H "Authorization: token ${{ secrets.CR_PAT }}" \
@@ -38,9 +36,11 @@ jobs:
3836
sleep 30
3937
else
4038
echo "**** Workflow doesn't exist; skipping trigger. ****"
39+
echo "Skipping branch ${br} due to no package trigger workflow present." >> $GITHUB_STEP_SUMMARY
4140
fi
4241
else
4342
echo "**** ${br} appears to be a dev branch; skipping trigger. ****"
43+
echo "Skipping branch ${br} due to being detected as dev branch." >> $GITHUB_STEP_SUMMARY
4444
fi
4545
done
4646
echo "**** Package check build(s) triggered for branch(es): ${triggered_branches} ****"

0 commit comments

Comments
 (0)