Skip to content

Commit 5b57ba0

Browse files
committed
chore(imagebuilder): optimize waiting conditions
1 parent 5bd5372 commit 5b57ba0

3 files changed

Lines changed: 11 additions & 8 deletions

File tree

Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ include versioning.mk
1414

1515
SHELL_SCRIPTS = $(wildcard _scripts/*.sh) \
1616
rootfs/usr/local/bin/* \
17-
rootfs/pack/*
17+
rootfs/imagebuilder/*
1818

1919
# The following variables describe the containerized development environment
2020
# and other build options
@@ -57,14 +57,11 @@ kube-service: kube-secrets
5757
kube-clean:
5858
- kubectl delete rc drycc-${SHORT_NAME}-rc
5959

60-
test: test-style test-unit test-functional
60+
test: test-style test-functional
6161

6262
test-style:
6363
${DEV_ENV_CMD} shellcheck $(SHELL_SCRIPTS)
6464

65-
test-unit:
66-
docker run --entrypoint /usr/bin/env ${IMAGE} python3 -m unittest procfile
67-
6865
test-functional:
6966
@echo "Implement functional tests in _tests directory"
7067

rootfs/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ RUN /imagebuilder/install
1010
WORKDIR /app
1111
ENV HOME /app
1212

13-
#ENTRYPOINT ["/imagebuilder/build"]
13+
ENTRYPOINT ["/imagebuilder/build"]

rootfs/imagebuilder/build

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ trap clean_before_exit EXIT
1313

1414
function waiting_podman {
1515
echo "---> Waiting podman system service"
16-
for _ in {0..3};do
16+
for i in {0..3}; do
1717
pid=$(pgrep podman)
1818
if [ ! -n "$pid" ]; then
1919
sleep 3
20+
elif [ ! -n "$pid" ] && [[ $i == 3 ]]; then
21+
echo "---> Podman system service failed to start"
22+
exit 1
2023
else
2124
sleep 1
2225
break
@@ -26,10 +29,13 @@ function waiting_podman {
2629

2730
function waiting_caddy {
2831
echo "---> Waiting caddy reverse-proxy"
29-
for _ in {0..3};do
32+
for i in {0..4}; do
3033
pid=$(pgrep caddy)
3134
if [ ! -n "$pid" ]; then
3235
sleep 3
36+
elif [ ! -n "$pid" ] && [[ $i == 3 ]]; then
37+
echo "---> Caddy failed to start"
38+
exit 1
3339
else
3440
sleep 1
3541
break

0 commit comments

Comments
 (0)