custom trigger to limit builds to every 6 hrs

This commit is contained in:
aptalca
2020-11-24 14:12:20 -05:00
parent 6dae9479a8
commit f1dd47499d
2 changed files with 5 additions and 1 deletions

View File

@@ -4,7 +4,7 @@ on:
workflow_dispatch:
jobs:
external-trigger-nightly:
external-trigger-nightly-customized:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.3
@@ -65,6 +65,9 @@ jobs:
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-jellyfin/job/nightly/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 ****"
exit 0
elif [[ $(( $(date +%s%3N) - $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-jellyfin/job/nightly/lastBuild/api/json | jq -r '.timestamp') )) -lt 21600000 ]]; then
echo "**** New version ${EXT_RELEASE} found; but the last build was less than 6 hours ago; skipping trigger ****"
exit 0
else
echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****"
response=$(curl -iX POST \

View File

@@ -7,6 +7,7 @@ custom_version_command: "curl -sX GET https://repo.jellyfin.org/ubuntu/dists/foc
release_type: prerelease
release_tag: nightly
ls_branch: nightly
custom_external_trigger: true
repo_vars:
- BUILD_VERSION_ARG = 'JELLYFIN_RELEASE'
- LS_USER = 'linuxserver'