Skip to content

Instantly share code, notes, and snippets.

@paulbrodner
Last active October 31, 2019 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulbrodner/eb2b62c22b1f8cecd00dc0f55bb6d595 to your computer and use it in GitHub Desktop.
Save paulbrodner/eb2b62c22b1f8cecd00dc0f55bb6d595 to your computer and use it in GitHub Desktop.
keycloack-makefile
VERSION := $(shell grep \<version pom.xml |awk '{ if(NR==2) print $$0 }' | awk -F '[><]' '{print $$3}')
TAG := local
CURRENT_DIR := $(shell pwd)
ifdef DEBUG
export MAVEN_OPTS:=-Dorg.slf4j.simpleLogger.defaultLogLevel=debug
endif
.PHONY: tree
help: ## output this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?##|[a-zA-Z_-]\.?+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
#export MAVEN_OPTS=-Dorg.slf4j.simpleLogger.defaultLogLevel=warn &&
install: ## build keycloak
mvn clean install -U -nsu -s maven-settings.xml \
-Pdistribution \
-Dmaven.test.skip \
-DskipTestsuite \
-DskipTests
build-server: ## build only the keycloack server distribution zip
rm -rf distribution/server-dist/target && \
mvn -Pdistribution \
-pl distribution/server-dist \
-am \
-Dmaven.test.skip \
clean install
start-server: ## start server from distribution (run build-server if not done already)
cd distribution/server-dist/target/ && \
unzip -oq keycloak-$(VERSION).zip && \
cd keycloak-$(VERSION) && \
bin/add-user-keycloak.sh -u admin -p admin || echo "user admin configured" && \
bash bin/standalone.sh
tree: ## analyze the dependencies and produce a report
mvn -nsu -s maven-settings.xml dependency:tree -Dverbose > tree.txt
show: ## display current version
@echo $(VERSION)
scan: ## scan the distribution
@[ -f wss-unified-agent.jar ] && echo "wss-unified-agent.jar exist" || curl -LJO https://github.com/whitesource/unified-agent-distribution/releases/latest/download/wss-unified-agent.jar
@[ -f wss-unified-agent.config ] && echo "wss-unified-agent.config exist" || curl -LJO https://github.com/whitesource/unified-agent-distribution/raw/master/standAlone/wss-unified-agent.config
java -jar wss-unified-agent.jar \
-d distribution/server-dist/target/keycloak-$(VERSION) \
-product "Alfresco Identity Service" \
-project "Identity Service" \
-projectVersion "keycloack-$(TAG)-$(VERSION)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment