diff --git a/.travis.yml b/.travis.yml index bd95856..064e7e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,4 @@ services: - 'docker' script: - - if [[ "$TRAVIS_BRANCH" == "master" ]]; then - make release ; - else - make build ; - fi + - 'make release' diff --git a/Makefile b/Makefile index 5fd7b54..580fd0a 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ DOCKER_IMAGE_BASE := jamfdevops DOCKER_ORG := DOCKER_IMAGE := jamfpro -IS_TAG=$(shell git describe --exact-match; echo $$?) +IS_TAG=$(shell git describe --exact-match>/dev/null; echo $$?) VERSION=$(shell git --no-pager describe --tags --always) SHA=$(shell git rev-parse --verify HEAD) BUILD_URL=$(TRAVIS_JOB_WEB_URL) @@ -65,7 +65,3 @@ repo-login: ## Login to docker repo version: ## Output the current version @echo $(VERSION) -testit: - if [ "$(IS_TAG)" = "0" ]; then\ - echo "Hello world";\ - fi diff --git a/README.md b/README.md index 55b3bda..2ad5f21 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,8 @@ JMXREMOTE_PASSWORD_FILE CATALINA_OPTS JAVA_OPTS [ -Djava.awt.headless=true ] +MASTER_NODE_NAME -- Enable clustering, when set this container will be the master node, should be set as the hostname from the perspective of MySQL login + ``` ## Data Persistence diff --git a/configuration.sh b/configuration.sh index e859740..6a57405 100755 --- a/configuration.sh +++ b/configuration.sh @@ -91,6 +91,16 @@ setup_java_opts() { echo_time "\n\nJAVA_OPTS: $JAVA_OPTS \n\n" } +create_cluster_properties(){ + echo_time "Creating the clustering properties file" +cat <<- EOF > /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/clustering.properties + cluster.settings.enabled=true + cluster.settings.monitor_frequency=180 + cluster.node[0]=$MASTER_NODE_NAME +EOF +} + + ########################################################## ####################### Executions ####################### @@ -104,6 +114,11 @@ else echo_time "/usr/local/tomcat/webapps/ROOT exists, skipping ROOT.war deploy" fi +if [ ! -z "$MASTER_NODE_NAME" ]; then + echo_time "Master node name is set to enable clustering: $MASTER_NODE_NAME" + create_cluster_properties +fi + setup_linux_logging_paths setup_remote_database