Skip to content

Commit f0f6bfe

Browse files
authored
Merge pull request #61 from linuxserver/3.8-workflows
update baseimages, add trigger workflows
2 parents e6ab457 + a0a4b64 commit f0f6bfe

File tree

7 files changed

+148
-3
lines changed

7 files changed

+148
-3
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: External Trigger Main
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
external-trigger-3.8:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/[email protected]
11+
12+
- name: External Trigger
13+
if: github.ref == 'refs/heads/3.8'
14+
run: |
15+
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_BASEIMAGE_ALPINE_NGINX_3.8 }}" ]; then
16+
echo "Github secret PAUSE_EXTERNAL_TRIGGER_BASEIMAGE_ALPINE_NGINX_3.8 is set; skipping trigger."
17+
exit 0
18+
fi
19+
echo "External trigger running off of 3.8 branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_BASEIMAGE_ALPINE_NGINX_3.8\"."
20+
echo "Setting env vars"
21+
BUILD_VERSION_ARG='OS'
22+
LS_USER='linuxserver'
23+
LS_REPO='docker-baseimage-alpine-nginx'
24+
CONTAINER_NAME='baseimage-alpine-nginx'
25+
DOCKERHUB_IMAGE='lsiobase/nginx'
26+
DEV_DOCKERHUB_IMAGE='lsiodev/baseimage-nginx'
27+
PR_DOCKERHUB_IMAGE='lspipepr/baseimage-nginx'
28+
DIST_IMAGE='alpine'
29+
MULTIARCH='true'
30+
CI='true'
31+
CI_WEB='true'
32+
CI_PORT='80'
33+
CI_SSL='true'
34+
CI_DELAY='120'
35+
CI_DOCKERENV='TZ=US/Pacific'
36+
CI_AUTH='user:password'
37+
CI_WEBPATH=''
38+
echo "Retrieving external version"
39+
echo "No external release, exiting."
40+
exit 0
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: External Trigger Scheduler
2+
3+
on:
4+
schedule:
5+
- cron: '20 * * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
external-trigger-scheduler:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/[email protected]
13+
with:
14+
fetch-depth: '0'
15+
16+
- name: External Trigger Scheduler
17+
run: |
18+
git for-each-ref --format='%(refname:short)' refs/remotes
19+
docker pull ghcr.io/linuxserver/yq
20+
for br in $(git for-each-ref --format='%(refname:short)' refs/remotes)
21+
do
22+
br=$(echo "$br" | sed 's|origin/||g')
23+
echo "Evaluating branch ${br}"
24+
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-alpine-nginx/${br}/jenkins-vars.yml \
25+
| docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch)
26+
if [ "$br" == "$ls_branch" ]; then
27+
echo "${br} is a live branch, checking workflow."
28+
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-alpine-nginx/${br}/.github/workflows/external_trigger.yml > /dev/null 2>&1; then
29+
echo "Workflow exists. Triggering external trigger workflow for branch ${br}."
30+
curl -iX POST \
31+
-H "Authorization: token ${{ secrets.CR_PAT }}" \
32+
-H "Accept: application/vnd.github.v3+json" \
33+
-d "{\"ref\":\"refs/heads/${br}\"}" \
34+
https://api.github.com/repos/linuxserver/docker-baseimage-alpine-nginx/actions/workflows/external_trigger.yml/dispatches
35+
else
36+
echo "Workflow doesn't exist; skipping trigger."
37+
fi
38+
else
39+
echo "${br} appears to be a dev branch; skipping trigger."
40+
fi
41+
done
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Package Trigger Main
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
package-trigger-3.8:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/[email protected]
11+
12+
- name: Package Trigger
13+
if: github.ref == 'refs/heads/3.8'
14+
run: |
15+
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_BASEIMAGE_ALPINE_NGINX_3.8 }}" ]; then
16+
echo "Github secret PAUSE_PACKAGE_TRIGGER_BASEIMAGE_ALPINE_NGINX_3.8 is set; skipping trigger."
17+
exit 0
18+
fi
19+
echo "Package trigger running off of 3.8 branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_BASEIMAGE_ALPINE_NGINX_3.8\"."
20+
curl -X POST \
21+
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-alpine-nginx/job/3.8/buildWithParameters?PACKAGE_CHECK=true \
22+
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Package Trigger Scheduler
2+
3+
on:
4+
schedule:
5+
- cron: '01 6 * * 6'
6+
workflow_dispatch:
7+
8+
jobs:
9+
package-trigger-scheduler:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/[email protected]
13+
with:
14+
fetch-depth: '0'
15+
16+
- name: Package Trigger Scheduler
17+
run: |
18+
git for-each-ref --format='%(refname:short)' refs/remotes
19+
docker pull ghcr.io/linuxserver/yq
20+
for br in $(git for-each-ref --format='%(refname:short)' refs/remotes)
21+
do
22+
br=$(echo "$br" | sed 's|origin/||g')
23+
echo "Evaluating branch ${br}"
24+
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-alpine-nginx/${br}/jenkins-vars.yml \
25+
| docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch)
26+
if [ "${br}" == "${ls_branch}" ]; then
27+
echo "Branch ${br} appears to be live; triggering."
28+
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-alpine-nginx/${br}/.github/workflows/package_trigger.yml > /dev/null 2>&1; then
29+
echo "Workflow exists. Triggering package trigger workflow for branch ${br}."
30+
curl -iX POST \
31+
-H "Authorization: token ${{ secrets.CR_PAT }}" \
32+
-H "Accept: application/vnd.github.v3+json" \
33+
-d "{\"ref\":\"refs/heads/${br}\"}" \
34+
https://api.github.com/repos/linuxserver/docker-baseimage-alpine-nginx/actions/workflows/package_trigger.yml/dispatches
35+
sleep 30
36+
else
37+
echo "Workflow doesn't exist; skipping trigger."
38+
fi
39+
else
40+
echo "${br} appears to be a dev branch; skipping trigger."
41+
fi
42+
done

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM lsiobase/alpine:3.8
1+
FROM ghcr.io/linuxserver/baseimage-alpine:3.8
22

33
# install packages
44
RUN \

Dockerfile.aarch64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM lsiobase/alpine:arm64v8-3.8
1+
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.8
22

33
# install packages
44
RUN \

Dockerfile.armhf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM lsiobase/alpine:arm32v7-3.8
1+
FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.8
22

33
# install packages
44
RUN \

0 commit comments

Comments
 (0)