Skip to content

Commit

Permalink
Help cleanup (#55)
Browse files Browse the repository at this point in the history
* organize help under namespaces and create aliases for others

* make the defaults always show in help
  • Loading branch information
basejump authored Jul 21, 2022
1 parent 25018dc commit 1d64822
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 21 deletions.
2 changes: 1 addition & 1 deletion makefiles/Shipkit-main.make
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ uc = $(call _awk_case,toupper,$(1))
$(BUILD_DIR)::
mkdir -p $@

## Make it so
# Make it so
ship-it::


Expand Down
43 changes: 29 additions & 14 deletions makefiles/gradle-tools.make
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,16 @@ gradle_properties ?= gradle.properties
build_gradle ?= build.gradle


## runs codenarc and spotless
## runs codenarc and spotless with spotlessApply to fix any format issues
lint::
$(gradlew) spotlessApply
$(gradlew) codenarcMain

# Run the lint and test suite with ./gradlew check
# check::
# $(gradlew) spotlessApply
# $(gradlew) check

## clean the build
clean::
$(gradlew) clean

## compile apps. calls ./gradlew classes.
compile::
$(gradlew) classes

Expand All @@ -31,6 +28,7 @@ build::

testArg := $(if $(tests),--tests *$(tests)*, )

# runs both test and integrationTest.
test::
$(gradlew) test integrationTest

Expand All @@ -42,24 +40,32 @@ test.unit::
test.e2e::
$(gradlew) integrationTest $(testArg)

## show help list for test targets
help.test:
$(MAKE) help HELP_REGEX="^test.*"

test.help: help.test

# verifies the snapshot is set
_verify-snapshot: FORCE
_=$(if $(IS_SNAPSHOT),,$(error set snapshot=true in version properties))

## publish snapshot(s) jars into you local maven
publish.snapshot: | _verify-snapshot
$(gradlew) snapshot

# here so we can depend on it being there and if not firing assemble
$(APP_JAR):
$(gradlew) assemble

## java runs the APP_JAR
# java runs the APP_JAR
start.jar: $(APP_JAR)
java -server -Xmx3048m -XX:MaxMetaspaceSize=256m -jar $(APP_JAR)

.PHONY: resolve-dependencies merge-test-results

## show help list for gradle targets
help.gradle:
$(MAKE) help HELP_REGEX="^gradle.*"

gradle.help: help.gradle

# calls `gradlew resolveConfigurations` to download deps without compiling, used mostly for CI cache
gradle.resolve-dependencies:
$(gradlew) resolveConfigurations --no-daemon
Expand All @@ -80,14 +86,23 @@ gradle.cache-key-file: | _verify_PROJECT_SUBPROJECTS
done
$(logr.done)

# publish the library jar, calls gradle publish, alias to publish.libs
gradle.publish.libs: publish.libs

# publish snapshot(s) jars into you local maven
gradle.snapshot: | _verify-snapshot
$(gradlew) snapshot

## publish snapshot(s) jars into you local maven, alias to gradle.snapshot
publish.snapshot: gradle.snapshot

# legacy calls with no namespace
resolve-dependencies: gradle.resolve-dependencies

# alias to gradle.cache-key-file
cache-key-file: gradle.cache-key-file

merge-test-results: gradle.merge-test-results

## publish the library jar, calls gradle publish
# publish the library jar, calls gradle publish
publish.libs:
if [ "$(IS_SNAPSHOT)" ]; then $(logr) "publishing SNAPSHOT"; else $(logr) "publishing release"; fi
if [ "$(dry_run)" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ JBUILDER_NAME := $(PROJECT_NAME)_jbuilder
JBUILDER_COMPOSE_FILE ?= ./jbuilder-compose.yml
JBUILDER_COMPOSE_CMD := JBUILDER_NAME=$(JBUILDER_NAME) docker compose -p $(JBUILDER_NAME)_servers -f $(JBUILDER_COMPOSE_FILE)

## docker compose for jbuilder-compose.yml, follow with the docker cmd such as up, down, shell or pull
# docker compose for jbuilder-compose.yml, follow with the docker cmd such as up, down, shell or pull
docker.jbuilder: | _verify-DOCKER_CMD
$(MAKE) jbuilder-$(DOCKER_CMD)

Expand Down
2 changes: 1 addition & 1 deletion makefiles/ship-gh-pages.make
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ docmark.publish-prep: docmark.build git.clone-pages
cp -r $(GROOVYDOC_BUILD_DIR) $(PAGES_BUILD_DIR)/groovydocs
fi

## Builds and pushes docmark pages to github pages, CI should call publish-docs which calls this
# Builds and pushes docmark pages to github pages, CI should call publish-docs which calls this
pages.deploy-github: docmark.publish-prep
if [ "$(dry_run)" ]; then
echo "🌮 dry_run -> $(MAKE) git.push-pages"
Expand Down
2 changes: 1 addition & 1 deletion makefiles/spring-common.make
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include $(SHIPKIT_MAKEFILES)/git-tools.make
include $(SHIPKIT_MAKEFILES)/docker.make
include $(SHIPKIT_MAKEFILES)/kubectl-config.make
include $(SHIPKIT_MAKEFILES)/kube.make
include $(SHIPKIT_MAKEFILES)/jbuilder-docker.make
include $(SHIPKIT_MAKEFILES)/jdk-docker.make
include $(SHIPKIT_MAKEFILES)/gradle-tools.make
include $(SHIPKIT_MAKEFILES)/spring-docker.make
include $(SHIPKIT_MAKEFILES)/docmark.make
Expand Down
5 changes: 3 additions & 2 deletions makefiles/spring-docker.make
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ build/docker_push_$(APP_KEY): $(BUILD_DIR)/docker_built_$(APP_KEY) | _verify_APP
fi

.PHONY: docker.app-push
## builds and deploys whats in the src/deploy for the APP_DOCKER_URL to docker hub
# builds and deploys whats in the src/deploy for the APP_DOCKER_URL to docker hub
docker.app-push: $(BUILD_DIR)/docker_push_$(APP_KEY)

APP_COMPOSE_FILE ?= $(build_docker_dir)/docker-compose.yml
APP_COMPOSE_CMD := APP_DOCKER_URL=$(APP_DOCKER_URL) APP_NAME=$(APP_NAME) docker compose -p $(APP_NAME)_servers -f $(APP_COMPOSE_FILE)
APP_COMPOSE_CLEAN_FLAGS ?= --volumes --remove-orphans

## docker compose for the runnable jar, follow with a docker cmd such as up, down, shell or pull
# docker compose for the runnable jar, follow with a docker cmd such as up, down, shell or pull
docker.app: | _verify-DOCKER_CMD
$(MAKE) docker.app-$(DOCKER_CMD)

Expand All @@ -69,6 +69,7 @@ docker.app-up: build/docker_built_$(APP_KEY)
docker.app-down:
$(APP_COMPOSE_CMD) down $(APP_COMPOSE_CLEAN_FLAGS)

# open docker shell for app
docker.app-shell: docker.app-up
docker exec -it $(APP_NAME) bash -l

Expand Down
2 changes: 1 addition & 1 deletion version.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ publishedVersion=2.0.3
# when this is false will append -SNAPSHOT to version and if on publishable branch will 'publish' to snapshotUrl
# when true IS_RELEASEBALE will be set and will go through full release process cycle to
# automatically bump version and push a v tag to github
release=false
release=true

0 comments on commit 1d64822

Please sign in to comment.