Skip to content

Commit

Permalink
refactor: fail fast on build artifacts error
Browse files Browse the repository at this point in the history
  • Loading branch information
mrekucci committed Jul 5, 2024
1 parent 3e104d4 commit fdda5cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions infrastructure/nomad/playbooks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@
fi
set +x
goreleaser release --snapshot --config=./{{ artifact.path }}/.goreleaser.tmp.yml
if [ $? -ne 0 ]; then exit 1; fi
rm ./{{ artifact.path }}/.goreleaser.tmp.yml
fi
flock -v -u 192
Expand All @@ -231,6 +232,7 @@
echo "${ARTIFACT}" >> "${INVENTORY}"
flock -v -u 192
tar -czvf "${ARTIFACT}" ./{{ artifact.path }}
if [ $? -ne 0 ]; then exit 1; fi
fi
{% endif %}

Expand All @@ -245,6 +247,7 @@
--passphrase="${PASSPHRASE}" \
--log-fmt="json"
)
if [ $? -ne 0 ]; then exit 1; fi
ARTIFACT_PATH="$(echo ${RESULT} | jq -e -r '.path // empty' 2>/dev/null)"
flock -v -x 192
echo "${ARTIFACT_PATH}" >> "${INVENTORY}"
Expand All @@ -261,6 +264,7 @@
"{{ artifact.keystore.name }}_password": $keystore_password
}' \
> "${SECRETS}"
if [ $? -ne 0 ]; then exit 1; fi
flock -v -u 191

ADDRESS="$(cat ${ARTIFACT_PATH} | jq -r '.address')"
Expand Down Expand Up @@ -309,6 +313,7 @@
"{{ artifact.keystore.name }}_password": $keystore_password
}' \
> "${SECRETS}"
if [ $? -ne 0 ]; then exit 1; fi
flock -v -u 191

ADDRESS=$(echo "${KEYSTORE}" | jq -r '.address')
Expand All @@ -331,6 +336,7 @@
{% endif %}
{% if artifact.boot_key | default(false) and environments[env].secrets == 'generate' %}
bootnode -genkey "${DESTINATION_DIR}/boot.key"
if [ $? -ne 0 ]; then exit 1; fi

flock -v -x 191
cat "${SECRETS}" | jq \
Expand All @@ -342,6 +348,7 @@
($item_name + "_boot_key_address"): $boot_key_address
}' \
> "${SECRETS}"
if [ $? -ne 0 ]; then exit 1; fi
flock -v -u 191

{% endif %}
Expand Down

0 comments on commit fdda5cd

Please sign in to comment.