1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-11-24 09:02:28 +00:00
senpy/.makefiles/base.mk

37 lines
1.2 KiB
Makefile
Raw Normal View History

2017-10-03 11:41:51 +00:00
export
2017-09-29 13:00:37 +00:00
NAME ?= $(shell basename $(CURDIR))
2017-09-27 19:08:21 +00:00
VERSION ?= $(shell git describe --tags --dirty 2>/dev/null)
ifeq ($(VERSION),)
2017-10-05 13:25:33 +00:00
VERSION:=unknown
endif
2017-09-29 13:00:37 +00:00
# Get the location of this makefile.
MK_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
2017-10-03 11:41:51 +00:00
2017-10-03 11:46:09 +00:00
-include .env
-include ../.env
2017-10-03 11:41:51 +00:00
2017-09-27 19:08:21 +00:00
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/\(.*:\)[^#]*##\s*\(.*\)/\1\t\2/' | column -t -s " "
config: ## Load config from the environment. You should run it once in every session before other tasks. Run: eval $(make config)
2017-10-03 11:41:51 +00:00
@awk '{ print "export " $$0}' ../.env
2017-09-27 19:08:21 +00:00
@awk '{ print "export " $$0}' .env
@echo "# Please, run: "
@echo "# eval \$$(make config)"
# If you need to run a command on the key/value pairs, use this:
# @awk '{ split($$0, a, "="); "echo " a[2] " | base64 -w 0" |& getline b64; print "export " a[1] "=" a[2]; print "export " a[1] "_BASE64=" b64}' .env
ci: ## Run a task using gitlab-runner. Only use to debug problems in the CI pipeline
gitlab-runner exec shell --builds-dir '.builds' --env CI_PROJECT_NAME=$(NAME) ${action}
2017-09-29 13:00:37 +00:00
include $(MK_DIR)/makefiles.mk
2017-09-29 13:11:08 +00:00
include $(MK_DIR)/docker.mk
2017-09-29 13:33:58 +00:00
include $(MK_DIR)/git.mk
2017-09-27 19:08:21 +00:00
2017-10-03 11:41:51 +00:00
info:: ## List all variables
env
.PHONY:: config help ci