2017-09-04 16:56:33 +00:00
|
|
|
.PHONY: all
|
2016-01-09 03:46:06 +00:00
|
|
|
all: yadm.md contrib
|
2015-07-17 00:38:17 +00:00
|
|
|
|
|
|
|
yadm.md: yadm.1
|
|
|
|
@groff -man -Tascii ./yadm.1 | col -bx | sed 's/^[A-Z]/## &/g' | sed '/yadm(1)/d' > yadm.md
|
|
|
|
|
2017-10-16 22:34:23 +00:00
|
|
|
.PHONY: contrib
|
|
|
|
contrib:
|
|
|
|
@echo "CONTRIBUTORS\n" > CONTRIBUTORS
|
2017-01-12 23:11:30 +00:00
|
|
|
@git shortlog -ns master gh-pages dev dev-pages | cut -f2 >> CONTRIBUTORS
|
2016-01-09 03:46:06 +00:00
|
|
|
|
2017-09-04 16:56:33 +00:00
|
|
|
.PHONY: pdf
|
2015-07-17 00:38:17 +00:00
|
|
|
pdf:
|
|
|
|
@groff -man -Tps ./yadm.1 > yadm.ps
|
|
|
|
@open yadm.ps
|
|
|
|
@sleep 1
|
|
|
|
@rm yadm.ps
|
|
|
|
|
2016-03-24 00:18:33 +00:00
|
|
|
.PHONY: test
|
2016-04-07 13:16:13 +00:00
|
|
|
test: bats shellcheck
|
|
|
|
|
2017-01-16 23:01:53 +00:00
|
|
|
.PHONY: parallel
|
|
|
|
parallel:
|
|
|
|
ls test/*bats | time parallel -q -P0 -- docker run --rm -v "$$PWD:/yadm:ro" yadm/testbed bash -c 'bats {}'
|
|
|
|
|
2018-07-11 12:50:42 +00:00
|
|
|
.PHONY: pytest
|
|
|
|
pytest:
|
|
|
|
@echo Running all pytest tests
|
|
|
|
@pytest -v
|
|
|
|
|
2016-04-07 13:16:13 +00:00
|
|
|
.PHONY: bats
|
|
|
|
bats:
|
|
|
|
@echo Running all bats tests
|
2016-06-08 13:33:05 +00:00
|
|
|
@GPG_AGENT_INFO= bats test
|
2016-03-24 00:18:33 +00:00
|
|
|
|
2016-04-07 13:16:13 +00:00
|
|
|
.PHONY: shellcheck
|
|
|
|
shellcheck:
|
|
|
|
@echo Running shellcheck
|
|
|
|
@shellcheck --version || true
|
2017-04-06 12:30:28 +00:00
|
|
|
@shellcheck -s bash yadm bootstrap test/*.bash completion/yadm.bash_completion
|
2017-01-05 22:29:36 +00:00
|
|
|
@cd test; \
|
|
|
|
for bats_file in *bats; do \
|
|
|
|
sed 's/^@test.*{/function test() {/' "$$bats_file" > "/tmp/$$bats_file.bash"; \
|
|
|
|
shellcheck -s bash "/tmp/$$bats_file.bash"; \
|
2016-04-07 13:16:13 +00:00
|
|
|
test_result="$$?"; \
|
2017-01-05 22:29:36 +00:00
|
|
|
rm -f "/tmp/$$bats_file.bash"; \
|
2016-04-07 13:16:13 +00:00
|
|
|
[ "$$test_result" -ne 0 ] && exit 1; \
|
|
|
|
done; true
|
|
|
|
|
2017-09-04 16:48:45 +00:00
|
|
|
.PHONY: testhost
|
|
|
|
testhost:
|
|
|
|
@target=HEAD
|
|
|
|
@rm -rf /tmp/testhost
|
|
|
|
@git show $(target):yadm > /tmp/testhost
|
|
|
|
@chmod a+x /tmp/testhost
|
|
|
|
@echo Starting testhost target=\"$$target\"
|
|
|
|
@docker run -w /root --hostname testhost --rm -it -v "/tmp/testhost:/bin/yadm:ro" yadm/testbed:latest bash
|
|
|
|
|
2017-09-04 16:56:33 +00:00
|
|
|
.PHONY: man
|
2015-07-17 00:38:17 +00:00
|
|
|
man:
|
|
|
|
groff -man -Tascii ./yadm.1 | less
|
|
|
|
|
2017-09-04 16:56:33 +00:00
|
|
|
.PHONY: wide
|
2015-07-17 00:38:17 +00:00
|
|
|
wide:
|
|
|
|
man ./yadm.1
|
2018-07-11 12:50:42 +00:00
|
|
|
|
|
|
|
.PHONY: sync-clock
|
|
|
|
sync-clock:
|
|
|
|
docker run --rm --privileged alpine hwclock -s
|
|
|
|
|
|
|
|
.PHONY: .env
|
|
|
|
.env:
|
|
|
|
virtualenv --python=python3 .env
|
|
|
|
.env/bin/pip3 install --upgrade pip setuptools
|
|
|
|
.env/bin/pip3 install --upgrade pytest pylint==1.9.2 flake8==3.5.0
|