|
| 1 | +YAML_FILES := $(wildcard *.yaml) |
| 2 | +LOCK_FILES := $(wildcard *.yaml.lock) |
| 3 | +LINTED_YAMLS := $(YAML_FILES:=.lint) |
| 4 | +UPDATED_YAMLS := $(YAML_FILES:=.update) |
| 5 | +CORRECT_YAMLS := $(YAML_FILES:=.fix) |
| 6 | +INSTALL_YAMLS := $(LOCK_FILES:=.install) |
| 7 | +UPDATE_TRUSTED_IUC := $(LOCK_FILES:.lock=.update_trusted_iuc) |
| 8 | + |
| 9 | +GALAXY_SERVER := |
| 10 | + |
| 11 | + |
| 12 | +help: |
| 13 | + @egrep '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-16s\033[0m %s\n", $$1, $$2}' |
| 14 | + |
| 15 | +lint: $(LINTED_YAMLS) ## Lint the yaml files |
| 16 | +fix: $(CORRECT_YAMLS) ## Fix any issues (missing hashes, missing lockfiles, etc.) |
| 17 | +install: $(INSTALL_YAMLS) ## Install the tools in our galaxy |
| 18 | + |
| 19 | +%.lint: % |
| 20 | + python3 scripts/fix-lockfile.py $< |
| 21 | + pykwalify -d $< -s .schema.yaml |
| 22 | + python3 scripts/identify-unpinned.py $< |
| 23 | + |
| 24 | +%.fix: % |
| 25 | + @# Generates the lockfile or updates it if it is missing tools |
| 26 | + python3 scripts/fix-lockfile.py $< |
| 27 | + @# --without says only add those hashes for those missing hashes (i.e. new tools) |
| 28 | + python3 scripts/update-tool.py $< --without |
| 29 | + |
| 30 | +%.install: % |
| 31 | + @echo "Installing any updated versions of $<" |
| 32 | + @-shed-tools install --install_resolver_dependencies --toolsfile $< --galaxy $(GALAXY_SERVER) --api_key $(GALAXY_API_KEY) 2>&1 | tee -a report.log |
| 33 | + |
| 34 | +pr_check: |
| 35 | + for changed_yaml in `git diff remotes/origin/master --name-only | grep .yaml$$`; do python scripts/pr-check.py $${changed_yaml} && pykwalify -d $${changed_yaml} -s .schema.yaml ; done |
| 36 | + |
| 37 | +update_trusted: $(UPDATE_TRUSTED_IUC) ## Run the update script |
| 38 | + @# Missing --without, so this updates all tools in the file. |
| 39 | + python3 scripts/update-tool.py tools_iuc.yaml |
| 40 | + |
| 41 | +update_all: $(UPDATED_YAMLS) |
| 42 | + |
| 43 | +%.update: ## Update all of the tools |
| 44 | + @# Missing --without, so this updates all tools in the file. |
| 45 | + python3 scripts/update-tool.py $< |
| 46 | + |
| 47 | +%.update_trusted_iuc: % |
| 48 | + @# Update any tools owned by IUC in any other yaml file |
| 49 | + python3 scripts/update-tool.py --owner iuc $< |
| 50 | + |
| 51 | + |
| 52 | +.PHONY: pr_check lint update_trusted help |
0 commit comments