Skip to content

Commit

Permalink
Makefile: implement push-check with go fmt HMS-3099
Browse files Browse the repository at this point in the history
  • Loading branch information
schuellerf committed Apr 2, 2024
1 parent 7937c87 commit 99e6f12
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
/output
/bin
__pycache__
.python-version

37 changes: 36 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@
# There's no heavy lifting here; this file is just a convenience
# for people whose muscle memory for building projects starts with typing `make`.
all:

.PHONY: all
all: build-binary build-container

.PHONY: clean
clean:
# not sure if we should remove generated stuff
# keep the output directory itself
#-rm -rf output/*
rm -rf bin
@echo "removing test files that might be owned by root"
sudo rm -rf /var/tmp/bib-tests

.PHONY: test
test:
@echo "Be aware that the tests take a really long time"
@echo "Running tests as root"
sudo -E pip install --user -r test/requirements.txt
sudo -E pytest -s -v

.PHONY: build-binary
build-binary:
./build.sh

.PHONY: build-container
build-container:
sudo podman build --tag bootc-image-builder .

.PHONY: push-check
push-check: build-binary build-container test
cd bib; go fmt ./...
@if [ 0 -ne $$(git status --porcelain --untracked-files|wc -l) ]; then \
echo "There should be no changed or untracked files"; \
git status --porcelain --untracked-files; \
exit 1; \
fi
@echo "All looks good - congratulations"

0 comments on commit 99e6f12

Please sign in to comment.