Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 2c1e8bc

Browse files
authored
Merge pull request #45 from linuxserver/update-main
2 parents 7f7eb64 + 5b01bec commit 2c1e8bc

13 files changed

Lines changed: 464 additions & 264 deletions

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ docker build \
105105
-t linuxserver/readarr:latest .
106106
```
107107

108-
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
108+
The ARM variants can be built on x86_64 hardware and vice versa using `lscr.io/linuxserver/qemu-static`
109109

110110
```bash
111-
docker run --rm --privileged multiarch/qemu-user-static:register --reset
111+
docker run --rm --privileged lscr.io/linuxserver/qemu-static --reset
112112
```
113113

114114
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.
Lines changed: 75 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,76 @@
1-
---
1+
# Based on the issue template
22
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 readarr" -->
3+
description: Create a report to help us improve
4+
title: "[BUG] <title>"
5+
labels: [Bug]
6+
body:
7+
- type: checkboxes
8+
attributes:
9+
label: Is there an existing issue for this?
10+
description: Please search to see if an issue already exists for the bug you encountered.
11+
options:
12+
- label: I have searched the existing issues
13+
required: true
14+
- type: textarea
15+
attributes:
16+
label: Current Behavior
17+
description: Tell us what happens instead of the expected behavior.
18+
validations:
19+
required: true
20+
- type: textarea
21+
attributes:
22+
label: Expected Behavior
23+
description: Tell us what should happen.
24+
validations:
25+
required: false
26+
- type: textarea
27+
attributes:
28+
label: Steps To Reproduce
29+
description: Steps to reproduce the behavior.
30+
placeholder: |
31+
1. In this environment...
32+
2. With this config...
33+
3. Run '...'
34+
4. See error...
35+
validations:
36+
required: true
37+
- type: textarea
38+
attributes:
39+
label: Environment
40+
description: |
41+
examples:
42+
- **OS**: Ubuntu 20.04
43+
- **How docker service was installed**: distro's packagemanager
44+
value: |
45+
- OS:
46+
- How docker service was installed:
47+
render: markdown
48+
validations:
49+
required: false
50+
- type: dropdown
51+
attributes:
52+
label: CPU architecture
53+
options:
54+
- x86-64
55+
- arm64
56+
validations:
57+
required: true
58+
- type: textarea
59+
attributes:
60+
label: Docker creation
61+
description: |
62+
Command used to create docker container
63+
Provide your docker create/run command or compose yaml snippet, or a screenshot of settings if using a gui to create the container
64+
render: bash
65+
validations:
66+
required: true
67+
- type: textarea
68+
attributes:
69+
description: |
70+
Provide a full docker log, output of "docker logs readarr"
71+
label: Container logs
72+
placeholder: |
73+
Output of `docker logs readarr`
74+
render: bash
75+
validations:
76+
required: true
Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
1-
---
1+
# Based on the issue template
22
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 -->
3+
description: Suggest an idea for this project
4+
title: "[FEAT] <title>"
5+
labels: [enhancement]
6+
body:
7+
- type: checkboxes
8+
attributes:
9+
label: Is this a new feature request?
10+
description: Please search to see if a feature request already exists.
11+
options:
12+
- label: I have searched the existing issues
13+
required: true
14+
- type: textarea
15+
attributes:
16+
label: Wanted change
17+
description: Tell us what you want to happen.
18+
validations:
19+
required: true
20+
- type: textarea
21+
attributes:
22+
label: Reason for change
23+
description: Justify your request, why do you want it, what is the benefit.
24+
validations:
25+
required: true
26+
- type: textarea
27+
attributes:
28+
label: Proposed code change
29+
description: Do you have a potential code change in mind?
30+
validations:
31+
required: false
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Issue & PR Tracker
2+
3+
on:
4+
issues:
5+
types: [opened,reopened,labeled,unlabeled,closed]
6+
pull_request_target:
7+
types: [opened,reopened,review_requested,review_request_removed,labeled,unlabeled,closed]
8+
pull_request_review:
9+
types: [submitted,edited,dismissed]
10+
11+
jobs:
12+
manage-project:
13+
permissions:
14+
issues: write
15+
uses: linuxserver/github-workflows/.github/workflows/issue-pr-tracker.yml@v1
16+
secrets: inherit
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Mark stale issues and pull requests
2+
on:
3+
schedule:
4+
- cron: '58 22 * * *'
5+
workflow_dispatch:
6+
7+
jobs:
8+
stale:
9+
permissions:
10+
issues: write
11+
pull-requests: write
12+
uses: linuxserver/github-workflows/.github/workflows/issues-cron.yml@v1
13+
secrets: inherit

.github/workflows/external_trigger.yml

Lines changed: 90 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,27 @@ jobs:
77
external-trigger-main:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2.3.3
10+
- uses: actions/checkout@v4.1.1
1111

1212
- name: External Trigger
1313
if: github.ref == 'refs/heads/main'
14+
env:
15+
SKIP_EXTERNAL_TRIGGER: ${{ vars.SKIP_EXTERNAL_TRIGGER }}
1416
run: |
15-
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_READARR_MAIN }}" ]; then
16-
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_READARR_MAIN is set; skipping trigger. ****"
17+
printf "# External trigger for docker-readarr\n\n" >> $GITHUB_STEP_SUMMARY
18+
if grep -q "^readarr_main" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
19+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
20+
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` contains \`readarr_main\`; skipping trigger." >> $GITHUB_STEP_SUMMARY
1721
exit 0
1822
fi
19-
echo "**** External trigger running off of main branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_READARR_MAIN\". ****"
20-
echo "**** Retrieving external version ****"
21-
EXT_RELEASE=$(curl -sL https://readarr.servarr.com/v1/update/nightly/changes?runtime=netcore%26os=linux | jq -r '.[0].version')
23+
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
24+
echo "> External trigger running off of main branch. To disable this trigger, add \`readarr_main\` into the Github organizational variable \`SKIP_EXTERNAL_TRIGGER\`." >> $GITHUB_STEP_SUMMARY
25+
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY
26+
EXT_RELEASE=$(curl -sL https://readarr.servarr.com/v1/update/main/changes?runtime=netcore%26os=linuxmusl | jq -r '.[0].version')
27+
echo "Type is \`custom_version_command\`" >> $GITHUB_STEP_SUMMARY
2228
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
23-
echo "**** Can't retrieve external version, exiting ****"
29+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
30+
echo "> Can't retrieve external version, exiting" >> $GITHUB_STEP_SUMMARY
2431
FAILURE_REASON="Can't retrieve external version for readarr branch main"
2532
GHA_TRIGGER_URL="https://github.com/linuxserver/docker-readarr/actions/runs/${{ github.run_id }}"
2633
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
@@ -29,64 +36,101 @@ jobs:
2936
exit 1
3037
fi
3138
EXT_RELEASE=$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g')
32-
echo "**** External version: ${EXT_RELEASE} ****"
33-
echo "**** Retrieving last pushed version ****"
39+
echo "External version: \`${EXT_RELEASE}\`" >> $GITHUB_STEP_SUMMARY
40+
echo "Retrieving last pushed version" >> $GITHUB_STEP_SUMMARY
3441
image="linuxserver/readarr"
35-
tag="main"
42+
tag="latest"
3643
token=$(curl -sX GET \
3744
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Freadarr%3Apull" \
3845
| jq -r '.token')
39-
multidigest=$(curl -s \
40-
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
41-
--header "Authorization: Bearer ${token}" \
42-
"https://ghcr.io/v2/${image}/manifests/${tag}" \
43-
| jq -r 'first(.manifests[].digest)')
44-
digest=$(curl -s \
46+
multidigest=$(curl -s \
47+
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
48+
--header "Accept: application/vnd.oci.image.index.v1+json" \
49+
--header "Authorization: Bearer ${token}" \
50+
"https://ghcr.io/v2/${image}/manifests/${tag}")
51+
if jq -e '.layers // empty' <<< "${multidigest}" >/dev/null 2>&1; then
52+
# If there's a layer element it's a single-arch manifest so just get that digest
53+
digest=$(jq -r '.config.digest' <<< "${multidigest}")
54+
else
55+
# Otherwise it's multi-arch or has manifest annotations
56+
if jq -e '.manifests[]?.annotations // empty' <<< "${multidigest}" >/dev/null 2>&1; then
57+
# Check for manifest annotations and delete if found
58+
multidigest=$(jq 'del(.manifests[] | select(.annotations))' <<< "${multidigest}")
59+
fi
60+
if [[ $(jq '.manifests | length' <<< "${multidigest}") -gt 1 ]]; then
61+
# If there's still more than one digest, it's multi-arch
62+
multidigest=$(jq -r ".manifests[] | select(.platform.architecture == \"amd64\").digest?" <<< "${multidigest}")
63+
else
64+
# Otherwise it's single arch
65+
multidigest=$(jq -r ".manifests[].digest?" <<< "${multidigest}")
66+
fi
67+
if digest=$(curl -s \
4568
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
69+
--header "Accept: application/vnd.oci.image.manifest.v1+json" \
4670
--header "Authorization: Bearer ${token}" \
47-
"https://ghcr.io/v2/${image}/manifests/${multidigest}" \
48-
| jq -r '.config.digest')
71+
"https://ghcr.io/v2/${image}/manifests/${multidigest}"); then
72+
digest=$(jq -r '.config.digest' <<< "${digest}");
73+
fi
74+
fi
4975
image_info=$(curl -sL \
5076
--header "Authorization: Bearer ${token}" \
51-
"https://ghcr.io/v2/${image}/blobs/${digest}" \
52-
| jq -r '.container_config')
77+
"https://ghcr.io/v2/${image}/blobs/${digest}")
78+
if [[ $(echo $image_info | jq -r '.container_config') == "null" ]]; then
79+
image_info=$(echo $image_info | jq -r '.config')
80+
else
81+
image_info=$(echo $image_info | jq -r '.container_config')
82+
fi
5383
IMAGE_RELEASE=$(echo ${image_info} | jq -r '.Labels.build_version' | awk '{print $3}')
5484
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')
5585
if [ -z "${IMAGE_VERSION}" ]; then
56-
echo "**** Can't retrieve last pushed version, exiting ****"
57-
FAILURE_REASON="Can't retrieve last pushed version for readarr tag main"
86+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
87+
echo "Can't retrieve last pushed version, exiting" >> $GITHUB_STEP_SUMMARY
88+
FAILURE_REASON="Can't retrieve last pushed version for readarr tag latest"
5889
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
5990
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
6091
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
6192
exit 1
6293
fi
63-
echo "**** Last pushed version: ${IMAGE_VERSION} ****"
94+
echo "Last pushed version: \`${IMAGE_VERSION}\`" >> $GITHUB_STEP_SUMMARY
6495
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then
65-
echo "**** Version ${EXT_RELEASE} already pushed, exiting ****"
96+
echo "Version \`${EXT_RELEASE}\` already pushed, exiting" >> $GITHUB_STEP_SUMMARY
6697
exit 0
6798
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-readarr/job/main/lastBuild/api/json | jq -r '.building') == "true" ]; then
68-
echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****"
99+
echo "New version \`${EXT_RELEASE}\` found; but there already seems to be an active build on Jenkins; exiting" >> $GITHUB_STEP_SUMMARY
69100
exit 0
70101
else
71-
echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****"
72-
response=$(curl -iX POST \
73-
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-readarr/job/main/buildWithParameters?PACKAGE_CHECK=false \
74-
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
75-
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
76-
echo "**** Sleeping 10 seconds until job starts ****"
77-
sleep 10
78-
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
79-
buildurl="${buildurl%$'\r'}"
80-
echo "**** Jenkins job build url: ${buildurl} ****"
81-
echo "**** Attempting to change the Jenkins job description ****"
82-
curl -iX POST \
83-
"${buildurl}submitDescription" \
84-
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
85-
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
86-
--data-urlencode "Submit=Submit"
87-
echo "**** Notifying Discord ****"
88-
TRIGGER_REASON="A version change was detected for readarr tag main. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
89-
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
90-
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
91-
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
102+
if [[ "${artifacts_found}" == "false" ]]; then
103+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
104+
echo "> New version detected, but not all artifacts are published yet; skipping trigger" >> $GITHUB_STEP_SUMMARY
105+
FAILURE_REASON="New version ${EXT_RELEASE} for readarr tag latest is detected, however not all artifacts are uploaded to upstream release yet. Will try again later."
106+
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
107+
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
108+
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
109+
else
110+
printf "\n## Trigger new build\n\n" >> $GITHUB_STEP_SUMMARY
111+
echo "New version \`${EXT_RELEASE}\` found; old version was \`${IMAGE_VERSION}\`. Triggering new build" >> $GITHUB_STEP_SUMMARY
112+
if [[ "${artifacts_found}" == "true" ]]; then
113+
echo "All artifacts seem to be uploaded." >> $GITHUB_STEP_SUMMARY
114+
fi
115+
response=$(curl -iX POST \
116+
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-readarr/job/main/buildWithParameters?PACKAGE_CHECK=false \
117+
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
118+
echo "Jenkins [job queue url](${response%$'\r'})" >> $GITHUB_STEP_SUMMARY
119+
echo "Sleeping 10 seconds until job starts" >> $GITHUB_STEP_SUMMARY
120+
sleep 10
121+
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
122+
buildurl="${buildurl%$'\r'}"
123+
echo "Jenkins job [build url](${buildurl})" >> $GITHUB_STEP_SUMMARY
124+
echo "Attempting to change the Jenkins job description" >> $GITHUB_STEP_SUMMARY
125+
curl -iX POST \
126+
"${buildurl}submitDescription" \
127+
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
128+
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
129+
--data-urlencode "Submit=Submit"
130+
echo "**** Notifying Discord ****"
131+
TRIGGER_REASON="A version change was detected for readarr tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
132+
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
133+
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
134+
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
135+
fi
92136
fi

0 commit comments

Comments
 (0)