From e3eee6068e64d5719d4879aa258d26baa83949a2 Mon Sep 17 00:00:00 2001 From: Guillaume de Rouville Date: Wed, 30 Jun 2021 10:03:42 +0200 Subject: [PATCH 1/2] Netlify: leverage --fail-with-body to finally print error's output Signed-off-by: Guillaume de Rouville --- stdlib/netlify/netlify.sh.cue | 7 ++++--- stdlib/netlify/tests/netlify.cue | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/stdlib/netlify/netlify.sh.cue b/stdlib/netlify/netlify.sh.cue index 46306187..428a60fd 100644 --- a/stdlib/netlify/netlify.sh.cue +++ b/stdlib/netlify/netlify.sh.cue @@ -6,16 +6,17 @@ package netlify create_site() { url="https://api.netlify.com/api/v1/${NETLIFY_ACCOUNT:-}/sites" - response=$(curl -s -S -f -H "Authorization: Bearer $NETLIFY_AUTH_TOKEN" \ + response=$(curl -s -S --fail-with-body -H "Authorization: Bearer $NETLIFY_AUTH_TOKEN" \ -X POST -H "Content-Type: application/json" \ $url \ - -d "{\"name\": \"${NETLIFY_SITE_NAME}\", \"custom_domain\": \"${NETLIFY_DOMAIN}\"}" + -d "{\"name\": \"${NETLIFY_SITE_NAME}\", \"custom_domain\": \"${NETLIFY_DOMAIN}\"}" -o body ) if [ $? -ne 0 ]; then + cat body >&2 exit 1 fi - echo $response | jq -r '.site_id' + cat body | jq -r '.site_id' } site_id=$(curl -s -S -f -H "Authorization: Bearer $NETLIFY_AUTH_TOKEN" \ diff --git a/stdlib/netlify/tests/netlify.cue b/stdlib/netlify/tests/netlify.cue index 5a0f3187..b09bace3 100644 --- a/stdlib/netlify/tests/netlify.cue +++ b/stdlib/netlify/tests/netlify.cue @@ -22,7 +22,7 @@ TestNetlify: { // Deploy to netlify deploy: #Site & { contents: html - name: "dagger-test" + name: "dagger-test-\(data.out)" } // Check if the deployed site has the random marker From 921f845c71c933deda7db6c53c33a01aafa463ac Mon Sep 17 00:00:00 2001 From: Tom Chauveau Date: Wed, 30 Jun 2021 16:55:07 +0200 Subject: [PATCH 2/2] Keep same website for netlify tests Signed-off-by: Tom Chauveau --- stdlib/netlify/tests/netlify.cue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/netlify/tests/netlify.cue b/stdlib/netlify/tests/netlify.cue index b09bace3..5a0f3187 100644 --- a/stdlib/netlify/tests/netlify.cue +++ b/stdlib/netlify/tests/netlify.cue @@ -22,7 +22,7 @@ TestNetlify: { // Deploy to netlify deploy: #Site & { contents: html - name: "dagger-test-\(data.out)" + name: "dagger-test" } // Check if the deployed site has the random marker