Skip to content

Commit

Permalink
Added support for clean target to remove gcluster binary and the ghpc…
Browse files Browse the repository at this point in the history
… link
  • Loading branch information
nadig-google committed Jan 23, 2025
1 parent 81a8dc6 commit b365ff0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ SHELL=/bin/bash -o pipefail
ENG = ./cmd/... ./pkg/...
TERRAFORM_FOLDERS=$(shell find ./modules ./community/modules ./tools -type f -name "*.tf" -not -path '*/\.*' -exec dirname "{}" \; | sort -u)
PACKER_FOLDERS=$(shell find ./modules ./community/modules ./tools -type f -name "*.pkr.hcl" -not -path '*/\.*' -exec dirname "{}" \; | sort -u)
BINARY_TARGETS := ghpc gcluster
INSTALL_DIRS := . ~/bin /usr/local/bin

ifneq (, $(shell which git))
## GIT IS PRESENT
Expand Down Expand Up @@ -72,6 +74,23 @@ install-dev-deps: warn-terraform-version warn-packer-version check-pre-commit ch
pip install -r community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/scripts/requirements.txt
pip install -r community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/scripts/tests/requirements.txt


clean:
@for dir in $(INSTALL_DIRS); do \
for file in $(BINARY_TARGETS); do \
if [ -f "$$dir/$$file" ] || [ -L "$$dir/$$file" ]; then \
if [ -w "$$dir/$$file" ]; then \
echo "Removing $$dir/$$file"; \
rm "$$dir/$$file"; \
else \
echo "Do not have permissions to delete $$dir/$$file"; \
fi; \
else \
echo "$$dir/$$file does not exist"; \
fi; \
done; \
done

# RULES SUPPORTING THE ABOVE

test-engine: warn-go-missing
Expand Down

0 comments on commit b365ff0

Please sign in to comment.