Improve custom build script
+ Fail if bazel is any command fails
+ Simplify script
+ Print every command
#!/bin/bash
-bazel build //:skaffold_example.tar
-TAR_PATH=$(bazel info bazel-bin)
-docker load -i $TAR_PATH/skaffold_example.tar
+set -exuo pipefail
+bazel build //:skaffold_example.tar
-images=$(echo $IMAGES | tr " " "\n")
+TAR_PATH="$(bazel info bazel-bin)"
+docker load -i "$TAR_PATH/skaffold_example.tar"
-for image in $images
-do
+for image in $IMAGES; do
docker tag bazel:skaffold_example $image
- if $PUSH_IMAGE
- then
+ if $PUSH_IMAGE; then
docker push $image
fi
-
done
