Skip to content

Commit

Permalink
[docker] exit early if build fails
Browse files Browse the repository at this point in the history
If the build fails, don't then attempt to run the container-which-wasn't-built
  • Loading branch information
shish committed Jan 19, 2025
1 parent 4362e78 commit 962eda4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .devcontainer/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/bin/sh
set -eu

# A little helper script to rebuild the generated files using a known-good
# environment, so that we should all end up with the same results, and also
# no need to install any dependencies on the host machine.

cd $(dirname $0)/../
docker run --rm -v ${PWD}:/app $(docker build -q -f .devcontainer/Dockerfile .)
5 changes: 5 additions & 0 deletions .devcontainer/run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#!/bin/sh
set -eu

# A little helper script to run a shell in a known-good environment, so that
# developers can easily debug issues with the build process.

cd $(dirname $0)/../
docker run --rm -ti -v ${PWD}:/app $(docker build -q . -f .devcontainer/Dockerfile) /bin/bash

0 comments on commit 962eda4

Please sign in to comment.