Skip to content
This repository was archived by the owner on Jun 15, 2021. It is now read-only.

Commit dbf4003

Browse files
Bot Updating Templated Files
1 parent 5c2fcc0 commit dbf4003

File tree

8 files changed

+151
-32
lines changed

8 files changed

+151
-32
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Discord chat support
4+
url: https://discord.gg/YWrKVTn
5+
about: Realtime support / chat with the community and the team.
6+
7+
- name: Discourse discussion forum
8+
url: https://discourse.linuxserver.io
9+
about: Post on our community forum.
10+
11+
- name: Documentation
12+
url: https://docs.linuxserver.io/images/docker-openvpn-as
13+
about: Documentation - information about all of our containers.

.github/ISSUE_TEMPLATE/issue.bug.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
5+
---
6+
[linuxserverurl]: https://linuxserver.io
7+
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
8+
9+
<!--- If you are new to Docker or this application our issue tracker is **ONLY** used for reporting bugs or requesting features. Please use [our discord server](https://discord.gg/YWrKVTn) for general support. --->
10+
11+
<!--- Provide a general summary of the bug in the Title above -->
12+
13+
------------------------------
14+
15+
## Expected Behavior
16+
<!--- Tell us what should happen -->
17+
18+
## Current Behavior
19+
<!--- Tell us what happens instead of the expected behavior -->
20+
21+
## Steps to Reproduce
22+
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
23+
<!--- reproduce this bug. Include code to reproduce, if relevant -->
24+
1.
25+
2.
26+
3.
27+
4.
28+
29+
## Environment
30+
**OS:**
31+
**CPU architecture:** x86_64/arm32/arm64
32+
**How docker service was installed:**
33+
<!--- ie. from the official docker repo, from the distro repo, nas OS provided, etc. -->
34+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
35+
36+
## Command used to create docker container (run/create/compose/screenshot)
37+
<!--- Provide your docker create/run command or compose yaml snippet, or a screenshot of settings if using a gui to create the container -->
38+
39+
## Docker logs
40+
<!--- Provide a full docker log, output of "docker logs openvpn-as" -->
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
5+
---
6+
[linuxserverurl]: https://linuxserver.io
7+
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
8+
9+
<!--- If you are new to Docker or this application our issue tracker is **ONLY** used for reporting bugs or requesting features. Please use [our discord server](https://discord.gg/YWrKVTn) for general support. --->
10+
11+
<!--- If this acts as a feature request please ask yourself if this modification is something the whole userbase will benefit from --->
12+
<!--- If this is a specific change for corner case functionality or plugins please look at making a Docker Mod or local script https://blog.linuxserver.io/2019/09/14/customizing-our-containers/ -->
13+
14+
<!--- Provide a general summary of the request in the Title above -->
15+
16+
------------------------------
17+
18+
## Desired Behavior
19+
<!--- Tell us what should happen -->
20+
21+
## Current Behavior
22+
<!--- Tell us what happens instead of the expected behavior -->
23+
24+
## Alternatives Considered
25+
<!--- Tell us what other options you have tried or considered -->

.github/workflows/external_trigger.yml

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,23 @@ jobs:
1313
if: github.ref == 'refs/heads/master'
1414
run: |
1515
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_OPENVPN_AS_MASTER }}" ]; then
16-
echo "Github secret PAUSE_EXTERNAL_TRIGGER_OPENVPN_AS_MASTER is set; skipping trigger."
16+
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_OPENVPN_AS_MASTER is set; skipping trigger. ****"
1717
exit 0
1818
fi
19-
echo "External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_OPENVPN_AS_MASTER\"."
20-
echo "Retrieving external version"
19+
echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_OPENVPN_AS_MASTER\". ****"
20+
echo "**** Retrieving external version ****"
2121
EXT_RELEASE=$(curl -sX GET http://as-repository.openvpn.net/as/debian/dists/bionic/main/binary-amd64/Packages.gz | gunzip -c |grep -A 7 -m 1 'Package: openvpn-as' | awk -F ': ' '/Version/{print $2;exit}')
22-
if [ -z "${EXT_RELEASE}" ]; then
23-
echo "Can't retrieve external version, exiting"
22+
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
23+
echo "**** Can't retrieve external version, exiting ****"
2424
FAILURE_REASON="Can't retrieve external version for openvpn-as branch master"
2525
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
2626
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
2727
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
2828
exit 1
2929
fi
30-
echo "External version: ${EXT_RELEASE}"
31-
echo "Retrieving last pushed version"
30+
EXT_RELEASE=$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g')
31+
echo "**** External version: ${EXT_RELEASE} ****"
32+
echo "**** Retrieving last pushed version ****"
3233
image="linuxserver/openvpn-as"
3334
tag="latest"
3435
token=$(curl -sX GET \
@@ -46,25 +47,40 @@ jobs:
4647
IMAGE_RELEASE=$(echo ${image_info} | jq -r '.Labels.build_version' | awk '{print $3}')
4748
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')
4849
if [ -z "${IMAGE_VERSION}" ]; then
49-
echo "Can't retrieve last pushed version, exiting"
50+
echo "**** Can't retrieve last pushed version, exiting ****"
5051
FAILURE_REASON="Can't retrieve last pushed version for openvpn-as tag latest"
5152
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
5253
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
5354
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
5455
exit 1
5556
fi
56-
echo "Last pushed version: ${IMAGE_VERSION}"
57+
echo "**** Last pushed version: ${IMAGE_VERSION} ****"
5758
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then
58-
echo "Version ${EXT_RELEASE} already pushed, exiting"
59+
echo "**** Version ${EXT_RELEASE} already pushed, exiting ****"
60+
exit 0
61+
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-openvpn-as/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
62+
echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****"
5963
exit 0
6064
else
61-
echo "New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build"
62-
curl -X POST \
65+
echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****"
66+
response=$(curl -iX POST \
6367
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-openvpn-as/job/master/buildWithParameters?PACKAGE_CHECK=false \
64-
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }}
65-
echo "Notifying Discord"
68+
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
69+
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
70+
echo "**** Sleeping 10 seconds until job starts ****"
71+
sleep 10
72+
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
73+
buildurl="${buildurl%$'\r'}"
74+
echo "**** Jenkins job build url: ${buildurl} ****"
75+
echo "**** Attempting to change the Jenkins job description ****"
76+
curl -iX POST \
77+
"${buildurl}submitDescription" \
78+
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
79+
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
80+
--data-urlencode "Submit=Submit"
81+
echo "**** Notifying Discord ****"
6682
TRIGGER_REASON="A version change was detected for openvpn-as tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
6783
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
68-
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n"}],
84+
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
6985
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
7086
fi

.github/workflows/external_trigger_scheduler.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,32 @@ jobs:
1212
- uses: actions/[email protected]
1313
with:
1414
fetch-depth: '0'
15-
15+
1616
- name: External Trigger Scheduler
1717
run: |
18+
echo "**** Branches found: ****"
1819
git for-each-ref --format='%(refname:short)' refs/remotes
20+
echo "**** Pulling the yq docker image ****"
1921
docker pull ghcr.io/linuxserver/yq
2022
for br in $(git for-each-ref --format='%(refname:short)' refs/remotes)
2123
do
2224
br=$(echo "$br" | sed 's|origin/||g')
23-
echo "Evaluating branch ${br}"
25+
echo "**** Evaluating branch ${br} ****"
2426
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-openvpn-as/${br}/jenkins-vars.yml \
2527
| docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch)
2628
if [ "$br" == "$ls_branch" ]; then
27-
echo "${br} is a live branch, checking workflow."
29+
echo "**** Branch ${br} appears to be live; checking workflow. ****"
2830
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-openvpn-as/${br}/.github/workflows/external_trigger.yml > /dev/null 2>&1; then
29-
echo "Workflow exists. Triggering external trigger workflow for branch ${br}."
31+
echo "**** Workflow exists. Triggering external trigger workflow for branch ${br} ****."
3032
curl -iX POST \
3133
-H "Authorization: token ${{ secrets.CR_PAT }}" \
3234
-H "Accept: application/vnd.github.v3+json" \
3335
-d "{\"ref\":\"refs/heads/${br}\"}" \
3436
https://api.github.com/repos/linuxserver/docker-openvpn-as/actions/workflows/external_trigger.yml/dispatches
3537
else
36-
echo "Workflow doesn't exist; skipping trigger."
38+
echo "**** Workflow doesn't exist; skipping trigger. ****"
3739
fi
3840
else
39-
echo "${br} appears to be a dev branch; skipping trigger."
41+
echo "**** ${br} appears to be a dev branch; skipping trigger. ****"
4042
fi
4143
done

