-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (29 loc) · 1.58 KB
/
Copy pathMakefile
File metadata and controls
34 lines (29 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
export PROJECT ?= $(shell basename $(shell pwd))
TRONADOR_AUTO_INIT := true
GITVERSION ?= $(INSTALL_PATH)/gitversion
GH ?= $(INSTALL_PATH)/gh
YQ ?= $(INSTALL_PATH)/yq
TOML ?= toml
-include $(shell curl -sSL -o .tronador "https://cowk.io/acc"; echo .tronador)
## Python Version Bump and creates VERSION File - Uses always the FullSemVer from GitVersion (no need to prepend the 'v').
version: packages/install/gitversion
$(call assert-set,GITVERSION)
ifeq ($(GIT_IS_TAG),1)
@echo "$(GIT_TAG)" | sed -e 's/^v\([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\(-[a-zA-Z0-9.]\{1,\}\)*\)\(+deploy-.*\)\?$$/\1/' > VERSION
@$(TOML) set --toml-path pyproject.toml project.version "$$(cat VERSION)"
else
# Translates + in version to - for helm/docker compatibility
@echo "$(shell $(GITVERSION) -output json -showvariable FullSemVer | tr '+' '-')" > VERSION
@$(TOML) set --toml-path pyproject.toml project.version "$(shell $(GITVERSION) -output json -showvariable FullSemVer | tr '+' '-')"
endif
code/install/tomlcli:
@pip3 install toml-cli
# Modify pyproject.toml to change the project name with the $(PROJECT) variable
## Code Initialization for Node Project
code/init: packages/install/gitversion packages/install/gh packages/install/yq code/install/tomlcli
$(call assert-set,GITVERSION)
$(call assert-set,GH)
$(call assert-set,YQ)
$(eval $@_OWNER := $(shell $(GH) repo view --json 'name,owner' -q '.owner.login'))
@$(TOML) set --toml-path pyproject.toml project.name "$(PROJECT)"
@$(TOML) set --toml-path pyproject.toml project.version "$(shell $(GITVERSION) -output json -showvariable MajorMinorPatch | tr '+' '-')"