Compare commits

..

7 Commits

Author SHA1 Message Date
LinuxServer-CI
2862d4c64b Bot Updating Package Versions 2021-04-03 07:56:31 -04:00
LinuxServer-CI
9d15a99d0d Bot Updating Package Versions 2021-03-28 06:14:19 +01:00
LinuxServer-CI
3e1c6f411d Bot Updating Package Versions 2021-03-27 06:06:10 +00:00
LinuxServer-CI
727670c265 Bot Updating Package Versions 2021-03-25 17:05:45 +00:00
LinuxServer-CI
2b0dbd321b Bot Updating Package Versions 2021-03-24 20:50:54 +00:00
Roxedus
4aeb003f8f Merge pull request #117 from linuxserver/master-custom-trigger
2 stage external trigger to check for artifacts
2021-03-24 21:47:21 +01:00
aptalca
9e38503877 2 stage external trigger to check for artifacts 2021-03-24 15:48:12 -04:00
4 changed files with 44 additions and 30 deletions

View File

@@ -28,7 +28,7 @@ jobs:
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }} "username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
exit 1 exit 1
fi fi
EXT_RELEASE=$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g') EXT_RELEASE_CLEAN=$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g')
echo "**** External version: ${EXT_RELEASE} ****" echo "**** External version: ${EXT_RELEASE} ****"
echo "**** Retrieving last pushed version ****" echo "**** Retrieving last pushed version ****"
image="linuxserver/qbittorrent" image="linuxserver/qbittorrent"
@@ -61,32 +61,45 @@ jobs:
exit 1 exit 1
fi fi
echo "**** Last pushed version: ${IMAGE_VERSION} ****" echo "**** Last pushed version: ${IMAGE_VERSION} ****"
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then if [ "${EXT_RELEASE_CLEAN}" == "${IMAGE_VERSION}" ]; then
echo "**** Version ${EXT_RELEASE} already pushed, exiting ****" echo "**** Version ${EXT_RELEASE} already pushed, exiting ****"
exit 0 exit 0
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-qbittorrent/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-qbittorrent/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****" echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****"
exit 0 exit 0
else else
echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****" echo "**** New version ${EXT_RELEASE_CLEAN} found; old version was ${IMAGE_VERSION}. Checking artifacts. . . ****"
response=$(curl -iX POST \ EXT_RELEASE_STRIPPED=$(echo ${EXT_RELEASE} | sed 's|^1:||')
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-qbittorrent/job/master/buildWithParameters?PACKAGE_CHECK=false \ URL_AMD64="https://launchpad.net/~qbittorrent-team/+archive/ubuntu/qbittorrent-stable/+files/qbittorrent-nox_${EXT_RELEASE_STRIPPED}_amd64.deb"
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|") URL_ARMHF="https://launchpad.net/~qbittorrent-team/+archive/ubuntu/qbittorrent-stable/+files/qbittorrent-nox_${EXT_RELEASE_STRIPPED}_armhf.deb"
echo "**** Jenkins job queue url: ${response%$'\r'} ****" URL_ARM64="https://launchpad.net/~qbittorrent-team/+archive/ubuntu/qbittorrent-stable/+files/qbittorrent-nox_${EXT_RELEASE_STRIPPED}_arm64.deb"
echo "**** Sleeping 10 seconds until job starts ****" if curl -fL "${URL_AMD64}" >/dev/null && curl -fL "${URL_ARMHF}" >/dev/null && curl -fL "${URL_ARM64}" >/dev/null; then
sleep 10 echo "**** All artifacts seem to be published, triggering build ****"
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url') response=$(curl -iX POST \
buildurl="${buildurl%$'\r'}" https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-qbittorrent/job/master/buildWithParameters?PACKAGE_CHECK=false \
echo "**** Jenkins job build url: ${buildurl} ****" --user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
echo "**** Attempting to change the Jenkins job description ****" echo "**** Jenkins job queue url: ${response%$'\r'} ****"
curl -iX POST \ echo "**** Sleeping 10 seconds until job starts ****"
"${buildurl}submitDescription" \ sleep 10
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \ buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ buildurl="${buildurl%$'\r'}"
--data-urlencode "Submit=Submit" echo "**** Jenkins job build url: ${buildurl} ****"
echo "**** Notifying Discord ****" echo "**** Attempting to change the Jenkins job description ****"
TRIGGER_REASON="A version change was detected for qbittorrent tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}" curl -iX POST \
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903, "${buildurl}submitDescription" \
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}], --user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }} --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 qbittorrent tag latest. 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**Build URL:** '"${buildurl}display/redirect"' \n"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
else
echo "**** Not all artifacts are published yet, skipping trigger ****"
FAILURE_REASON="New version ${EXT_RELEASE} for qbittorrent tag latest is detected, however not all artifacts are uploaded to launchpad yet. Will try again in 1 hr."
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
fi
fi fi

