-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add makefile to spring boot qs #762
base: master
Are you sure you want to change the base?
add makefile to spring boot qs #762
Conversation
cat ${SOURCE_DIR}/templates/gradle-maven-publish.template >> ${TARGET_DIR}/build.gradle | ||
|
||
.PHONY: customise-build-gradle | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for using this locally it would be nice to have an additional target that does all three existing targets in one, basically mimicking the jenkins stage where they are being called in.
And if you want to be fancy you could add a help target ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case you have no help target at hand, I used this code once in the past:
### Based on https://gist.github.com/prwhite/8168133#gistcomment-2278355
# COLORS
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
RESET := $(shell tput -Txterm sgr0)
## Show this help
help:
@echo ''
@echo 'Usage:'
@echo ' make <${GREEN}target${RESET}>'
@echo ''
@echo 'Targets:'
@awk '/^[0-9a-zA-Z_-]+:|^# .*/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf " ${GREEN}%-30s${RESET} %s\n", helpCommand, helpMessage; \
} else { \
printf "\n"; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
.PHONY: help
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI I've switched to this short version lately: https://github.com/opendevstack/ods-pipeline/blob/master/Makefile#L15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI I've switched to this short version lately: https://github.com/opendevstack/ods-pipeline/blob/master/Makefile#L15
cool! but this does require having awk
installed, no? Not every unix distro has it installed out of the box AFAIK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, I think I'm mixing this up now with another unix tool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, I'll add this and also one target that calls all other.
@michaelsauter @renedupont do you think it might be worth to rename the target names to reflect some sort of standard targets/interface? Like create-project (calls all targets), create-project-template, update-project-template, etc...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes why not
you only have to come up with names that fit all quickstarters :)
It is already hard for this qs here - if I see it right you would rename the current create-project target into create-project-template, but from my point of view what is actually happening in their is not a creation of a template but rather the initialization of the project (the service is calles spring initializr).
fixes #761