.github/workflows/package_trigger.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,26 @@ jobs:
1313
if: github.ref == 'refs/heads/master'
1414
run: |
1515
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_OPENVPN_AS_MASTER }}" ]; then
16-
echo "Github secret PAUSE_PACKAGE_TRIGGER_OPENVPN_AS_MASTER is set; skipping trigger."
16+
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_OPENVPN_AS_MASTER is set; skipping trigger. ****"
1717
exit 0
1818
fi
19-
echo "Package trigger running off of master branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_OPENVPN_AS_MASTER\"."
20-
curl -X POST \
19+
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-openvpn-as/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
20+
echo "**** There already seems to be an active build on Jenkins; skipping package trigger ****"
21+
exit 0
22+
fi
23+
echo "**** Package trigger running off of master branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_OPENVPN_AS_MASTER\". ****"
24+
response=$(curl -iX POST \
2125
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-openvpn-as/job/master/buildWithParameters?PACKAGE_CHECK=true \
22-
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }}
26+
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
27+
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
28+
echo "**** Sleeping 10 seconds until job starts ****"
29+
sleep 10
30+
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
31+
buildurl="${buildurl%$'\r'}"
32+
echo "**** Jenkins job build url: ${buildurl} ****"
33+
echo "**** Attempting to change the Jenkins job description ****"
34+
curl -iX POST \
35+
"${buildurl}submitDescription" \
36+
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
37+
--data-urlencode "description=GHA package trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
38+
--data-urlencode "Submit=Submit"

