Merge pull request #38 from linuxserver/workflows4

update workflows
This commit is contained in:
Eric Nemchik 2020-11-16 18:38:03 -06:00 committed by GitHub
commit a7a4e647ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 32 deletions

View File

@ -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,24 @@ 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')
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')
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}')

View File

@ -2,7 +2,7 @@ name: External Trigger Scheduler
on:
schedule:
- cron: '32 * * * *'
- cron: '30 * * * *'
workflow_dispatch:
jobs:

View File

@ -2,7 +2,7 @@ name: Package Trigger Scheduler
on:
schedule:
- cron: '52 14 * * 4'
- cron: '50 11 * * 5'
workflow_dispatch:
jobs: