17
17
exit 0
18
18
fi
19
19
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'
40
20
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')
42
22
if [ -z "${EXT_RELEASE}" ]; then
43
23
echo "Can't retrieve external version, exiting"
44
24
FAILURE_REASON="Can't retrieve external version for ldap-auth branch master"
@@ -49,19 +29,24 @@ jobs:
49
29
fi
50
30
echo "External version: ${EXT_RELEASE}"
51
31
echo "Retrieving last pushed version"
52
- image="${LS_USER} /ldap-auth"
32
+ image="linuxserver /ldap-auth"
53
33
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 " \
56
36
| 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
+ multidigest=$(curl -s \
38
+ --header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
39
+ --header "Authorization: Bearer ${token}" \
40
+ "https://ghcr.io/v2/${image}/manifests/${tag}" \
41
+ | jq -r 'first(.manifests[].digest)')
42
+ digest=$(curl -s \
43
+ --header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
44
+ --header "Authorization: Bearer ${token}" \
45
+ "https://ghcr.io/v2/${image}/manifests/${multidigest}" \
46
+ | jq -r '.config.digest')
62
47
image_info=$(curl -sL \
63
48
--header "Authorization: Bearer ${token}" \
64
- "https://registry-1.docker .io/v2/${image}/blobs/${digest}" \
49
+ "https://ghcr .io/v2/${image}/blobs/${digest}" \
65
50
| jq -r '.container_config')
66
51
IMAGE_RELEASE=$(echo ${image_info} | jq -r '.Labels.build_version' | awk '{print $3}')
67
52
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')
0 commit comments