From 7c74f188bb1ae22126ffd89c5755793eba3c56e1 Mon Sep 17 00:00:00 2001 From: aptalca Date: Mon, 16 Nov 2020 12:19:23 -0500 Subject: [PATCH 1/2] update workflows --- .github/workflows/external_trigger.yml | 53 ++++++++----------- .../workflows/external_trigger_scheduler.yml | 2 +- .../workflows/package_trigger_scheduler.yml | 2 +- 3 files changed, 25 insertions(+), 32 deletions(-) diff --git a/.github/workflows/external_trigger.yml b/.github/workflows/external_trigger.yml index ecb183e..931eb77 100644 --- a/.github/workflows/external_trigger.yml +++ b/.github/workflows/external_trigger.yml @@ -17,28 +17,8 @@ jobs: exit 0 fi echo "External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_LDAP_AUTH_MASTER\"." - echo "Setting env vars" - EXT_RELEASE_TYPE='pip_version' - EXT_PIP='python-ldap' - BUILD_VERSION_ARG='LDAP_VERSION' - LS_USER='linuxserver' - LS_REPO='docker-ldap-auth' - CONTAINER_NAME='ldap-auth' - DOCKERHUB_IMAGE='linuxserver/ldap-auth' - DEV_DOCKERHUB_IMAGE='lsiodev/ldap-auth' - PR_DOCKERHUB_IMAGE='lspipepr/ldap-auth' - DIST_IMAGE='alpine' - MULTIARCH='true' - CI='true' - CI_WEB='true' - CI_PORT='9000' - CI_SSL='false' - CI_DELAY='60' - CI_DOCKERENV='TZ=US/Pacific' - CI_AUTH='user:password' - CI_WEBPATH='/test' echo "Retrieving external version" - EXT_RELEASE=$(curl -sL "https://pypi.python.org/pypi/${EXT_PIP}/json" |jq -r '. | .info.version') + EXT_RELEASE=$(curl -sL "https://pypi.python.org/pypi/python-ldap/json" |jq -r '. | .info.version') if [ -z "${EXT_RELEASE}" ]; then echo "Can't retrieve external version, exiting" FAILURE_REASON="Can't retrieve external version for ldap-auth branch master" @@ -49,19 +29,32 @@ jobs: fi echo "External version: ${EXT_RELEASE}" echo "Retrieving last pushed version" - image="${LS_USER}/ldap-auth" + image="linuxserver/ldap-auth" tag="latest" - token=$(curl -s \ - "https://auth.docker.io/token?scope=repository:${image}:pull&service=registry.docker.io" \ + token=$(curl -sX GET \ + "https://ghcr.io/token?scope=repository%3Alinuxserver%2Fldap-auth%3Apull" \ | jq -r '.token') - digest=$(curl -s \ - --header "Accept: application/vnd.docker.distribution.manifest.v2+json" \ - --header "Authorization: Bearer ${token}" \ - "https://registry-1.docker.io/v2/${image}/manifests/${tag}" \ - | jq -r '.config.digest') + if [ "${MULTIARCH}" == "true" ]; then + multidigest=$(curl -s \ + --header "Accept: application/vnd.docker.distribution.manifest.v2+json" \ + --header "Authorization: Bearer ${token}" \ + "https://ghcr.io/v2/${image}/manifests/${tag}" \ + | jq -r 'first(.manifests[].digest)') + digest=$(curl -s \ + --header "Accept: application/vnd.docker.distribution.manifest.v2+json" \ + --header "Authorization: Bearer ${token}" \ + "https://ghcr.io/v2/${image}/manifests/${multidigest}" \ + | jq -r '.config.digest') + else + digest=$(curl -s \ + --header "Accept: application/vnd.docker.distribution.manifest.v2+json" \ + --header "Authorization: Bearer ${token}" \ + "https://ghcr.io/v2/${image}/manifests/${tag}" \ + | jq -r '.config.digest') + fi image_info=$(curl -sL \ --header "Authorization: Bearer ${token}" \ - "https://registry-1.docker.io/v2/${image}/blobs/${digest}" \ + "https://ghcr.io/v2/${image}/blobs/${digest}" \ | jq -r '.container_config') IMAGE_RELEASE=$(echo ${image_info} | jq -r '.Labels.build_version' | awk '{print $3}') IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}') diff --git a/.github/workflows/external_trigger_scheduler.yml b/.github/workflows/external_trigger_scheduler.yml index 8c699d5..9d902f0 100644 --- a/.github/workflows/external_trigger_scheduler.yml +++ b/.github/workflows/external_trigger_scheduler.yml @@ -2,7 +2,7 @@ name: External Trigger Scheduler on: schedule: - - cron: '32 * * * *' + - cron: '30 * * * *' workflow_dispatch: jobs: diff --git a/.github/workflows/package_trigger_scheduler.yml b/.github/workflows/package_trigger_scheduler.yml index 2cb17dd..55363f8 100644 --- a/.github/workflows/package_trigger_scheduler.yml +++ b/.github/workflows/package_trigger_scheduler.yml @@ -2,7 +2,7 @@ name: Package Trigger Scheduler on: schedule: - - cron: '52 14 * * 4' + - cron: '50 11 * * 5' workflow_dispatch: jobs: From 1e05e63a9ff94d82fcaeac8f0413b87b3019ca7a Mon Sep 17 00:00:00 2001 From: aptalca Date: Mon, 16 Nov 2020 12:35:59 -0500 Subject: [PATCH 2/2] fix multi-arch external trigger --- .github/workflows/external_trigger.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/external_trigger.yml b/.github/workflows/external_trigger.yml index 931eb77..c827abd 100644 --- a/.github/workflows/external_trigger.yml +++ b/.github/workflows/external_trigger.yml @@ -34,7 +34,6 @@ jobs: token=$(curl -sX GET \ "https://ghcr.io/token?scope=repository%3Alinuxserver%2Fldap-auth%3Apull" \ | jq -r '.token') - if [ "${MULTIARCH}" == "true" ]; then multidigest=$(curl -s \ --header "Accept: application/vnd.docker.distribution.manifest.v2+json" \ --header "Authorization: Bearer ${token}" \ @@ -45,13 +44,6 @@ jobs: --header "Authorization: Bearer ${token}" \ "https://ghcr.io/v2/${image}/manifests/${multidigest}" \ | jq -r '.config.digest') - else - digest=$(curl -s \ - --header "Accept: application/vnd.docker.distribution.manifest.v2+json" \ - --header "Authorization: Bearer ${token}" \ - "https://ghcr.io/v2/${image}/manifests/${tag}" \ - | jq -r '.config.digest') - fi image_info=$(curl -sL \ --header "Authorization: Bearer ${token}" \ "https://ghcr.io/v2/${image}/blobs/${digest}" \