Skip to content

Commit

Permalink
rebuild when health check changes and discard curl output
Browse files Browse the repository at this point in the history
  • Loading branch information
elvece committed Feb 21, 2022
1 parent 9334932 commit 64e7b3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ clean:
hello-world.s9pk: manifest.yaml assets/compat/config_spec.yaml assets/compat/config_rules.yaml image.tar instructions.md $(ASSET_PATHS)
embassy-sdk pack

image.tar: Dockerfile docker_entrypoint.sh hello-world/target/aarch64-unknown-linux-musl/release/hello-world
image.tar: Dockerfile docker_entrypoint.sh check-web.sh hello-world/target/aarch64-unknown-linux-musl/release/hello-world
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --tag start9/hello-world/main:$(VERSION) --platform=linux/arm64 -o type=docker,dest=image.tar .

hello-world/target/aarch64-unknown-linux-musl/release/hello-world: $(HELLO_WORLD_SRC)
Expand Down
6 changes: 3 additions & 3 deletions check-web.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
#!/bin/sh

DURATION=$(</dev/stdin)
if (($DURATION <= 5000 )); then
if (($DURATION <= 5000)); then
exit 60
else
curl --silent --fail hello-world.embassy:80
curl --silent --fail hello-world.embassy &>/dev/null
RES=$?
if test "$RES" != 0; then
echo "Web interface is unreachable" >&2
Expand Down

0 comments on commit 64e7b3b

Please sign in to comment.