stdlib: netlify: export the deployUrl and logsUrl
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
5438e4177c
commit
fbdfe27103
@ -33,9 +33,14 @@ import (
|
|||||||
// Create the Netlify site if it doesn't exist?
|
// Create the Netlify site if it doesn't exist?
|
||||||
create: bool | *true
|
create: bool | *true
|
||||||
|
|
||||||
// Deployment url
|
// Website url
|
||||||
url: {
|
url: string
|
||||||
string
|
|
||||||
|
// Unique Deploy URL
|
||||||
|
deployUrl: string
|
||||||
|
|
||||||
|
// Logs URL for this deployment
|
||||||
|
logsUrl: string
|
||||||
|
|
||||||
#compute: [
|
#compute: [
|
||||||
llb.#Load & {
|
llb.#Load & {
|
||||||
@ -74,11 +79,10 @@ import (
|
|||||||
mount: "/src": from: contents
|
mount: "/src": from: contents
|
||||||
},
|
},
|
||||||
llb.#Export & {
|
llb.#Export & {
|
||||||
source: "/url"
|
source: "/output.json"
|
||||||
format: "string"
|
format: "json"
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: this should be outside
|
// FIXME: this should be outside
|
||||||
@ -119,5 +123,13 @@ let code = #"""
|
|||||||
--prod \
|
--prod \
|
||||||
| tee /tmp/stdout
|
| tee /tmp/stdout
|
||||||
|
|
||||||
</tmp/stdout sed -n -e 's/^Website URL:.*\(https:\/\/.*\)$/\1/p' | tr -d '\n' > /url
|
url=$(</tmp/stdout sed -n -e 's/^Website URL:.*\(https:\/\/.*\)$/\1/p' | tr -d '\n')
|
||||||
|
deployUrl=$(</tmp/stdout sed -n -e 's/^Unique Deploy URL:.*\(https:\/\/.*\)$/\1/p' | tr -d '\n')
|
||||||
|
logsUrl=$(</tmp/stdout sed -n -e 's/^Logs:.*\(https:\/\/.*\)$/\1/p' | tr -d '\n')
|
||||||
|
|
||||||
|
jq -n \
|
||||||
|
--arg url "$url" \
|
||||||
|
--arg deployUrl "$deployUrl" \
|
||||||
|
--arg logsUrl "$logsUrl" \
|
||||||
|
'{url: $url, deployUrl: $deployUrl, logsUrl: $logsUrl}' > /output.json
|
||||||
"""#
|
"""#
|
||||||
|
@ -52,7 +52,7 @@ TestNetlify: {
|
|||||||
"pipefail",
|
"pipefail",
|
||||||
"-c",
|
"-c",
|
||||||
#"""
|
#"""
|
||||||
test "$(curl \#(deploy.url))" = "\#(random)"
|
test "$(curl \#(deploy.deployUrl))" = "\#(random)"
|
||||||
"""#,
|
"""#,
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user