Skip to content

Commit 14b541b

Browse files
Bot Updating Templated Files
1 parent b10abe6 commit 14b541b

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

.github/workflows/external_trigger.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ jobs:
2222
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
2323
echo "**** Can't retrieve external version, exiting ****"
2424
FAILURE_REASON="Can't retrieve external version for diskover branch master"
25+
GHA_TRIGGER_URL="https://github.com/linuxserver/docker-diskover/actions/runs/${{ github.run_id }}"
2526
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
26-
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
27+
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n**Trigger URL:** '"${GHA_TRIGGER_URL}"' \n"}],
2728
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
2829
exit 1
2930
fi

.github/workflows/greetings.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ jobs:
88
steps:
99
- uses: actions/first-interaction@v1
1010
with:
11-
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [issue template](https://github.com/linuxserver/docker-diskover/blob/master/.github/ISSUE_TEMPLATE.md)!'
11+
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [bug](https://github.com/linuxserver/docker-diskover/blob/master/.github/ISSUE_TEMPLATE/issue.bug.md) or [feature](https://github.com/linuxserver/docker-diskover/blob/master/.github/ISSUE_TEMPLATE/issue.feature.md) issue templates!'
1212
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-diskover/blob/master/.github/PULL_REQUEST_TEMPLATE.md)!'
1313
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/package_trigger_scheduler.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Package Trigger Scheduler
22

33
on:
44
schedule:
5-
- cron: '00 6 * * 6'
5+
- cron: '14 10 * * 2'
66
workflow_dispatch:
77

88
jobs:

Jenkinsfile

+18-1
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,30 @@ pipeline {
265265
fi
266266
mkdir -p ${TEMPDIR}/gitbook
267267
git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/gitbook/docker-documentation
268-
if [[ "${BRANCH_NAME}" == "master" ]] && [[ (! -f ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then
268+
if [[ ("${BRANCH_NAME}" == "master") || ("${BRANCH_NAME}" == "main") ]] && [[ (! -f ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then
269269
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md ${TEMPDIR}/gitbook/docker-documentation/images/
270270
cd ${TEMPDIR}/gitbook/docker-documentation/
271271
git add images/docker-${CONTAINER_NAME}.md
272272
git commit -m 'Bot Updating Documentation'
273273
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git --all
274274
fi
275+
mkdir -p ${TEMPDIR}/unraid
276+
git clone https://github.com/linuxserver/docker-templates.git ${TEMPDIR}/unraid/docker-templates
277+
git clone https://github.com/linuxserver/templates.git ${TEMPDIR}/unraid/templates
278+
if [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-icon.png ]]; then
279+
sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-icon.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/${CONTAINER_NAME}.xml
280+
fi
281+
if [[ ("${BRANCH_NAME}" == "master") || ("${BRANCH_NAME}" == "main") ]] && [[ (! -f ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml) || ("$(md5sum ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/${CONTAINER_NAME}.xml | awk '{ print $1 }')") ]]; then
282+
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
283+
echo "Image is on the ignore list, skipping Unraid template upload"
284+
else
285+
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
286+
cd ${TEMPDIR}/unraid/templates/
287+
git add unraid/${CONTAINER_NAME}.xml
288+
git commit -m 'Bot Updating Unraid Template'
289+
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git --all
290+
fi
291+
fi
275292
rm -Rf ${TEMPDIR}'''
276293
script{
277294
env.FILES_UPDATED = sh(

0 commit comments

Comments
 (0)