Skip to content
Snippets Groups Projects
Verified Commit 46f8f1f4 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: commit save point

parent 9c3449f8
Branches
Tags
No related merge requests found
#############################################################################################
#############################################################################################
##
## GIT-TARGETS
##
#############################################################################################
#############################################################################################
EXECUTABLES = $(EXECUTABLES:-) uuidgen
## Current Branch-GIT_TAG
GIT_TAG := -
## Git Commit GIT_MESSAGE for git-push
GIT_MESSAGE := current status
.PHONY: git-branch
## create new branch (use GIT_TAG-Variable)
git-branch:
$(QUIET) export BRANCH="b$(GIT_TAG)/$(shell uuidgen --random)" ; \
$(GIT) checkout -b $${BRANCH} && \
RESULT=$$($(GIT) push origin $$BRANCH 2>&1) && \
RESULT2=$$($(GIT) branch --set-upstream-to=origin/$$BRANCH $$BRANCH) && \
GITLABURL=$$(echo "$$RESULT" | tr '\n' '\#' | grep -o 'remote\:\s*https:\/\/gitlab\.schukai\.com[^ ]*' | cut -d " " -f2-9 | sed -e 's/^[ \t]*//') && \
if $(OPENBROWSER) ; then google-chrome --profile-directory="Default" $$GITLABURL ; fi
.PHONY: git-to-master
## git checkout master, fetch and merge
git-to-master:
$(GIT) checkout master && $(GIT) fetch -pP && $(GIT) merge
.PHONY: git-push-to-server
## git push changes to server
git-push-to-server:
$(QUIET) $(GIT) add -A
$(QUIET) $(GIT) commit -m"$(GIT_MESSAGE)"
$(QUIET) $(GIT) push
.PHONY: git-push
## git create branch and push changes to server
git-push: git-branch git-push-to-server
.PHONY: git-GIT_TAG
## git create version GIT_TAG
git-GIT_TAG:
$(QUIET) $(GIT) GIT_TAG -a "$(COMPONENT_VERSION)" -m "release $(COMPONENT_VERSION)"
#############################################################################################
#############################################################################################
##
## HELP-TARGETS
##
#############################################################################################
#############################################################################################
# @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
.DEFAULT_GOAL := help
.PHONY: print
print:
$(ECHO) "THIS_MAKEFILE: $(THIS_MAKEFILE)"
$(ECHO) "THIS_MAKEFILE_PATH: $(THIS_MAKEFILE_PATH)"
$(ECHO) "PROJECT_ROOT: $(PROJECT_ROOT)"
# Add a comment to the public targets so that it appears
# in this help Use two # characters for a help comment
.PHONY: help
help:
@printf "${COMMENT}Usage:${RESET}\n"
@printf " make [target] [arg=\"val\"...]\n\n"
@printf "${COMMENT}Available targets:${RESET}\n"
@awk '/^[a-zA-Z\-\\_0-9\.@]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf " ${INFO}%-22s${RESET} %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
@printf "\n${COMMENT}Available arguments:${RESET}\n\n"
@awk '/^(([a-zA-Z\-\\_0-9\.@]+)\s=)/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf " ${INFO}%-22s${RESET} %s (Default: %s)\n", $$1, helpMessage, $$3; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
#############################################################################################
#############################################################################################
##
## INIT-TARGETS
##
#############################################################################################
#############################################################################################
## @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
.PHONY: init
## init project
init:
$(QUIET) $(ECHO) "This is the target init"
K := $(foreach path,$(PROJECT_DIRECTORIES),\
$(shell mkir -p $(path)))
$(QUIET) $(TOUCH) $(RELEASE_FILE)
$(QUIET) $(ECHO) "Done"
#############################################################################################
#############################################################################################
##
## TERMINAL CHECK
##
#############################################################################################
#############################################################################################
# Executable Programs the Installed be have to
K := $(foreach exec,$(EXECUTABLES),\
$(if $(shell which $(exec)),some string,$(error "Missing $(exec) in PATH; please install")))
\ No newline at end of file
#############################################################################################
#############################################################################################
##
## COMMANDS
##
#############################################################################################
#############################################################################################
# Use bash instead of sh
## Sets the shell used
SHELL = bash
# path and binaries
AWK := awk
CP := cp
CD := cd
KILL := /bin/kill
MV := mv
RM := rm -f
MKDIR := mkdir -p
SED := sed
FIND := find
SORT := sort
TOUCH := touch
WGET := wget
CHMOD := chmod
RSYNC := rsync
XARGS := xargs
GREP := grep
MAKE := make
GIT := git
LN := ln -s
TOUCH := touch
EXECUTABLES = $(EXECUTABLES:-) $(AWK) $(CP) $(KILL) $(MV) $(SED) $(FIND) $(SORT) $(TOUCH) $(WGET) $(CHMOD) $(RSYNC) $(XARGS) $(GREP) $(MAKE) $(GIT)
\ No newline at end of file
#############################################################################################
#############################################################################################
##
## VERSIONS
##
#############################################################################################
#############################################################################################
VERSION_BIN := version
EXECUTABLES = $(EXECUTABLES:-) $(VERSION_BIN)
RELEASEFILE := $(PROJECT_ROOT)release.json
PROJECTVERSION := $(shell cat $(RELEASEFILE) | jq -r .version)
PROJECTBUILDDATE := $(shell $(VERSION_BIN) date)
.PHONY: next-patch-version
## create next-patch-version
next-patch-version:
$(QUIET) $(ECHO) "Creating next version"
$(QUIET) $(VERSION_BIN) patch --path $(RELEASEFILE) --selector "version"
$(QUIET) $(eval PROJECTVERSION := $(shell cat $(RELEASEFILE) | jq -r .version))
{
"version": "1.0.21"
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment