mirror of
https://github.com/linuxserver/docker-lidarr.git
synced 2026-02-20 01:02:41 +08:00
Merge pull request #46 from hotio/nightly
Update url to new servarr domain [nightly]
This commit is contained in:
commit
3cadb79521
44
.github/workflows/external_trigger.yml
vendored
44
.github/workflows/external_trigger.yml
vendored
@ -13,22 +13,22 @@ jobs:
|
||||
if: github.ref == 'refs/heads/nightly'
|
||||
run: |
|
||||
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_LIDARR_NIGHTLY }}" ]; then
|
||||
echo "Github secret PAUSE_EXTERNAL_TRIGGER_LIDARR_NIGHTLY is set; skipping trigger."
|
||||
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_LIDARR_NIGHTLY is set; skipping trigger. ****"
|
||||
exit 0
|
||||
fi
|
||||
echo "External trigger running off of nightly branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_LIDARR_NIGHTLY\"."
|
||||
echo "Retrieving external version"
|
||||
EXT_RELEASE=$(curl -s "https://services.lidarr.audio/v1/update/nightly/changes?os" | jq -r ". | .[0].version")
|
||||
if [ -z "${EXT_RELEASE}" ]; then
|
||||
echo "Can't retrieve external version, exiting"
|
||||
echo "**** External trigger running off of nightly branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_LIDARR_NIGHTLY\". ****"
|
||||
echo "**** Retrieving external version ****"
|
||||
EXT_RELEASE=$(curl -s "https://lidarr.servarr.com/v1/update/nightly/changes?os" | jq -r ". | .[0].version")
|
||||
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
|
||||
echo "**** Can't retrieve external version, exiting ****"
|
||||
FAILURE_REASON="Can't retrieve external version for lidarr branch nightly"
|
||||
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
|
||||
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
|
||||
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
|
||||
exit 1
|
||||
fi
|
||||
echo "External version: ${EXT_RELEASE}"
|
||||
echo "Retrieving last pushed version"
|
||||
echo "**** External version: ${EXT_RELEASE} ****"
|
||||
echo "**** Retrieving last pushed version ****"
|
||||
image="linuxserver/lidarr"
|
||||
tag="nightly"
|
||||
token=$(curl -sX GET \
|
||||
@ -51,25 +51,37 @@ jobs:
|
||||
IMAGE_RELEASE=$(echo ${image_info} | jq -r '.Labels.build_version' | awk '{print $3}')
|
||||
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')
|
||||
if [ -z "${IMAGE_VERSION}" ]; then
|
||||
echo "Can't retrieve last pushed version, exiting"
|
||||
echo "**** Can't retrieve last pushed version, exiting ****"
|
||||
FAILURE_REASON="Can't retrieve last pushed version for lidarr tag nightly"
|
||||
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
|
||||
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
|
||||
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
|
||||
exit 1
|
||||
fi
|
||||
echo "Last pushed version: ${IMAGE_VERSION}"
|
||||
echo "**** Last pushed version: ${IMAGE_VERSION} ****"
|
||||
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then
|
||||
echo "Version ${EXT_RELEASE} already pushed, exiting"
|
||||
echo "**** Version ${EXT_RELEASE} already pushed, exiting ****"
|
||||
exit 0
|
||||
else
|
||||
echo "New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build"
|
||||
curl -X POST \
|
||||
echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****"
|
||||
response=$(curl -iX POST \
|
||||
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-lidarr/job/nightly/buildWithParameters?PACKAGE_CHECK=false \
|
||||
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }}
|
||||
echo "Notifying Discord"
|
||||
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
|
||||
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
|
||||
echo "**** Sleeping 10 seconds until job starts ****"
|
||||
sleep 10
|
||||
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
|
||||
buildurl="${buildurl%$'\r'}"
|
||||
echo "**** Jenkins job build url: ${buildurl} ****"
|
||||
echo "**** Attempting to change the Jenkins job description ****"
|
||||
curl -iX POST \
|
||||
"${buildurl}submitDescription" \
|
||||
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
|
||||
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
||||
--data-urlencode "Submit=Submit"
|
||||
echo "**** Notifying Discord ****"
|
||||
TRIGGER_REASON="A version change was detected for lidarr tag nightly. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
|
||||
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
|
||||
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n"}],
|
||||
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
|
||||
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
|
||||
fi
|
||||
|
||||
12
.github/workflows/external_trigger_scheduler.yml
vendored
12
.github/workflows/external_trigger_scheduler.yml
vendored
@ -15,27 +15,29 @@ jobs:
|
||||
|
||||
- name: External Trigger Scheduler
|
||||
run: |
|
||||
echo "**** Branches found: ****"
|
||||
git for-each-ref --format='%(refname:short)' refs/remotes
|
||||
echo "**** Pulling the yq docker image ****"
|
||||
docker pull ghcr.io/linuxserver/yq
|
||||
for br in $(git for-each-ref --format='%(refname:short)' refs/remotes)
|
||||
do
|
||||
br=$(echo "$br" | sed 's|origin/||g')
|
||||
echo "Evaluating branch ${br}"
|
||||
echo "**** Evaluating branch ${br} ****"
|
||||
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-lidarr/${br}/jenkins-vars.yml \
|
||||
| docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch)
|
||||
if [ "$br" == "$ls_branch" ]; then
|
||||
echo "${br} is a live branch, checking workflow."
|
||||
echo "**** Branch ${br} appears to be live; checking workflow. ****"
|
||||
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-lidarr/${br}/.github/workflows/external_trigger.yml > /dev/null 2>&1; then
|
||||
echo "Workflow exists. Triggering external trigger workflow for branch ${br}."
|
||||
echo "**** Workflow exists. Triggering external trigger workflow for branch ${br} ****."
|
||||
curl -iX POST \
|
||||
-H "Authorization: token ${{ secrets.CR_PAT }}" \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
-d "{\"ref\":\"refs/heads/${br}\"}" \
|
||||
https://api.github.com/repos/linuxserver/docker-lidarr/actions/workflows/external_trigger.yml/dispatches
|
||||
else
|
||||
echo "Workflow doesn't exist; skipping trigger."
|
||||
echo "**** Workflow doesn't exist; skipping trigger. ****"
|
||||
fi
|
||||
else
|
||||
echo "${br} appears to be a dev branch; skipping trigger."
|
||||
echo "**** ${br} appears to be a dev branch; skipping trigger. ****"
|
||||
fi
|
||||
done
|
||||
|
||||
20
.github/workflows/package_trigger.yml
vendored
20
.github/workflows/package_trigger.yml
vendored
@ -13,10 +13,22 @@ jobs:
|
||||
if: github.ref == 'refs/heads/nightly'
|
||||
run: |
|
||||
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_LIDARR_NIGHTLY }}" ]; then
|
||||
echo "Github secret PAUSE_PACKAGE_TRIGGER_LIDARR_NIGHTLY is set; skipping trigger."
|
||||
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_LIDARR_NIGHTLY is set; skipping trigger. ****"
|
||||
exit 0
|
||||
fi
|
||||
echo "Package trigger running off of nightly branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_LIDARR_NIGHTLY\"."
|
||||
curl -X POST \
|
||||
echo "**** Package trigger running off of nightly branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_LIDARR_NIGHTLY\". ****"
|
||||
response=$(curl -iX POST \
|
||||
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-lidarr/job/nightly/buildWithParameters?PACKAGE_CHECK=true \
|
||||
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }}
|
||||
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
|
||||
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
|
||||
echo "**** Sleeping 10 seconds until job starts ****"
|
||||
sleep 10
|
||||
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
|
||||
buildurl="${buildurl%$'\r'}"
|
||||
echo "**** Jenkins job build url: ${buildurl} ****"
|
||||
echo "**** Attempting to change the Jenkins job description ****"
|
||||
curl -iX POST \
|
||||
"${buildurl}submitDescription" \
|
||||
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
|
||||
--data-urlencode "description=GHA package trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
||||
--data-urlencode "Submit=Submit"
|
||||
|
||||
18
.github/workflows/package_trigger_scheduler.yml
vendored
18
.github/workflows/package_trigger_scheduler.yml
vendored
@ -15,18 +15,21 @@ jobs:
|
||||
|
||||
- name: Package Trigger Scheduler
|
||||
run: |
|
||||
echo "**** Branches found: ****"
|
||||
git for-each-ref --format='%(refname:short)' refs/remotes
|
||||
echo "**** Pulling the yq docker image ****"
|
||||
docker pull ghcr.io/linuxserver/yq
|
||||
for br in $(git for-each-ref --format='%(refname:short)' refs/remotes)
|
||||
do
|
||||
br=$(echo "$br" | sed 's|origin/||g')
|
||||
echo "Evaluating branch ${br}"
|
||||
echo "**** Evaluating branch ${br} ****"
|
||||
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-lidarr/${br}/jenkins-vars.yml \
|
||||
| docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch)
|
||||
if [ "${br}" == "${ls_branch}" ]; then
|
||||
echo "Branch ${br} appears to be live; triggering."
|
||||
echo "**** Branch ${br} appears to be live; checking workflow. ****"
|
||||
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-lidarr/${br}/.github/workflows/package_trigger.yml > /dev/null 2>&1; then
|
||||
echo "Workflow exists. Triggering package trigger workflow for branch ${br}."
|
||||
echo "**** Workflow exists. Triggering package trigger workflow for branch ${br}. ****"
|
||||
triggered_branches="${triggered_branches}${br} "
|
||||
curl -iX POST \
|
||||
-H "Authorization: token ${{ secrets.CR_PAT }}" \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
@ -34,9 +37,14 @@ jobs:
|
||||
https://api.github.com/repos/linuxserver/docker-lidarr/actions/workflows/package_trigger.yml/dispatches
|
||||
sleep 30
|
||||
else
|
||||
echo "Workflow doesn't exist; skipping trigger."
|
||||
echo "**** Workflow doesn't exist; skipping trigger. ****"
|
||||
fi
|
||||
else
|
||||
echo "${br} appears to be a dev branch; skipping trigger."
|
||||
echo "**** ${br} appears to be a dev branch; skipping trigger. ****"
|
||||
fi
|
||||
done
|
||||
echo "**** Package check build(s) triggered for branch(es): ${triggered_branches} ****"
|
||||
echo "**** Notifying Discord ****"
|
||||
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
|
||||
"description": "**Package Check Build(s) Triggered** \n**Branch(es):** '"${triggered_branches}"' \n**Build URL:** '"https://ci.linuxserver.io/blue/organizations/jenkins/Docker-Pipeline-Builders%2Fdocker-lidarr/activity/"' \n"}],
|
||||
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
|
||||
|
||||
@ -21,12 +21,12 @@ RUN \
|
||||
echo "**** install lidarr ****" && \
|
||||
mkdir -p /app/lidarr/bin && \
|
||||
if [ -z ${LIDARR_RELEASE+x} ]; then \
|
||||
LIDARR_RELEASE=$(curl -sL "https://services.lidarr.audio/v1/update/${LIDARR_BRANCH}/changes?os=linux" \
|
||||
LIDARR_RELEASE=$(curl -sL "https://lidarr.servarr.com/v1/update/${LIDARR_BRANCH}/changes?os=linux" \
|
||||
| jq -r '.[0].version'); \
|
||||
fi && \
|
||||
curl -o \
|
||||
/tmp/lidarr.tar.gz -L \
|
||||
"https://services.lidarr.audio/v1/update/${LIDARR_BRANCH}/updatefile?version=${LIDARR_RELEASE}&os=linux&runtime=netcore&arch=x64" && \
|
||||
"https://lidarr.servarr.com/v1/update/${LIDARR_BRANCH}/updatefile?version=${LIDARR_RELEASE}&os=linux&runtime=netcore&arch=x64" && \
|
||||
tar ixzf \
|
||||
/tmp/lidarr.tar.gz -C \
|
||||
/app/lidarr/bin --strip-components=1 && \
|
||||
|
||||
@ -21,12 +21,12 @@ RUN \
|
||||
echo "**** install lidarr ****" && \
|
||||
mkdir -p /app/lidarr/bin && \
|
||||
if [ -z ${LIDARR_RELEASE+x} ]; then \
|
||||
LIDARR_RELEASE=$(curl -sL "https://services.lidarr.audio/v1/update/${LIDARR_BRANCH}/changes?os=linux" \
|
||||
LIDARR_RELEASE=$(curl -sL "https://lidarr.servarr.com/v1/update/${LIDARR_BRANCH}/changes?os=linux" \
|
||||
| jq -r '.[0].version'); \
|
||||
fi && \
|
||||
curl -o \
|
||||
/tmp/lidarr.tar.gz -L \
|
||||
"https://services.lidarr.audio/v1/update/${LIDARR_BRANCH}/updatefile?version=${LIDARR_RELEASE}&os=linux&runtime=netcore&arch=arm64" && \
|
||||
"https://lidarr.servarr.com/v1/update/${LIDARR_BRANCH}/updatefile?version=${LIDARR_RELEASE}&os=linux&runtime=netcore&arch=arm64" && \
|
||||
tar ixzf \
|
||||
/tmp/lidarr.tar.gz -C \
|
||||
/app/lidarr/bin --strip-components=1 && \
|
||||
|
||||
@ -21,12 +21,12 @@ RUN \
|
||||
echo "**** install lidarr ****" && \
|
||||
mkdir -p /app/lidarr/bin && \
|
||||
if [ -z ${LIDARR_RELEASE+x} ]; then \
|
||||
LIDARR_RELEASE=$(curl -sL "https://services.lidarr.audio/v1/update/${LIDARR_BRANCH}/changes?os=linux" \
|
||||
LIDARR_RELEASE=$(curl -sL "https://lidarr.servarr.com/v1/update/${LIDARR_BRANCH}/changes?os=linux" \
|
||||
| jq -r '.[0].version'); \
|
||||
fi && \
|
||||
curl -o \
|
||||
/tmp/lidarr.tar.gz -L \
|
||||
"https://services.lidarr.audio/v1/update/${LIDARR_BRANCH}/updatefile?version=${LIDARR_RELEASE}&os=linux&runtime=netcore&arch=arm" && \
|
||||
"https://lidarr.servarr.com/v1/update/${LIDARR_BRANCH}/updatefile?version=${LIDARR_RELEASE}&os=linux&runtime=netcore&arch=arm" && \
|
||||
tar ixzf \
|
||||
/tmp/lidarr.tar.gz -C \
|
||||
/app/lidarr/bin --strip-components=1 && \
|
||||
|
||||
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@ -16,7 +16,7 @@ pipeline {
|
||||
GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab')
|
||||
GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0')
|
||||
GITLAB_NAMESPACE=credentials('gitlab-namespace-id')
|
||||
JSON_URL = 'https://services.lidarr.audio/v1/update/nightly/changes?os=linux'
|
||||
JSON_URL = 'https://lidarr.servarr.com/v1/update/nightly/changes?os=linux'
|
||||
JSON_PATH = '.[0].version'
|
||||
BUILD_VERSION_ARG = 'LIDARR_RELEASE'
|
||||
LS_USER = 'linuxserver'
|
||||
|
||||
@ -7,7 +7,7 @@ release_type: prerelease
|
||||
release_tag: nightly
|
||||
ls_branch: nightly
|
||||
repo_vars:
|
||||
- JSON_URL = 'https://services.lidarr.audio/v1/update/nightly/changes?os=linux'
|
||||
- JSON_URL = 'https://lidarr.servarr.com/v1/update/nightly/changes?os=linux'
|
||||
- JSON_PATH = '.[0].version'
|
||||
- BUILD_VERSION_ARG = 'LIDARR_RELEASE'
|
||||
- LS_USER = 'linuxserver'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user