Skip to content

Commit

Permalink
Add clustering environment variable to create clustering.properties file
Browse files Browse the repository at this point in the history
Update travis build to always build release
  • Loading branch information
battlecow committed Dec 1, 2018
1 parent d027120 commit 3b4accc
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@ services:
- 'docker'

script:
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then
make release ;
else
make build ;
fi
- 'make release'
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions configuration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 #######################

Expand All @@ -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
Expand Down

0 comments on commit 3b4accc

Please sign in to comment.