.github/workflows/package_trigger_scheduler.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,39 @@ jobs:
1212
- uses: actions/[email protected]
1313
with:
1414
fetch-depth: '0'
15-
15+
1616
- name: Package Trigger Scheduler
1717
run: |
18+
echo "**** Branches found: ****"
1819
git for-each-ref --format='%(refname:short)' refs/remotes
20+
echo "**** Pulling the yq docker image ****"
1921
docker pull ghcr.io/linuxserver/yq
2022
for br in $(git for-each-ref --format='%(refname:short)' refs/remotes)
2123
do
2224
br=$(echo "$br" | sed 's|origin/||g')
23-
echo "Evaluating branch ${br}"
25+
echo "**** Evaluating branch ${br} ****"
2426
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-openvpn-as/${br}/jenkins-vars.yml \
2527
| docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch)
2628
if [ "${br}" == "${ls_branch}" ]; then
27-
echo "Branch ${br} appears to be live; triggering."
29+
echo "**** Branch ${br} appears to be live; checking workflow. ****"
2830
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-openvpn-as/${br}/.github/workflows/package_trigger.yml > /dev/null 2>&1; then
29-
echo "Workflow exists. Triggering package trigger workflow for branch ${br}."
31+
echo "**** Workflow exists. Triggering package trigger workflow for branch ${br}. ****"
32+
triggered_branches="${triggered_branches}${br} "
3033
curl -iX POST \
3134
-H "Authorization: token ${{ secrets.CR_PAT }}" \
3235
-H "Accept: application/vnd.github.v3+json" \
3336
-d "{\"ref\":\"refs/heads/${br}\"}" \
3437
https://api.github.com/repos/linuxserver/docker-openvpn-as/actions/workflows/package_trigger.yml/dispatches
3538
sleep 30
3639
else
37-
echo "Workflow doesn't exist; skipping trigger."
40+
echo "**** Workflow doesn't exist; skipping trigger. ****"
3841
fi
3942
else
40-
echo "${br} appears to be a dev branch; skipping trigger."
43+
echo "**** ${br} appears to be a dev branch; skipping trigger. ****"
4144
fi
4245
done
46+
echo "**** Package check build(s) triggered for branch(es): ${triggered_branches} ****"
47+
echo "**** Notifying Discord ****"
48+
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
49+
"description": "**Package Check Build(s) Triggered for openvpn-as** \n**Branch(es):** '"${triggered_branches}"' \n**Build URL:** '"https://ci.linuxserver.io/blue/organizations/jenkins/Docker-Pipeline-Builders%2Fdocker-openvpn-as/activity/"' \n"}],
50+
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}

0 commit comments

Comments
 (0)