Skip to content

Commit 198eee6

Browse files
authored
Merge pull request #4 from linuxserver/nightly-dev
publish nightly tag
2 parents 523e6b1 + 6e8bee0 commit 198eee6

9 files changed

Lines changed: 105 additions & 86 deletions

File tree

.github/workflows/external_trigger.yml

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

66
jobs:
7-
external-trigger-master:
7+
external-trigger-nightly:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v2.3.3
1111

1212
- name: External Trigger
13-
if: github.ref == 'refs/heads/master'
13+
if: github.ref == 'refs/heads/nightly'
1414
run: |
15-
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_MYLAR3_MASTER }}" ]; then
16-
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_MYLAR3_MASTER is set; skipping trigger. ****"
15+
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_MYLAR3_NIGHTLY }}" ]; then
16+
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_MYLAR3_NIGHTLY 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_MYLAR3_MASTER\". ****"
19+
echo "**** External trigger running off of nightly branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_MYLAR3_NIGHTLY\". ****"
2020
echo "**** Retrieving external version ****"
21-
EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/mylar3/mylar3/releases/latest" | jq -r '. | .tag_name')
21+
EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/mylar3/mylar3/commits/python3-dev" | jq -r '. | .sha' | cut -c1-8)
2222
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
2323
echo "**** Can't retrieve external version, exiting ****"
24-
FAILURE_REASON="Can't retrieve external version for mylar3 branch master"
24+
FAILURE_REASON="Can't retrieve external version for mylar3 branch nightly"
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 }}
@@ -31,7 +31,7 @@ jobs:
3131
echo "**** External version: ${EXT_RELEASE} ****"
3232
echo "**** Retrieving last pushed version ****"
3333
image="linuxserver/mylar3"
34-
tag="latest"
34+
tag="nightly"
3535
token=$(curl -sX GET \
3636
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fmylar3%3Apull" \
3737
| jq -r '.token')
@@ -53,7 +53,7 @@ jobs:
5353
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')
5454
if [ -z "${IMAGE_VERSION}" ]; then
5555
echo "**** Can't retrieve last pushed version, exiting ****"
56-
FAILURE_REASON="Can't retrieve last pushed version for mylar3 tag latest"
56+
FAILURE_REASON="Can't retrieve last pushed version for mylar3 tag nightly"
5757
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
5858
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
5959
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
@@ -63,13 +63,13 @@ jobs:
6363
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then
6464
echo "**** Version ${EXT_RELEASE} already pushed, exiting ****"
6565
exit 0
66-
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
66+
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/nightly/lastBuild/api/json | jq -r '.building') == "true" ]; then
6767
echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****"
6868
exit 0
6969
else
7070
echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****"
7171
response=$(curl -iX POST \
72-
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/master/buildWithParameters?PACKAGE_CHECK=false \
72+
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/nightly/buildWithParameters?PACKAGE_CHECK=false \
7373
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
7474
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
7575
echo "**** Sleeping 10 seconds until job starts ****"
@@ -84,7 +84,7 @@ jobs:
8484
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
8585
--data-urlencode "Submit=Submit"
8686
echo "**** Notifying Discord ****"
87-
TRIGGER_REASON="A version change was detected for mylar3 tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
87+
TRIGGER_REASON="A version change was detected for mylar3 tag nightly. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
8888
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
8989
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
9090
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}

.github/workflows/package_trigger.yml

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

66
jobs:
7-
package-trigger-master:
7+
package-trigger-nightly:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v2.3.3
1111

1212
- name: Package Trigger
13-
if: github.ref == 'refs/heads/master'
13+
if: github.ref == 'refs/heads/nightly'
1414
run: |
15-
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_MYLAR3_MASTER }}" ]; then
16-
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_MYLAR3_MASTER is set; skipping trigger. ****"
15+
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_MYLAR3_NIGHTLY }}" ]; then
16+
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_MYLAR3_NIGHTLY is set; skipping trigger. ****"
1717
exit 0
1818
fi
19-
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
19+
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/nightly/lastBuild/api/json | jq -r '.building') == "true" ]; then
2020
echo "**** There already seems to be an active build on Jenkins; skipping package trigger ****"
2121
exit 0
2222
fi
23-
echo "**** Package trigger running off of master branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_MYLAR3_MASTER\". ****"
23+
echo "**** Package trigger running off of nightly branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_MYLAR3_NIGHTLY\". ****"
2424
response=$(curl -iX POST \
25-
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/master/buildWithParameters?PACKAGE_CHECK=true \
25+
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/nightly/buildWithParameters?PACKAGE_CHECK=true \
2626
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
2727
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
2828
echo "**** Sleeping 10 seconds until job starts ****"

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ RUN \
1313
build-base \
1414
curl \
1515
jpeg-dev \
16+
jq \
1617
libffi-dev \
1718
py3-cffi \
1819
python3-dev \
@@ -29,8 +30,8 @@ RUN \
2930
pip && \
3031
echo "**** install mylar3 ****" && \
3132
if [ -z ${MYLAR3_RELEASE+x} ]; then \
32-
MYLAR3_RELEASE=$(curl -sX GET https://api.github.com/repos/mylar3/mylar3/releases/latest \
33-
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
33+
MYLAR3_RELEASE=$(curl -sX GET https://api.github.com/repos/mylar3/mylar3/commits/python3-dev \
34+
| jq -r '.sha' | cut -c1-8); \
3435
fi && \
3536
mkdir /app/mylar3 && \
3637
curl -o \

Dockerfile.aarch64

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ RUN \
1313
build-base \
1414
curl \
1515
jpeg-dev \
16+
jq \
1617
libffi-dev \
1718
py3-cffi \
1819
python3-dev \
@@ -29,8 +30,8 @@ RUN \
2930
pip && \
3031
echo "**** install mylar3 ****" && \
3132
if [ -z ${MYLAR3_RELEASE+x} ]; then \
32-
MYLAR3_RELEASE=$(curl -sX GET https://api.github.com/repos/mylar3/mylar3/releases/latest \
33-
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
33+
MYLAR3_RELEASE=$(curl -sX GET https://api.github.com/repos/mylar3/mylar3/commits/python3-dev \
34+
| jq -r '.sha' | cut -c1-8); \
3435
fi && \
3536
mkdir /app/mylar3 && \
3637
curl -o \

Dockerfile.armhf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ RUN \
1313
build-base \
1414
curl \
1515
jpeg-dev \
16+
jq \
1617
libffi-dev \
1718
py3-cffi \
1819
python3-dev \
@@ -29,8 +30,8 @@ RUN \
2930
pip && \
3031
echo "**** install mylar3 ****" && \
3132
if [ -z ${MYLAR3_RELEASE+x} ]; then \
32-
MYLAR3_RELEASE=$(curl -sX GET https://api.github.com/repos/mylar3/mylar3/releases/latest \
33-
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
33+
MYLAR3_RELEASE=$(curl -sX GET https://api.github.com/repos/mylar3/mylar3/commits/python3-dev \
34+
| jq -r '.sha' | cut -c1-8); \
3435
fi && \
3536
mkdir /app/mylar3 && \
3637
curl -o \

0 commit comments

Comments
 (0)