Use a common target to pick yadm to test in test/scripthost
This commit is contained in:
parent
0d3ff086c5
commit
a9d9e89d0c
2 changed files with 18 additions and 18 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,5 +2,6 @@
|
||||||
.jekyll-metadata
|
.jekyll-metadata
|
||||||
.pytest_cache
|
.pytest_cache
|
||||||
.sass-cache
|
.sass-cache
|
||||||
|
.testyadm
|
||||||
_site
|
_site
|
||||||
testenv
|
testenv
|
||||||
|
|
35
Makefile
35
Makefile
|
@ -97,43 +97,42 @@ test:
|
||||||
docker run --rm -it -v "$(CURDIR):/yadm:ro" $(IMAGE) make test testargs="$(testargs)"; \
|
docker run --rm -it -v "$(CURDIR):/yadm:ro" $(IMAGE) make test testargs="$(testargs)"; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
.PHONY: testhost
|
.PHONY: .testyadm
|
||||||
testhost: version ?= HEAD
|
.testyadm: version ?= HEAD
|
||||||
testhost: require-docker
|
.testyadm:
|
||||||
@rm -rf /tmp/testhost
|
@echo "Using yadm version=\"$(version)\""
|
||||||
@if [ "$(version)" = "local" ]; then \
|
@if [ "$(version)" = "local" ]; then \
|
||||||
cp -f yadm /tmp/testhost; \
|
cp -f yadm $@; \
|
||||||
else \
|
else \
|
||||||
git show $(version):yadm > /tmp/testhost; \
|
git show $(version):yadm > $@; \
|
||||||
fi
|
fi
|
||||||
@chmod a+x /tmp/testhost
|
@chmod a+x $@
|
||||||
@echo Starting testhost version=\"$(version)\"
|
|
||||||
|
.PHONY: testhost
|
||||||
|
testhost: require-docker .testyadm
|
||||||
|
@echo "Starting testhost"
|
||||||
@docker run \
|
@docker run \
|
||||||
-w /root \
|
-w /root \
|
||||||
--hostname testhost \
|
--hostname testhost \
|
||||||
--rm -it \
|
--rm -it \
|
||||||
-v "/tmp/testhost:/bin/yadm:ro" \
|
-v "$(CURDIR)/.testyadm:/bin/yadm:ro" \
|
||||||
$(IMAGE) \
|
$(IMAGE) \
|
||||||
bash -l
|
bash -l
|
||||||
|
|
||||||
.PHONY: scripthost
|
.PHONY: scripthost
|
||||||
scripthost: version ?= HEAD
|
scripthost: require-docker .testyadm
|
||||||
scripthost: require-docker
|
@echo "Starting scripthost \(recording script\)"
|
||||||
@rm -rf /tmp/testhost
|
|
||||||
@git show $(version):yadm > /tmp/testhost
|
|
||||||
@chmod a+x /tmp/testhost
|
|
||||||
@echo Starting scripthost version=\"$(version)\" \(recording script\)
|
|
||||||
@printf '' > script.gz
|
@printf '' > script.gz
|
||||||
@docker run \
|
@docker run \
|
||||||
-w /root \
|
-w /root \
|
||||||
--hostname scripthost \
|
--hostname scripthost \
|
||||||
--rm -it \
|
--rm -it \
|
||||||
-v "$$PWD/script.gz:/script.gz:rw" \
|
-v "$(CURDIR)/script.gz:/script.gz:rw" \
|
||||||
-v "/tmp/testhost:/bin/yadm:ro" \
|
-v "$(CURDIR)/.testyadm:/bin/yadm:ro" \
|
||||||
$(IMAGE) \
|
$(IMAGE) \
|
||||||
bash -c "script /tmp/script -q -c 'bash -l'; gzip < /tmp/script > /script.gz"
|
bash -c "script /tmp/script -q -c 'bash -l'; gzip < /tmp/script > /script.gz"
|
||||||
@echo
|
@echo
|
||||||
@echo "Script saved to $$PWD/script.gz"
|
@echo "Script saved to $(CURDIR)/script.gz"
|
||||||
|
|
||||||
|
|
||||||
.PHONY: testenv
|
.PHONY: testenv
|
||||||
|
|
Loading…
Reference in a new issue