From 14d1a27418b7bda1e850d6909746d020b994d658 Mon Sep 17 00:00:00 2001 From: Joosep Alviste Date: Sat, 6 Jan 2024 09:55:20 +0200 Subject: [PATCH] ci: fail pipeline when deployment fails Previously, if the deployment got to the SSH step, then it would always pass because we were not handling errors from the SSH script. Related to #83 --- .editorconfig | 2 +- bin/update-deployment.sh | 28 +++++++++++++++++----------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.editorconfig b/.editorconfig index 65460282..b357b754 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,5 @@ root = true -[*.{ts,tsx,js,json}] +[*.{ts,tsx,js,json,sh}] indent_style = space indent_size = 2 diff --git a/bin/update-deployment.sh b/bin/update-deployment.sh index 90663aa1..0cbe2032 100755 --- a/bin/update-deployment.sh +++ b/bin/update-deployment.sh @@ -6,14 +6,18 @@ # To use this manually, fill the following variables in `.env`: # - DEPLOYMENT_SSH_HOST # - DEPLOYMENT_SSH_USER -deploy() { - # If the required environment variables already exist (e.g., in GitHub - # Actions), then we don't need to read the `.env` file - if [[ -z "${DEPLOYMENT_SSH_HOST}" ]]; then - source .env - fi - ssh "${DEPLOYMENT_SSH_USER}@${DEPLOYMENT_SSH_HOST}" <&2 + exit 1 +fi