Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
8c141505
Unverified
Commit
8c141505
authored
May 05, 2021
by
neil
Committed by
GitHub
May 05, 2021
Browse files
Merge pull request #3350 from temoffey/deploy-gcore_cdn
Deploy gcore_cdn fix
parents
0881cf13
7ed7a57d
Changes
1
Show whitespace changes
Inline
Side-by-side
deploy/gcore_cdn.sh
View file @
8c141505
...
...
@@ -56,9 +56,9 @@ gcore_cdn_deploy() {
_request
=
"{
\"
username
\"
:
\"
$Le_Deploy_gcore_cdn_username
\"
,
\"
password
\"
:
\"
$Le_Deploy_gcore_cdn_password
\"
}"
_debug _request
"
$_request
"
export
_H1
=
"Content-Type:application/json"
_response
=
$(
_post
"
$_request
"
"https://api.gcdn.co/auth/
sign
in"
)
_response
=
$(
_post
"
$_request
"
"https://api.gcdn.co/auth/
jwt/log
in"
)
_debug _response
"
$_response
"
_regex
=
".*
\"
token
\"
:
\"\(
[-._0-9A-Za-z]*
\)\"
.*$"
_regex
=
".*
\"
access
\"
:
\"\(
[-._0-9A-Za-z]*
\)\"
.*$"
_debug _regex
"
$_regex
"
_token
=
$(
echo
"
$_response
"
|
sed
-n
"s/
$_regex
/
\1
/p"
)
_debug _token
"
$_token
"
...
...
@@ -72,12 +72,15 @@ gcore_cdn_deploy() {
export
_H2
=
"Authorization:Token
$_token
"
_response
=
$(
_get
"https://api.gcdn.co/resources"
)
_debug _response
"
$_response
"
_regex
=
".*(
\"
id
\"
.*?
\"
cname
\"
:
\"
$_cdomain
\"
.*?})"
_regex
=
"
\"
primary_resource
\"
:null},"
_debug _regex
"
$_regex
"
_response
=
$(
echo
"
$_response
"
|
sed
"s/
$_regex
/
$_regex
\n
/g"
)
_debug _response
"
$_response
"
_regex
=
"^.*
\"
cname
\"
:
\"
$_cdomain
\"
.*$"
_debug _regex
"
$_regex
"
_resource
=
$(
echo
"
$_response
"
|
sed
's/},{/},\n{/g'
|
_egrep_o
"
$_regex
"
)
_resource
=
$(
echo
"
$_response
"
| _egrep_o
"
$_regex
"
)
_debug _resource
"
$_resource
"
_regex
=
".*
\"
id
\"
:
\(
[0-9]*
\)
.*
\"
rules
\"
.*
$"
_regex
=
".*
\"
id
\"
:
\(
[0-9]*
\)
.*$"
_debug _regex
"
$_regex
"
_resourceId
=
$(
echo
"
$_resource
"
|
sed
-n
"s/
$_regex
/
\1
/p"
)
_debug _resourceId
"
$_resourceId
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment