Makefile: Add simple dev loop

Add a `dev` target which adds a convenient developer loop which
rebuilds and reruns the daemon after a SIGINT is received.

It can be exited by sending SIGINT (Ctrl+C) a couple times.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski
2023-07-25 12:20:03 +02:00
parent a11c3b9a89
commit a97b330c6c
2 changed files with 17 additions and 0 deletions

View File

@@ -212,6 +212,10 @@ build: validate-bind-dir bundles
shell: build ## start a shell inside the build env
$(DOCKER_RUN_DOCKER) bash
.PHONY: dev
dev: build ## start a dev mode inside the build env
$(DOCKER_RUN_DOCKER) hack/dev.sh
.PHONY: test
test: build test-unit ## run the unit, integration and docker-py tests
$(DOCKER_RUN_DOCKER) hack/make.sh dynbinary test-integration test-docker-py

13
hack/dev.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
while true; do
if ! ./hack/make.sh binary; then
# If the build fails, sleep for 5 seconds and continue
sleep 5
continue
fi
KEEPBUNDLE=1 ./hack/make.sh install-binary || continue
dockerd --debug || true
sleep 0.1
done