Skip to content

Commit 7c74f18

Browse files
committed
update workflows
1 parent 3a1ded2 commit 7c74f18

File tree

3 files changed

+25
-32
lines changed

3 files changed

+25
-32
lines changed

.github/workflows/external_trigger.yml

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,8 @@ jobs:
1717
exit 0
1818
fi
1919
echo "External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_LDAP_AUTH_MASTER\"."
20-
echo "Setting env vars"
21-
EXT_RELEASE_TYPE='pip_version'
22-
EXT_PIP='python-ldap'
23-
BUILD_VERSION_ARG='LDAP_VERSION'
24-
LS_USER='linuxserver'
25-
LS_REPO='docker-ldap-auth'
26-
CONTAINER_NAME='ldap-auth'
27-
DOCKERHUB_IMAGE='linuxserver/ldap-auth'
28-
DEV_DOCKERHUB_IMAGE='lsiodev/ldap-auth'
29-
PR_DOCKERHUB_IMAGE='lspipepr/ldap-auth'
30-
DIST_IMAGE='alpine'
31-
MULTIARCH='true'
32-
CI='true'
33-
CI_WEB='true'
34-
CI_PORT='9000'
35-
CI_SSL='false'
36-
CI_DELAY='60'
37-
CI_DOCKERENV='TZ=US/Pacific'
38-
CI_AUTH='user:password'
39-
CI_WEBPATH='/test'
4020
echo "Retrieving external version"
41-
EXT_RELEASE=$(curl -sL "https://pypi.python.org/pypi/${EXT_PIP}/json" |jq -r '. | .info.version')
21+
EXT_RELEASE=$(curl -sL "https://pypi.python.org/pypi/python-ldap/json" |jq -r '. | .info.version')
4222
if [ -z "${EXT_RELEASE}" ]; then
4323
echo "Can't retrieve external version, exiting"
4424
FAILURE_REASON="Can't retrieve external version for ldap-auth branch master"
@@ -49,19 +29,32 @@ jobs:
4929
fi
5030
echo "External version: ${EXT_RELEASE}"
5131
echo "Retrieving last pushed version"
52-
image="${LS_USER}/ldap-auth"
32+
image="linuxserver/ldap-auth"
5333
tag="latest"
54-
token=$(curl -s \
55-
"https://auth.docker.io/token?scope=repository:${image}:pull&service=registry.docker.io" \
34+
token=$(curl -sX GET \
35+
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fldap-auth%3Apull" \
5636
| jq -r '.token')
57-
digest=$(curl -s \
58-
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
59-
--header "Authorization: Bearer ${token}" \
60-
"https://registry-1.docker.io/v2/${image}/manifests/${tag}" \
61-
| jq -r '.config.digest')
37+
if [ "${MULTIARCH}" == "true" ]; then
38+
multidigest=$(curl -s \
39+
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
40+
--header "Authorization: Bearer ${token}" \
41+
"https://ghcr.io/v2/${image}/manifests/${tag}" \
42+
| jq -r 'first(.manifests[].digest)')
43+
digest=$(curl -s \
44+
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
45+
--header "Authorization: Bearer ${token}" \
46+
"https://ghcr.io/v2/${image}/manifests/${multidigest}" \
47+
| jq -r '.config.digest')
48+
else
49+
digest=$(curl -s \
50+
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
51+
--header "Authorization: Bearer ${token}" \
52+
"https://ghcr.io/v2/${image}/manifests/${tag}" \
53+
| jq -r '.config.digest')
54+
fi
6255
image_info=$(curl -sL \
6356
--header "Authorization: Bearer ${token}" \
64-
"https://registry-1.docker.io/v2/${image}/blobs/${digest}" \
57+
"https://ghcr.io/v2/${image}/blobs/${digest}" \
6558
| jq -r '.container_config')
6659
IMAGE_RELEASE=$(echo ${image_info} | jq -r '.Labels.build_version' | awk '{print $3}')
6760
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')

.github/workflows/external_trigger_scheduler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: External Trigger Scheduler
22

33
on:
44
schedule:
5-
- cron: '32 * * * *'
5+
- cron: '30 * * * *'
66
workflow_dispatch:
77

88
jobs:

.github/workflows/package_trigger_scheduler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Package Trigger Scheduler
22

33
on:
44
schedule:
5-
- cron: '52 14 * * 4'
5+
- cron: '50 11 * * 5'
66
workflow_dispatch:
77

88
jobs:

0 commit comments

Comments
 (0)