Skip to content

Commit a5636be

Browse files
pyphiliakim
andauthored
ci: stop workflow on docker build error (#2017)
* ci: stop workflow on docker build error * refactor: apply suggested code * refactor: fix doc for build.sh --------- Co-authored-by: kim <kim.phanhoang@epfl.ch>
1 parent c05d9c4 commit a5636be

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

docker/build.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
#!/usr/bin/env bash
22

3+
set -euo pipefail
4+
# -e: exit on any command with a non-zero status
5+
# -u: treat unset variables as errors
6+
# -o pipefail: fail a pipeline if any command in it fails
7+
8+
# Optional: make errors show the line number and command that failed
9+
trap 'echo "Error on line $LINENO: ${BASH_COMMAND}" >&2' ERR
10+
311
function show_help() {
412
echo "This script allows to build and push the docker images for the core and the migration"
513
echo "Usage: bash docker/build.sh ECR_URI VERSION"
614
echo "Arguments:"
715
echo " ECR_URI URI of the ECR in AWS, example: public.ecr.aws/qzuer78 or a private ECR XXXXXXXX.dkr.ecr.region.amazonaws.com/repo."
8-
echo " VERSION The version that is deployed, should be a semantic version i.e 1.45.8"
16+
echo " VERSION The version that is deployed, should be a semantic version i.e v1.45.8"
917
}
1018

1119
# Check if no arguments are provided

0 commit comments

Comments
 (0)