2
Jenkinsfile vendored
View File

@@ -55,7 +55,7 @@ pipeline {
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/' env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/'
env.PULL_REQUEST = env.CHANGE_ID env.PULL_REQUEST = env.CHANGE_ID
env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE/config.yml ./.github/ISSUE_TEMPLATE/issue.bug.md ./.github/ISSUE_TEMPLATE/issue.feature.md ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/greetings.yml ./.github/workflows/stale.yml ./.github/workflows/package_trigger.yml ./.github/workflows/package_trigger_scheduler.yml ./.github/workflows/external_trigger.yml ./.github/workflows/external_trigger_scheduler.yml' env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE/config.yml ./.github/ISSUE_TEMPLATE/issue.bug.md ./.github/ISSUE_TEMPLATE/issue.feature.md ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/greetings.yml ./.github/workflows/stale.yml ./.github/workflows/package_trigger.yml ./.github/workflows/package_trigger_scheduler.yml ./.github/workflows/external_trigger_scheduler.yml'
} }
script{ script{
env.LS_RELEASE_NUMBER = sh( env.LS_RELEASE_NUMBER = sh(

View File

@@ -7,6 +7,7 @@ custom_version_command: "curl -sX GET http://ppa.launchpad.net/qbittorrent-team/
release_type: stable release_type: stable
release_tag: latest release_tag: latest
ls_branch: master ls_branch: master
custom_external_trigger: true
repo_vars: repo_vars:
- CONTAINER_NAME = 'qbittorrent' - CONTAINER_NAME = 'qbittorrent'
- BUILD_VERSION_ARG = 'QBITTORRENT_VERSION' - BUILD_VERSION_ARG = 'QBITTORRENT_VERSION'

View File

@@ -136,13 +136,13 @@ libsocket6-perl0.29-1build1
libsqlite3-03.31.1-4ubuntu0.2 libsqlite3-03.31.1-4ubuntu0.2
libss21.45.5-2ubuntu1 libss21.45.5-2ubuntu1
libssh-40.9.3-2ubuntu2.1 libssh-40.9.3-2ubuntu2.1
libssl1.11.1.1f-1ubuntu2.2 libssl1.11.1.1f-1ubuntu2.3
libstdc++610.2.0-5ubuntu1~20.04 libstdc++610.2.0-5ubuntu1~20.04
libsystemd0245.4-4ubuntu3.4 libsystemd0245.4-4ubuntu3.5
libtasn1-64.16.0-2 libtasn1-64.16.0-2
libtinfo66.2-0ubuntu2 libtinfo66.2-0ubuntu2
libtorrent-rasterbar101.2.12+git20210118.3efdb8a941-1ppa1~20.04 libtorrent-rasterbar101.2.13+git20210323.34a979720b-1ppa1~20.04
libudev1245.4-4ubuntu3.4 libudev1245.4-4ubuntu3.5
libunistring20.9.10-2 libunistring20.9.10-2
libuuid12.34-0.1ubuntu9.1 libuuid12.34-0.1ubuntu9.1
libwind0-heimdal7.7.0+dfsg-1ubuntu1 libwind0-heimdal7.7.0+dfsg-1ubuntu1
@@ -158,7 +158,7 @@ mount2.34-0.1ubuntu9.1
ncurses-base6.2-0ubuntu2 ncurses-base6.2-0ubuntu2
ncurses-bin6.2-0ubuntu2 ncurses-bin6.2-0ubuntu2
netbase6.1 netbase6.1
openssl1.1.1f-1ubuntu2.2 openssl1.1.1f-1ubuntu2.3
p7zip16.02+dfsg-7build1 p7zip16.02+dfsg-7build1
p7zip-full16.02+dfsg-7build1 p7zip-full16.02+dfsg-7build1
passwd1:4.8.1-1ubuntu5.20.04 passwd1:4.8.1-1ubuntu5.20.04
@@ -173,7 +173,7 @@ python3.83.8.5-1~20.04.2
python3.8-minimal3.8.5-1~20.04.2 python3.8-minimal3.8.5-1~20.04.2
python3-minimal3.8.2-0ubuntu2 python3-minimal3.8.2-0ubuntu2
qbittorrent-cli1.6.20334-1 qbittorrent-cli1.6.20334-1
qbittorrent-nox1:4.3.3.99~202101191832-7248-da0b276d5~ubuntu20.04.1 qbittorrent-nox1:4.3.4.99~202104031018-7348-2b6baa609~ubuntu20.04.1
qttranslations5-l10n5.12.8-0ubuntu1 qttranslations5-l10n5.12.8-0ubuntu1
readline-common8.0-4 readline-common8.0-4
sed4.7-1 sed4.7-1