File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -9,16 +9,13 @@ AUTH=$(grep X-Forwarded-User $CONFIG | awk '{print $4}'| uniq|tr -d "\n\r")
9
9
set +x
10
10
# retry till new get new token
11
11
while true ; do
12
- TOKEN=$( aws ecr get-login --no-include-email | awk ' {print $6} ' )
12
+ TOKEN=$( aws ecr get-authorization-token --query ' authorizationData[*].authorizationToken ' --output text )
13
13
[ ! -z " ${TOKEN} " ] && break
14
14
echo " Warn: Unable to get new token, wait and retry!"
15
15
sleep 30
16
16
done
17
17
18
-
19
- AUTH_N=$( echo AWS:${TOKEN} | base64 | tr -d " [:space:]" )
20
-
21
- echo $AUTH_N > /usr/local/openresty/nginx/token.txt
18
+ echo $TOKEN > /usr/local/openresty/nginx/token.txt
22
19
set -x
23
20
24
21
nginx -s reload
Original file line number Diff line number Diff line change @@ -80,9 +80,9 @@ chmod 600 -R ${AWS_FOLDER}
80
80
set +x
81
81
# add the auth token in default.conf
82
82
AUTH=$( grep X-Forwarded-User $CONFIG | awk ' {print $4}' | uniq| tr -d " \n\r" )
83
- TOKEN=$( aws ecr get-login --no-include-email | awk ' {print $6} ' )
84
- AUTH_N= $( echo AWS: ${TOKEN} | base64 | tr -d " [:space:] " )
85
- echo $AUTH_N > /usr/local/openresty/nginx/token.txt
83
+ TOKEN=$( aws ecr get-authorization-token --query ' authorizationData[*].authorizationToken ' --output text )
84
+
85
+ echo $TOKEN > /usr/local/openresty/nginx/token.txt
86
86
87
87
set -x
88
88
# make sure cache directory has correct ownership
You can’t perform that action at this time.
0 commit comments