CCM NG: Helper script now uses Wildfly 12.0.0.Final

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5344 8810af33-2d31-482b-a856-94f89814c4df
ccm-docs
jensp 2018-03-10 15:10:59 +00:00
parent d530066ac9
commit 50abf43d82
1 changed files with 38 additions and 40 deletions

78
ccm.sh
View File

@ -2,11 +2,11 @@
# Provides shortcuts for working with LibreCCM # Provides shortcuts for working with LibreCCM
wildfly_version="10.1.0.Final" wildfly_version="12.0.0.Final"
wildfly_pid_file="./WILDFLY_PID" wildfly_pid_file="./WILDFLY_PID"
wildfly_home="" wildfly_home=""
# Helper function for finding Wildfly. First the function checks if the # Helper function for finding Wildfly. First the function checks if the
# environment variable JBOSS_HOME is set. If JBOSS_HOME is set is make sure # environment variable JBOSS_HOME is set. If JBOSS_HOME is set is make sure
# that JBOSS_HOME points to a valid Wildfly installation. If JBOSS_HOME is not # that JBOSS_HOME points to a valid Wildfly installation. If JBOSS_HOME is not
# set the function checks if Wildfly is installed in ./runtime. If there is no # set the function checks if Wildfly is installed in ./runtime. If there is no
@ -15,9 +15,9 @@ find_wildfly_home() {
#local wildfly_home="" #local wildfly_home=""
if [[ -n $JBOSS_HOME ]]; then if [[ -n $JBOSS_HOME ]]; then
echo "JBOSS_HOME = $JBOSS_HOME" echo "JBOSS_HOME = $JBOSS_HOME"
if [ -f "$JBOSS_HOME/bin/standalone.sh" ]; then if [ -f "$JBOSS_HOME/bin/standalone.sh" ]; then
echo $JBOSS_HOME echo $JBOSS_HOME
else else
echo -e "\e[41mJBOSS_HOME is set but there is no $JBOSS_HOME/bin/standalone.sh. Please make sure that JBOSS_HOME points to a valid Wildfly installation.\e[0m" echo -e "\e[41mJBOSS_HOME is set but there is no $JBOSS_HOME/bin/standalone.sh. Please make sure that JBOSS_HOME points to a valid Wildfly installation.\e[0m"
exit 1 exit 1
fi fi
@ -28,7 +28,7 @@ find_wildfly_home() {
wildfly_home=$(pwd) wildfly_home=$(pwd)
echo "wildfly_home is '$wildfly_home'" echo "wildfly_home is '$wildfly_home'"
popd popd
#echo $wildfly_home #echo $wildfly_home
else else
echo -e "\e[41mThere is no Wildfly in ./runtime/ neither is JBOSS_HOME set. Please install Wildfly $wildfly_version into ./runtime/ using install-runtime or set the JBOSS_HOME enviroment variable.\e[0m" echo -e "\e[41mThere is no Wildfly in ./runtime/ neither is JBOSS_HOME set. Please install Wildfly $wildfly_version into ./runtime/ using install-runtime or set the JBOSS_HOME enviroment variable.\e[0m"
exit 1 exit 1
@ -36,13 +36,13 @@ find_wildfly_home() {
} }
# Build the project site. # Build the project site.
# #
# @param $1 (optional): Maven profile to use. # @param $1 (optional): Maven profile to use.
# #
build_site() { build_site() {
echo "build_site_param1: $1" echo "build_site_param1: $1"
echo "build_site_param2: $2" echo "build_site_param2: $2"
if [ -n "$1" ]; then if [ -n "$1" ]; then
echo "Building project site with profile $1..." echo "Building project site with profile $1..."
mvn clean package site site:stage -Dmaven.test.failure.ignore=true -P$1 mvn clean package site site:stage -Dmaven.test.failure.ignore=true -P$1
@ -73,10 +73,10 @@ build_module() {
if [ -n "$1" ]; then if [ -n "$1" ]; then
if [ -n "$2" ]; then if [ -n "$2" ]; then
mvn clean package -P$2 -pl $1 -am mvn clean package -P$2 -pl $1 -am
else else
mvn clean package -pl $1 -am mvn clean package -pl $1 -am
fi fi
else else
echo "Usage: ccm.sh build-module MODULE [PROFILE]" echo "Usage: ccm.sh build-module MODULE [PROFILE]"
exit 1 exit 1
fi fi
@ -112,15 +112,15 @@ start_test_runtime() {
elif [ "$1"="tomee" ]; then elif [ "$1"="tomee" ]; then
echo "Not implemented yet." echo "Not implemented yet."
exit 1 exit 1
else else
echo "Unsupported runtime $1. Supported runtimes are wildfly and tomee." echo "Unsupported runtime $1. Supported runtimes are wildfly and tomee."
exit 1 exit 1
fi fi
} }
# Helper method for stopping the test runtime # Helper method for stopping the test runtime
# #
# @param $1 (mandantory): Runtime to stop # @param $1 (mandantory): Runtime to stop
# #
stop_test_runtime() { stop_test_runtime() {
@ -149,12 +149,12 @@ test_all() {
echo "...using a managed Wildfly container" echo "...using a managed Wildfly container"
find_wildfly_home find_wildfly_home
#local wildfly_home=$(find_wildfly_home) #local wildfly_home=$(find_wildfly_home)
echo "...using profile $1" echo "...using profile $1"
echo "" echo ""
if [ -n $STARTUP_TIMEOUT ]; then if [ -n $STARTUP_TIMEOUT ]; then
mvn clean test -Djboss.home=$wildfly_home -DstartuptimeoutInSeconds=$STARTUP_TIMEOUT -P$1 mvn clean test -Djboss.home=$wildfly_home -DstartuptimeoutInSeconds=$STARTUP_TIMEOUT -P$1
else else
mvn clean test -Djboss.home=$wildfly_home -P$1 mvn clean test -Djboss.home=$wildfly_home -P$1
fi fi
@ -163,7 +163,7 @@ test_all() {
if [[ $2 == "start" ]]; then if [[ $2 == "start" ]]; then
echo "...starting runtime" echo "...starting runtime"
start_test_runtime wildfly start_test_runtime wildfly
else else
echo "...runtime is started manually" echo "...runtime is started manually"
fi fi
@ -177,10 +177,10 @@ test_all() {
if [[ -n $1 ]]; then if [[ -n $1 ]]; then
echo -n -e "\e[43m" echo -n -e "\e[43m"
echo "Warning: " echo "Warning: "
echo "The provided profile starts with an unknown prefix. Tests" echo "The provided profile starts with an unknown prefix. Tests"
echo "which require a running application server may fail. " echo "which require a running application server may fail. "
echo -n -e "\e[0m" echo -n -e "\e[0m"
fi fi
mvn clean test mvn clean test
@ -226,7 +226,7 @@ test_module() {
if [[ -n $2 ]]; then if [[ -n $2 ]]; then
echo -n -e "\e[43m" echo -n -e "\e[43m"
echo "Warning: " echo "Warning: "
echo "The provided profile starts with an unknown prefix. Tests" echo "The provided profile starts with an unknown prefix. Tests"
echo "which require a running application server may fail. " echo "which require a running application server may fail. "
echo -n -e "\e[0m" echo -n -e "\e[0m"
fi fi
@ -276,14 +276,14 @@ run_test() {
if [[ -n $3 ]]; then if [[ -n $3 ]]; then
echo -n -e "\e[43m" echo -n -e "\e[43m"
echo "Warning: " echo "Warning: "
echo "The provided profile starts with an unknown prefix. Tests" echo "The provided profile starts with an unknown prefix. Tests"
echo "which require a running application server may fail. " echo "which require a running application server may fail. "
echo -n -e "\e[0m" echo -n -e "\e[0m"
fi fi
mvn clean test -Dtest=$2 -DfailIfNoTests=false -pl $1 -am mvn clean test -Dtest=$2 -DfailIfNoTests=false -pl $1 -am
fi fi
} }
@ -292,14 +292,14 @@ install_runtime() {
local runtime="" local runtime=""
if [ -z $1 ]; then if [ -z $1 ]; then
runtime="wildfly" runtime="wildfly"
else else
runtime=$1 runtime=$1
fi fi
echo "Installing runtime $runtime..." echo "Installing runtime $runtime..."
if [ $runtime = wildfly ]; then if [ $runtime = wildfly ]; then
if [ -d ./runtime/wildfly-$wildfly_version ]; then if [ -d ./runtime/wildfly-$wildfly_version ]; then
echo "Wildfly $wildfly_version is already installed as runtime. Exiting" echo "Wildfly $wildfly_version is already installed as runtime. Exiting"
exit 1 exit 1
fi fi
@ -308,10 +308,10 @@ install_runtime() {
mkdir ./runtime mkdir ./runtime
fi fi
pushd runtime pushd runtime
if [ -f wildfly-$wildfly_version.tar.gz ]; then if [ -f wildfly-$wildfly_version.tar.gz ]; then
echo "Wildfly $wildfly_version has already been downloaded, using existing archive." echo "Wildfly $wildfly_version has already been downloaded, using existing archive."
else else
wget http://download.jboss.org/wildfly/$wildfly_version/wildfly-$wildfly_version.tar.gz wget http://download.jboss.org/wildfly/$wildfly_version/wildfly-$wildfly_version.tar.gz
fi fi
@ -322,7 +322,7 @@ install_runtime() {
tar vxzf wildfly-$wildfly_version.tar.gz tar vxzf wildfly-$wildfly_version.tar.gz
echo "" echo ""
echo "Wildfly extracted successfully. Please provide a username and password for a Wildfly management user (admin):" echo "Wildfly extracted successfully. Please provide a username and password for a Wildfly management user (admin):"
echo "" echo ""
local username="" local username=""
while [ -z $username ]; do while [ -z $username ]; do
@ -373,7 +373,7 @@ install_runtime() {
elif [ $runtime = tomee ]; then elif [ $runtime = tomee ]; then
echo "Not implememented yet." echo "Not implememented yet."
else else
echo "Unsupported runtime. Supported runtimes are wildfly (default) and tomee." echo "Unsupported runtime. Supported runtimes are wildfly (default) and tomee."
fi fi
@ -458,27 +458,27 @@ stop_runtime() {
} }
show_help() { show_help() {
echo "ccm.sh is a helper script for building and running LibreCCM in a echo "ccm.sh is a helper script for building and running LibreCCM in a
development environment. It provides shortcuts for several Maven goals. The available subcommands are: development environment. It provides shortcuts for several Maven goals. The available subcommands are:
build-site [PROFILE] : Builds the Maven project site. build-site [PROFILE] : Builds the Maven project site.
build [PROFILE] : Build all LibreCCM modules. build [PROFILE] : Build all LibreCCM modules.
build-module MODULE [PROFILE] : Build a specific LibreCCM module. build-module MODULE [PROFILE] : Build a specific LibreCCM module.
test-all [[PROFILE] [start]] : Run all tests for all modules. test-all [[PROFILE] [start]] : Run all tests for all modules.
test-module MODULE [[PROFILE] [start]] : Run all tests for a specific test-module MODULE [[PROFILE] [start]] : Run all tests for a specific
LibreCCM module. LibreCCM module.
run-test MODULE TEST [[PROFILE] [start]]: Run a specific testsuite or a run-test MODULE TEST [[PROFILE] [start]]: Run a specific testsuite or a
single test method. single test method.
install-runtime [RUNTIME] : Download and install a runtime install-runtime [RUNTIME] : Download and install a runtime
(application server) into (application server) into
./runtime ./runtime
run [-r RUNTIME] [BUNDLE] : Run a runtime (application server) run [-r RUNTIME] [BUNDLE] : Run a runtime (application server)
help : Show this help message. help : Show this help message.
A detailed description of the subcommands is provided in ccm-readme.txt" A detailed description of the subcommands is provided in ccm-readme.txt"
exit 0; exit 0;
} }
@ -499,5 +499,3 @@ case $1 in
*) show_help ;; *) show_help ;;
esac esac