Skip to content

Commit

Permalink
Add a step to download optional .sh files for plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Torbjørn Vatn committed Apr 27, 2021
1 parent 59d8abd commit 4d9989e
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 7 deletions.
5 changes: 4 additions & 1 deletion brokkr/brokkr.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ $(_BROKKR_PLUGINS_MK): $(_BROKKR_PLUGINS_SENTINEL)
url="https://raw.githubusercontent.com/$(BROKKR_REPO)/$${plugin_version}/plugins/$${plugin_path}.mk"; \
echo "Downloading $${url}"; \
curl --fail -s "$$url" -o $(_BROKKR_PLUGINS_DIR)/$${plugin_path}.mk; \
url="https://raw.githubusercontent.com/$(BROKKR_REPO)/$${plugin_version}/plugins/$${plugin_path}.sh"; \
echo "Downloading $${url}"; \
curl --fail -s "$$url" -o $(_BROKKR_PLUGINS_DIR)/$${plugin_path}.sh; \
echo include $(_BROKKR_PLUGINS_DIR)/$${plugin_path}.mk >> $@; \
done

Expand All @@ -41,4 +44,4 @@ brokkr.clean: ## Clean up the .brokkr folder. Triggers a new download of plugins
brokkr.update: ## Download latest Brokkr version
curl https://raw.githubusercontent.com/$(BROKKR_REPO)/master/scripts/install.sh | bash

-include $(_BROKKR_PLUGINS_MK)
-include $(_BROKKR_PLUGINS_MK)
5 changes: 3 additions & 2 deletions example/airflow/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.SILENT: ;
BROKKR_PLUGINS := airflow/airflow@34b389a help/help@c09a208
SHA := `git rev-parse --short HEAD`
BROKKR_PLUGINS := help/help@$(SHA) airflow/airflow@$(SHA)
.DEFAULT_GOAL := help

# Hack for local testing. This would be installed by the install script instead
-include ../../brokkr/brokkr.mk
-include ../../brokkr/brokkr.mk
11 changes: 11 additions & 0 deletions example/github/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.SILENT: ;
SHA := `git rev-parse --short HEAD`
BROKKR_PLUGINS := help/help@$(SHA) github/github-deploy@$(SHA)
.DEFAULT_GOAL := help

.PHONY: deploy
deploy: ## Calls the deploy function from github/github-deploy
@echo Deploying
#$(call deploy, deploy-to-prod)

-include ../../brokkr/brokkr.mk
5 changes: 3 additions & 2 deletions example/hello-world/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
.SILENT: ;
BROKKR_PLUGINS = help/help@c09a208 git/git-info@e3389a1
SHA := `git rev-parse --short HEAD`
BROKKR_PLUGINS := help/help@$(SHA) git/git-info@$(SHA)
.DEFAULT_GOAL := help

.PHONY: hello.world
hello.world: ## Prints hello world
@echo Hello world

-include ../../brokkr/brokkr.mk
-include ../../brokkr/brokkr.mk
2 changes: 1 addition & 1 deletion plugins/github/github-deploy.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
AUTO_MERGE=true
define deploy
@echo Checking diff local against remote
./deploy.sh \
./github-deploy.sh \
$(strip $1) \
${AUTO_MERGE} \
$(strip $(if $2, $2, deploy))
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion plugins/help/help.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.PHONY: help
help: ## List all described targets available
awk -F ':|##' '/^[^\t].+:.*##/ { printf "\033[36m%-28s\033[0m -%s\n", $$1, $$NF }' $(MAKEFILE_LIST) | sort
@awk -F ':|##' '/^[^\t].+:.*##/ { printf "\033[36m%-28s\033[0m -%s\n", $$1, $$NF }' $(MAKEFILE_LIST) | sort

0 comments on commit 4d9989e

Please sign in to comment.