[rhq] Changes to 'feature/gwt-upgrade'
by John Sanda
New branch 'feature/gwt-upgrade' available with the following commits:
commit 8f9b5a9128c2bfd1f6ed4b1f2a9cb12ff823fa04
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Dec 19 13:25:04 2011 -0500
[BZ 694221] Initial upgrade of GWT and SmartGWT
12 years, 4 months
[rhq] Branch 'release_jon2.4.2.GA' - release.sh rhq_bash.lib
by Jay Shaughnessy
release.sh | 967 +++++++++++++++++++++++++++++++++--------------------------
rhq_bash.lib | 253 +++++++++++++++
2 files changed, 804 insertions(+), 416 deletions(-)
New commits:
commit 2b7266c2eaa65b465ca24ae70a6bf802c163ec92
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Dec 19 12:44:42 2011 -0500
Update release script for build automation
diff --git a/release.sh b/release.sh
index b11a225..9847c0e 100755
--- a/release.sh
+++ b/release.sh
@@ -1,472 +1,607 @@
-#!/bin/sh
+#!/bin/bash
+#========================================================================================
+# Usage:
+# See usage function.
+#
+# Description:
+# RHQ release script. Supports tagging and branching model described in the community
+# wiki:
+# http://www.rhq-project.org/display/RHQ/Source+Control
+#
+# Options:
+# See usage function.
+#========================================================================================
+
+
+#include the utility library
+source `dirname $0`/rhq_bash.lib
+
+
+#========================================================================================
+# Description: Display usage information then abort the script.
+#========================================================================================
+usage()
+{
+ USAGE=$(
+cat << EOF
+USAGE: release.sh OPTIONS
+
+ --release-version=version [REQUIRED]
+ The release version to be tagged by this script.
+
+ --development-version=version [REQUIRED]
+ The version under which development will continue after tagging.
+
+ --release-branch=git_branch [REQUIRED]
+ Git branch to be used as base for tagging and/or branching.
+
+ --release-type=community|enterprise [REQUIRED]
+ Type of release.
+
+ --test-mode [OPTIONAL, DEFAULT]
+ Run this script in test mode. Create a test branch from release branch and perform tagging and version updates on this test branch.
-if [ -n "$RELEASE_DEBUG" ]; then
- echo "Debug output is enabled."
- set -x
-fi
+ --production-mode [OPTIONAL]
+ Run this script in production mode. Follow the official branching and tagging model.
+ --mode=test|production [OPTIONAL]
+ Used to directly set the script mode.
-# Constants
+ --branch [OPTIONAL]
+ Branch from release branch before tagging the release version. And updated development version on original branch.
-PROJECT_NAME="rhq"
-PROJECT_DISPLAY_NAME="RHQ"
-PROJECT_GIT_WEB_URL="http://git.fedorahosted.org/git/?p=rhq/rhq.git"
-TAG_PREFIX="RHQ"
-MINIMUM_MAVEN_VERSION="2.1.0"
+ --tag [OPTIONAL, DEFAULT]
+ Use the release branch to tag the release version. And update development version on the same branch.
+ --scm-strategy=tag|branch [OPTIONAL]
+ Used to directly set the scm strategy.
+
+ --extra-profile=extra_profile [OPTIONAL]
+ An extra maven profile to be used for all the maven commands.
+
+ --debug=[true|false] [OPTIONAL]
+ Set maven in debug mode. Default is false; true if option specified without argument.
+
+ --workspace=workspace_to_use [OPTIONAL]
+ Override the workspace used by default by the script.
+
+ --override-tag=[true|false] [OPTIONAL]
+ Override the tag if it already exists remotely. Default is false; true if option specified without argument.
+
+EOF
+)
-# Functions
+ EXAMPLE="release.sh --release-type=\"enterprise\" --release-version=\"5.0.0.GA\" --development-version=\"5.0.1-SNAPSHOT\" --release-branch=\"stefan/release_test\" --branch"
-abort()
+ abort "$@" "$USAGE" "$EXAMPLE"
+}
+
+
+#========================================================================================
+# Description: Validate and parse input arguments
+#========================================================================================
+parse_and_validate_options()
{
- echo >&2
- for ARG in "$@"; do
- echo "$ARG" >&2
+ print_function_information $FUNCNAME
+
+ RELEASE_VERSION=
+ DEVELOPMENT_VERSION=
+ RELEASE_BRANCH=
+ RELEASE_TYPE="community"
+ MODE="test"
+ SCM_STRATEGY="tag"
+ EXTRA_MAVEN_PROFILE=
+ DEBUG_MODE=false
+ OVERRIDE_TAG=false
+
+ short_options="h"
+ long_options="help,release-version:,development-version:,release-branch:,release-type:,test-mode,production-mode,mode:,branch,tag,scm-strategy:,extra-profile:,debug::,workspace:,override-tag::"
+
+ PROGNAME=${0##*/}
+ ARGS=$(getopt -s bash --options $short_options --longoptions $long_options --name $PROGNAME -- "$@" )
+ eval set -- "$ARGS"
+
+ while true; do
+ case $1 in
+ -h|--help)
+ usage
+ ;;
+ --release-version)
+ shift
+ RELEASE_VERSION="$1"
+ shift
+ ;;
+ --development-version)
+ shift
+ DEVELOPMENT_VERSION="$1"
+ shift
+ ;;
+ --release-branch)
+ shift
+ RELEASE_BRANCH="$1"
+ shift
+ ;;
+ --release-type)
+ shift
+ RELEASE_TYPE="$1"
+ shift
+ ;;
+ --test-mode)
+ MODE="test"
+ shift
+ ;;
+ --production-mode)
+ MODE="production"
+ shift
+ ;;
+ --mode)
+ shift
+ MODE="$1"
+ shift
+ ;;
+ --tag)
+ SCM_STRATEGY="tag"
+ shift
+ ;;
+ --branch)
+ SCM_STRATEGY="branch"
+ shift
+ ;;
+ --scm-strategy)
+ shift
+ SCM_STRATEGY="$1"
+ shift
+ ;;
+ --extra-profile)
+ shift
+ EXTRA_MAVEN_PROFILE="$1"
+ shift
+ ;;
+ --debug)
+ shift
+ case "$1" in
+ true)
+ DEBUG_MODE=true
+ shift
+ ;;
+ false)
+ DEBUG_MODE=false
+ shift
+ ;;
+ "")
+ DEBUG_MODE=true
+ shift
+ ;;
+ *)
+ DEBUG_MODE=false
+ shift
+ ;;
+ esac
+ ;;
+ --workspace)
+ shift
+ WORKSPACE=$1
+ shift
+ ;;
+ --override-tag)
+ shift
+ case "$1" in
+ true)
+ OVERRIDE_TAG=true
+ shift
+ ;;
+ false)
+ OVERRIDE_TAG=false
+ shift
+ ;;
+ "")
+ OVERRIDE_TAG=true
+ shift
+ ;;
+ *)
+ OVERRIDE_TAG=false
+ shift
+ ;;
+ esac
+ ;;
+ --)
+ shift
+ break
+ ;;
+ *)
+ usage
+ ;;
+ esac
done
- exit 1
-}
-usage()
-{
- abort "$@" "Usage: $EXE community|enterprise RELEASE_VERSION DEVELOPMENT_VERSION RELEASE_BRANCH GIT_USERNAME test|production" "Example: $EXE enterprise 3.0.0.GA 3.0.0-SNAPSHOT release-3.0.0 ips test"
-}
+ if [ -z "$RELEASE_VERSION" ];
+ then
+ usage "Release version not specified!"
+ fi
+
+ if [ -z "$DEVELOPMENT_VERSION" ];
+ then
+ usage "Development version not specified!"
+ fi
+
+ if [ -z "$RELEASE_BRANCH" ];
+ then
+ usage "Release branch not specified!"
+ fi
+
+ if [ "$RELEASE_TYPE" != "community" ] && [ "$RELEASE_TYPE" != "enterprise" ]; then
+ usage "Invalid release type: $RELEASE_TYPE (valid release types are 'community' or 'enterprise')"
+ fi
+ if [ "$MODE" != "test" ] && [ "$MODE" != "production" ]; then
+ usage "Invalid script mode: $MODE (valid modes are 'test' or 'production')"
+ fi
-# Process command line args.
+ if [ "$SCM_STRATEGY" != "tag" ] && [ "$SCM_STRATEGY" != "branch" ]; then
+ usage "Invalid scm strategy: $SCM_STRATEGY (valid scm strategies are 'tag' or 'branch')"
+ fi
-EXE=`basename $0`
-if [ "$#" -ne 6 ]; then
- usage
-fi
-RELEASE_TYPE="$1"
-if [ "$RELEASE_TYPE" != "community" ] && [ "$RELEASE_TYPE" != "enterprise" ]; then
- usage "Invalid release type: $RELEASE_TYPE (valid release types are 'community' or 'enterprise')"
-fi
-RELEASE_VERSION="$2"
-DEVELOPMENT_VERSION="$3"
-RELEASE_BRANCH="$4"
-GIT_USERNAME="$5"
-MODE="$6"
-if [ "$MODE" != "test" ] && [ "$MODE" != "production" ]; then
- usage "Invalid mode: $MODE (valid modes are 'test' or 'production')"
-fi
+ print_centered "Script Options"
+ script_options=( "RELEASE_VERSION" "DEVELOPMENT_VERSION" "RELEASE_BRANCH" "RELEASE_TYPE" \
+ "MODE" "SCM_STRATEGY" )
+ print_variables "${script_options[@]}"
+}
-if [ "$MODE" = "production" ]; then
- if [ -z "$JBOSS_ORG_USERNAME" ] || [ -z "$JBOSS_ORG_PASSWORD" ]; then
- usage "In production mode, jboss.org credentials must be specified via the JBOSS_ORG_USERNAME and JBOSS_ORG_PASSWORD environment variables."
- fi
-fi
+#========================================================================================
+# Description: Set all the local and environment variables required by the script.
+#========================================================================================
+set_local_and_environment_variables()
+{
+ print_function_information $FUNCNAME
-# Make sure JAVA_HOME points to a valid JDK 1.6+ install.
+ # Set environment variables
+ MAVEN_OPTS="-Xms512M -Xmx1024M -XX:PermSize=128M -XX:MaxPermSize=256M"
+ export MAVEN_OPTS
-if [ -z "$JAVA_HOME" ]; then
- abort "JAVA_HOME environment variable is not set - JAVA_HOME must point to a JDK (not JRE) 6 install dir."
-fi
-if [ ! -d "$JAVA_HOME" ]; then
- abort "JAVA_HOME ($JAVA_HOME) does not exist or is not a directory - JAVA_HOME must point to a JDK (not JRE) 6 install dir."
-fi
+ # Set various local variables
+ if [ -n "$WORKSPACE" ]; then
+ echo "Running script in a Hudson job."
+ MAVEN_LOCAL_REPO_DIR="$WORKSPACE/.m2/repository"
+ if [ ! -d "$MAVEN_LOCAL_REPO_DIR" ]; then
+ mkdir -p "$MAVEN_LOCAL_REPO_DIR"
+ fi
+ MAVEN_SETTINGS_FILE="$WORKSPACE/.m2/settings.xml"
+ else
+ MAVEN_LOCAL_REPO_DIR="$HOME/.m2/repository"
+ MAVEN_SETTINGS_FILE="$HOME/.m2/settings.xml"
+ fi
-echo "Prepending $JAVA_HOME/bin to PATH..."
-PATH="$JAVA_HOME/bin:$PATH"
+ MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE -Dmaven.repo.local=$MAVEN_LOCAL_REPO_DIR --batch-mode --errors"
-if ! which java >/dev/null 2>&1; then
- abort "java not found in PATH ($PATH) - JAVA_HOME must point to a JDK (not JRE) 6 install dir."
-fi
+ if [ -n "$EXTRA_MAVEN_PROFILE" ];
+ then
+ MAVEN_ARGS="$MAVEN_ARGS --activate-profiles $EXTRA_MAVEN_PROFILE,enterprise,dist,release"
+ else
+ MAVEN_ARGS="$MAVEN_ARGS --activate-profiles enterprise,dist,release"
+ fi
-if ! which javac >/dev/null 2>&1; then
- abort "javac not found in PATH ($PATH) - JAVA_HOME must point to a JDK (not JRE) 6 install dir."
-fi
-if ! javap java.util.Deque >/dev/null 2>&1; then
- abort "java.util.Deque not found - Java version appears to be less than 1.6 - Jave version must be 1.6 or later."
-fi
+ if [ "$RELEASE_TYPE" = "enterprise" ];
+ then
+ MAVEN_ARGS="$MAVEN_ARGS -Dexclude-webdav -Pdisable-tags -DTagManager=false -Dfiltered.location=target/filtered-sources/java"
+ fi
-# TODO: Check that JDK version is < 1.7.
+ if [ -n "$DEBUG_MODE" ]; then
+ echo "Maven debug enabled"
+ MAVEN_ARGS="$MAVEN_ARGS --debug"
+ fi
+ TAG_PREFIX="RHQ"
+ TAG_VERSION=`echo $RELEASE_VERSION | sed 's/[\.|-]/_/g'`
+ RELEASE_TAG="${TAG_PREFIX}_${TAG_VERSION}"
+
+ # Set the system character encoding to ISO-8859-1 to ensure i18log reads its
+ # messages and writes its resource bundle properties files in that encoding,
+ # since that is how the German and French I18NMessage annotation values are
+ # encoded and the encoding used by i18nlog to read in resource bundle
+ # property files.
+ LANG=en_US.iso8859
+ export LANG
+
+ # Print out a summary of the environment.
+ print_centered "Environment Variables"
+ environment_variables=( "JAVA_HOME" "M2_HOME" "MAVEN_OPTS" "PATH" "LANG" )
+ print_variables "${environment_variables[@]}"
+
+ print_centered "Local Variables"
+ local_variables=( "MAVEN_LOCAL_REPO_DIR" "MAVEN_SETTINGS_FILE" "MAVEN_ARGS" \
+ "JBOSS_ORG_USERNAME" )
+ print_variables "${local_variables[@]}"
+}
-# If this is an enterprise release, make sure JAVA5_HOME points to a valid JDK 1.5 install.
-# We need this to validate only Java 5 or earlier APIs are used in all modules, except the CLI, which requires Java 6.
-if [ "$RELEASE_TYPE" = "enterprise" ]; then
- if [ -z "$JAVA5_HOME" ]; then
- abort "JAVA5_HOME environment variable is not set - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
- fi
+#========================================================================================
+# Description: Perform version update process and test the outcome by building
+# from source.
+#========================================================================================
+run_release_version_and_tag_process()
+{
+ print_function_information $FUNCNAME
+
+ echo "1) Perform a test build before changing version."
+ mvn clean install $MAVEN_ARGS -Ddbreset
+ [ "$?" -ne 0 ] && abort "Test build failed. Please see output for details, fix any issues, then try again."
+
+ echo "2) Run a maven cleanup to remove all the artifacts from previous build, this cleans module target dirs."
+ mvn clean $MAVEN_ARGS
+ [ "$?" -ne 0 ] && abort "Failed to cleanup snbapshot jars produced by test build from module target dirs. Please see above Maven output for details, fix any issues, then try again."
+
+ echo "3) Increment version on all poms."
+ mvn versions:set versions:use-releases -DnewVersion=$RELEASE_VERSION -DallowSnapshots=false -DgenerateBackupPoms=false
+ [ "$?" -ne 0 ] && abort "Version set failed. Please see output for details, fix any issues, then try again."
+
+ echo "4) Perform a test build with the new version."
+ mvn clean install $MAVEN_ARGS -DskipTests=true -Ddbsetup-do-not-check-schema=true
+ [ "$?" -ne 0 ] && abort "Maven build for new version failed. Please see output for details, fix any issues, then try again."
+
+ echo "6) Cleanup again after this test build before commiting changes."
+ mvn clean $MAVEN_ARGS
+ [ "$?" -ne 0 ] && abort "Failed to cleanup snbapshot jars produced by test build from module target dirs. Please see above Maven output for details, fix any issues, then try again."
+
+ echo "7) Commit the change in version; if everything went well so far then this is a good tag."
+ git add -u
+ [ "$?" -ne 0 ] && abort "Adding modified files to commit failed."
+ git commit -m "tag $RELEASE_TAG"
+ [ "$?" -ne 0 ] && abort "The commit with version modified files failed."
+
+ echo "8) Tag the current source."
+ if [ "$OVERRIDE_TAG" ];
+ then
+ git tag --force "$RELEASE_TAG"
+ [ "$?" -ne 0 ] && abort "Force tagging failed."
+ else
+ git tag "$RELEASE_TAG"
+ [ "$?" -ne 0 ] && abort "Tagging failed"
+ fi
- if [ ! -d "$JAVA5_HOME" ]; then
- abort "JAVA5_HOME ($JAVA5_HOME) does not exist or is not a directory - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
- fi
+ echo "9) Merge any remote changes into the local branch to be able to push tag and version change. This will fail if the merge process requires manual merges."
+ git pull origin "$BUILD_BRANCH"
+ [ "$?" -ne 0 ] && abort "Merge with remote $BUILD_BRANCH failed."
- if [ ! -x "$JAVA5_HOME/bin/java" ]; then
- abort "$JAVA5_HOME/bin/java does not exist or is not executable - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
- fi
-
- if [ ! -x "$JAVA5_HOME/bin/javac" ]; then
- abort "$JAVA5_HOME/bin/javac does not exist or is not executable - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
- fi
+ echo "10) If everything went well so far than means all the changes can be pushed!!!"
+ git push origin "refs/heads/$BUILD_BRANCH"
+ [ "$?" -ne 0 ] && abort "$BUILD_BRANCH branch push to origin failed."
+ git push origin "refs/tags/$RELEASE_TAG"
+ [ "$?" -ne 0 ] && abort "$BUILD_BRANCH branch push to origin failed."
+}
- if ! "$JAVA5_HOME/bin/javap" java.lang.Enum >/dev/null 2>&1; then
- abort "java.lang.Enum not found - JAVA5_HOME ($JAVA5_HOME) version appears to be less than 1.5 - version must be 1.5.x."
- fi
- if "$JAVA5_HOME/bin/javap" java.util.Deque >/dev/null 2>&1; then
- abort "java.util.Deque found - JAVA5_HOME ($JAVA5_HOME) version appears to be greater than or equal to 1.6 - version must be 1.5.x."
- fi
-fi
+#========================================================================================
+# Description: Update the version for the development branch.
+#========================================================================================
+update_development_version()
+{
+ print_function_information $FUNCNAME
+ echo "1) Set version to the current development version"
+ mvn versions:set versions:use-releases -DnewVersion=$DEVELOPMENT_VERSION -DallowSnapshots=false -DgenerateBackupPoms=false
+ [ "$?" -ne 0 ] && abort "Version set failed. Please see output for details, fix any issues, then try again."
-# Make sure M2_HOME points to a valid Maven 2.1.x or 2.2.x install.
+ echo "2) Commit the change in version."
+ git add -u
+ [ "$?" -ne 0 ] && abort "Adding modified files to commit failed."
+ git commit -m "development RHQ_$DEVELOPMENT_VERSION"
+ [ "$?" -ne 0 ] && abort "The commit with version modified files failed."
-if [ -z "$M2_HOME" ]; then
- abort "M2_HOME environment variable is not set - M2_HOME must point to a Maven, $MINIMUM_MAVEN_VERSION or later, install dir."
-fi
+ echo "3) Merge any remote changes into the local branch to be able to push tag and version change. This will fail if the merge process requires manual merges."
+ git pull origin "$BUILD_BRANCH"
+ [ "$?" -ne 0 ] && abort "Merge with remote $BUILD_BRANCH failed."
-if [ ! -d "$M2_HOME" ]; then
- abort "M2_HOME ($M2_HOME) does not exist or is not a directory - M2_HOME must point to a Maven, $MINIMUM_MAVEN_VERSION or later, install dir."
-fi
+ echo "4) If everything went well so far than means all the changes can be pushed!!!"
+ git push origin "refs/heads/$BUILD_BRANCH"
+ [ "$?" -ne 0 ] && abort "$BUILD_BRANCH branch push to origin failed."
+}
-echo "Prepending $M2_HOME/bin to PATH..."
-PATH="$M2_HOME/bin:$PATH"
-unalias mvn 2>/dev/null
-unset -f mvn 2>/dev/null
-
-if ! which mvn >/dev/null 2>&1; then
- abort "mvn not found in PATH ($PATH) - M2_HOME must point to a Maven, $MINIMUM_MAVEN_VERSION or later, install dir."
-fi
-
-mvn -version >/dev/null
-[ $? -ne 0 ] && abort "mvn --version failed with exit code $?."
-MAVEN_VERSION=`mvn -version | head -1 | sed 's|[^0-9]*\([^ ]*\).*|\1|'`
-if echo $MAVEN_VERSION | grep -v "^2.[12]"; then
- abort "Unsupported Maven version - $MAVEN_VERSION. Only Maven 2.1.x or 2.2.x are supported. Please update the value of M2_HOME, then try again."
-fi
-
-
-# Make sure git 1.6.x or 1.7.x is in the PATH.
-
-if ! which git >/dev/null 2>&1; then
- abort "git not found in PATH ($PATH)."
-fi
-
-git --version >/dev/null
-[ $? -ne 0 ] && abort "git --version failed with exit code $?."
-GIT_VERSION=`git --version | sed 's|[^0-9]*\([^ ]*\).*|\1|'`
-if echo $GIT_VERSION | grep -v "^1.[67]"; then
- abort "Unsupported git version - $GIT_VERSION. Only git 1.6.x or 1.7.x are supported. Please add a directory containing a supported version of git to your PATH, then try again."
-fi
-
-
-# Set various environment variables.
-
-MAVEN_OPTS="-Xms512M -Xmx1024M -XX:PermSize=128M -XX:MaxPermSize=256M"
-export MAVEN_OPTS
-
-
-# Set various local variables.
-
-if [ -n "$HUDSON_URL" ] && [ -n "$WORKSPACE" ]; then
- echo "We appear to be running in a Hudson job."
- WORKING_DIR="$WORKSPACE"
- MAVEN_LOCAL_REPO_DIR="$HOME/.m2/hudson-release-$RELEASE_TYPE-repository"
- MAVEN_SETTINGS_FILE="$HOME/.m2/hudson-$JOB_NAME-settings.xml"
-elif [ -z "$WORKING_DIR" ]; then
- WORKING_DIR="$HOME/release/rhq"
- MAVEN_LOCAL_REPO_DIR="$HOME/release/m2-repository"
- MAVEN_SETTINGS_FILE="$HOME/release/m2-settings.xml"
-fi
-
-PROJECT_GIT_URL="ssh://${GIT_USERNAME}@git.fedorahosted.org/git/rhq/rhq.git"
-
-MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE --batch-mode --errors -Penterprise,dist,release"
-# TODO: We may eventually want to reenable tests for production releases.
-#if [ "$MODE" = "test" ]; then
-# MAVEN_ARGS="$MAVEN_ARGS -Dmaven.test.skip=true"
-#fi
-MAVEN_ARGS="$MAVEN_ARGS -Dmaven.test.skip=true"
-if [ "$RELEASE_TYPE" = "enterprise" ]; then
- MAVEN_ARGS="$MAVEN_ARGS -Dexclude-webdav -Djava5.home=$JAVA5_HOME/jre"
-fi
-if [ -n "$RELEASE_DEBUG" ]; then
- MAVEN_ARGS="$MAVEN_ARGS --debug"
-fi
-if [ -n "$RELEASE_ADDITIONAL_MAVEN_ARGS" ]; then
- MAVEN_ARGS="$MAVEN_ARGS $RELEASE_ADDITIONAL_MAVEN_ARGS"
-fi
-if [ -z "$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS" ]; then
- MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS="6"
-fi
-
-# TODO: We may eventually want to reenable publishing of enterprise artifacts.
-if [ "$MODE" = "production" ] && [ "$RELEASE_TYPE" = "community" ]; then
- MAVEN_RELEASE_PERFORM_GOAL="deploy"
-else
- MAVEN_RELEASE_PERFORM_GOAL="install"
-fi
-
-
-TAG_VERSION=`echo $RELEASE_VERSION | sed 's/\./_/g'`
-RELEASE_TAG="${TAG_PREFIX}_${TAG_VERSION}"
-
-
-# Set the system character encoding to ISO-8859-1 to ensure i18log reads its
-# messages and writes its resource bundle properties files in that encoding,
-# since that is how the German and French I18NMessage annotation values are
-# encoded and the encoding used by i18nlog to read in resource bundle
-# property files.
-LANG=en_US.iso8859
-export LANG
-
-
-# Print out a summary of the environment.
-
-echo
-echo "========================== Environment Variables =============================="
-echo "JAVA_HOME=$JAVA_HOME"
-[ "$RELEASE_TYPE" = "enterprise" ] && echo "JAVA5_HOME=$JAVA5_HOME"
-echo "M2_HOME=$M2_HOME"
-echo "MAVEN_OPTS=$MAVEN_OPTS"
-echo "PATH=$PATH"
-echo "LANG=$LANG"
-echo "============================= Local Variables ================================="
-echo "WORKING_DIR=$WORKING_DIR"
-echo "PROJECT_NAME=$PROJECT_NAME"
-echo "PROJECT_GIT_URL=$PROJECT_GIT_URL"
-echo "RELEASE_TYPE=$RELEASE_TYPE"
-echo "RELEASE_VERSION=$RELEASE_VERSION"
-echo "DEVELOPMENT_VERSION=$DEVELOPMENT_VERSION"
-echo "RELEASE_BRANCH=$RELEASE_BRANCH"
-echo "RELEASE_TAG=$RELEASE_TAG"
-echo "MODE=$MODE"
-echo "MAVEN_LOCAL_REPO_DIR=$MAVEN_LOCAL_REPO_DIR"
-echo "MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS=$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS"
-echo "MAVEN_SETTINGS_FILE=$MAVEN_SETTINGS_FILE"
-echo "MAVEN_ARGS=$MAVEN_ARGS"
-echo "MAVEN_RELEASE_PERFORM_GOAL=$MAVEN_RELEASE_PERFORM_GOAL"
-echo "JBOSS_ORG_USERNAME=$JBOSS_ORG_USERNAME"
-echo "============================= Program Versions ================================"
-git --version
-echo
-java -version
-echo
-mvn --version | head -1
-echo "==============================================================================="
-echo
-
-
-# Clean the Maven local repo if it hasn't been purged recently.
-
-if [ -f "$MAVEN_LOCAL_REPO_DIR" ]; then
- if [ "$MODE" = "production" ]; then
- echo "Purging MAVEN_LOCAL_REPO_DIR ($MAVEN_LOCAL_REPO_DIR) since this is a production build..."
- #rm -rf "$MAVEN_LOCAL_REPO_DIR"
- else
- OUTPUT=`find "$MAVEN_LOCAL_REPO_DIR" -maxdepth 0 -mtime $MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS`
- if [ -n "$OUTPUT" ]; then
- echo "MAVEN_LOCAL_REPO_DIR ($MAVEN_LOCAL_REPO_DIR) has existed for more than $MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS hours - purging it for a clean-clean build..."
- rm -rf "$MAVEN_LOCAL_REPO_DIR"
+#========================================================================================
+# Description: Perform tag verification process
+# 1) if the tag already exists on the remote repo than abort the script
+# 2) if the tag exists only locally then delete it, that means there was
+# error during the previous run of this script. Tags are committed to
+# repo only this script runs successfully.
+#========================================================================================
+verify_tags()
+{
+ print_function_information $FUNCNAME
+
+ # If the specified tag already exists remotely and we're in production mode, then abort. If it exists and
+ # we're in test mode, delete it
+ EXISTING_REMOTE_TAG=`git ls-remote --tags origin "$RELEASE_TAG"`
+ if [ -n "$EXISTING_REMOTE_TAG" ];
+ then
+ if [ "$OVERRIDE_TAG" ];
+ then
+ echo "A remote tag named $RELEASE_TAG already exists, but will be overriden."
+ else
+ abort "A remote tag named $RELEASE_TAG already exists - aborting"
fi
fi
-
-fi
-mkdir -p "$MAVEN_LOCAL_REPO_DIR"
-
-
-# Create the Maven settings file.
-cat <<EOF >"${MAVEN_SETTINGS_FILE}"
-<settings>
- <localRepository>$MAVEN_LOCAL_REPO_DIR</localRepository>
-
- <profiles>
-
- <profile>
- <id>release</id>
- <properties>
- <rhq.test.ds.server-name>hudson-qe.rhq.rdu.redhat.com</rhq.test.ds.server-name>
- <rhq.test.ds.port>5432</rhq.test.ds.port>
- <rhq.test.ds.db-name>rhq_release_tag</rhq.test.ds.db-name>
- <rhq.test.ds.connection-url>jdbc:postgresql://hudson-qe.rhq.rdu.redhat.com:5432/rhq_release_tag</rhq.test.ds.connection-url>
- <rhq.test.ds.user-name>rhqadmin</rhq.test.ds.user-name>
- <rhq.test.ds.password>rhqadmin</rhq.test.ds.password>
- <rhq.test.ds.type-mapping>PostgreSQL</rhq.test.ds.type-mapping>
- <rhq.test.ds.driver-class>org.postgresql.Driver</rhq.test.ds.driver-class>
- <rhq.test.ds.xa-datasource-class>org.postgresql.xa.PGXADataSource</rhq.test.ds.xa-datasource-class>
- <rhq.test.ds.hibernate-dialect>org.hibernate.dialect.PostgreSQLDialect</rhq.test.ds.hibernate-dialect>
- <!-- quartz properties -->
- <rhq.test.quartz.driverDelegateClass>org.quartz.impl.jdbcjobstore.PostgreSQLDelegate</rhq.test.quartz.driverDelegateClass>
- <rhq.test.quartz.selectWithLockSQL>SELECT * FROM {0}LOCKS ROWLOCK WHERE LOCK_NAME = ? FOR UPDATE</rhq.test.quartz.selectWithLockSQL>
- <rhq.test.quartz.lockHandlerClass>org.quartz.impl.jdbcjobstore.StdRowLockSemaphore</rhq.test.quartz.lockHandlerClass>
-
- <DatabaseTest.nofail>true</DatabaseTest.nofail>
-
- <rhq.testng.excludedGroups>agent-comm,comm-client,postgres-plugin,native-system</rhq.testng.excludedGroups>
- </properties>
- </profile>
-
- </profiles>
-
- <!-- This is used by the deploy plugin to publish release artifacts to the jboss.org Nexus repo. -->
- <servers>
- <server>
- <id>jboss-releases-repository</id>
- <username>$JBOSS_ORG_USERNAME</username>
- <password>$JBOSS_ORG_PASSWORD</password>
- </server>
- </servers>
-
-</settings>
-EOF
-# Clone and/or checkout the source from git.
+ # See if the specified tag already exists locally - if so, delete it (even if in production mode).
+ # If the tag is just local then there were errors during the last run; no harm in removing it.
+ EXISTING_LOCAL_TAG=`git tag -l "$RELEASE_TAG"`
+ if [ -n "$EXISTING_LOCAL_TAG" ];
+ then
+ echo "A local tag named $RELEASE_TAG already exists - deleting it..."
+ git tag -d "$RELEASE_TAG"
+ [ "$?" -ne 0 ] && abort "Failed to delete local tag ($RELEASE_TAG)."
+ fi
+}
+
-if [ -d "$WORKING_DIR" ]; then
- cd "$WORKING_DIR"
+#========================================================================================
+# Description: Run the validation process for all the system utilities needed by
+# the script. At the end print the version of each utility.
+#========================================================================================
+validate_system_utilities()
+{
+ print_function_information $FUNCNAME
+
+ # TODO: Check that JDK version is < 1.7.
+
+ validate_java_6
+
+ validate_java_5
+
+ validate_maven
+
+ validate_git
+
+ print_centered "Program Versions"
+ program_versions=("git --version" "java -version" "mvn --version")
+ print_program_versions "${program_versions[@]}"
+}
+
+
+#========================================================================================
+# Description: Prints the release information.
+#========================================================================================
+print_release_information()
+{
+ print_function_information $FUNCNAME
+
+ echo
+ print_centered "Release Info"
+ echo "Version: $RELEASE_VERSION"
+ echo "Branch URL: http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=shortlog;h=refs/heads/$R..."
+ echo "Tag URL: http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=shortlog;h=refs/tags/$RE..."
+ print_centered "="
+}
+
+
+#========================================================================================
+# Description: Checkout release branch.
+#========================================================================================
+checkout_release_branch()
+{
+ print_function_information $FUNCNAME
+
+ # Checkout the source from git, assume that the git repo is already cloned
git status >/dev/null 2>&1
GIT_STATUS_EXIT_CODE=$?
# Note, git 1.6 and earlier returns an exit code of 1, rather than 0, if there are any uncommitted changes,
- # and git 1.7 returns 0, so we check if the exit code is less than or equal to 1 to determine if $WORKING_DIR
+ # and git 1.7 returns 0, so we check if the exit code is less than or equal to 1 to determine if current folder
# is truly a git working copy.
- if [ "$GIT_STATUS_EXIT_CODE" -le 1 ]; then
+ if [ "$GIT_STATUS_EXIT_CODE" -le 1 ];
+ then
echo "Checking out a clean copy of the release branch ($RELEASE_BRANCH)..."
git fetch origin "$RELEASE_BRANCH"
[ "$?" -ne 0 ] && abort "Failed to fetch release branch ($RELEASE_BRANCH)."
- git checkout "$RELEASE_BRANCH" 2>/dev/null
- if [ "$?" -ne 0 ]; then
- git checkout --track -b "$RELEASE_BRANCH" "origin/$RELEASE_BRANCH"
+
+ git checkout --track "origin/$RELEASE_BRANCH"
+ if [ "$?" -ne 0 ];
+ then
+ git checkout "$RELEASE_BRANCH"
fi
- [ "$?" -ne 0 ] && abort "Failed to checkout release branch ($RELEASE_BRANCH)."
+ [ "$?" -ne 0 ] && abort "Failed to checkout release branch ($RELEASE_BRANCH)."
+
git reset --hard "origin/$RELEASE_BRANCH"
[ "$?" -ne 0 ] && abort "Failed to reset release branch ($RELEASE_BRANCH)."
+
git clean -dxf
[ "$?" -ne 0 ] && abort "Failed to clean release branch ($RELEASE_BRANCH)."
- git pull
+
+ git pull origin $RELEASE_BRANCH
[ "$?" -ne 0 ] && abort "Failed to update release branch ($RELEASE_BRANCH)."
else
- echo "$WORKING_DIR does not appear to be a git working directory ('git status' returned $GIT_STATUS_EXIT_CODE) - removing it so we can freshly clone the repo..."
- cd ..
- rm -rf "$WORKING_DIR"
- [ "$?" -ne 0 ] && abort "Failed to remove bogus working directory ($WORKING_DIR)."
+ echo "Current folder does not appear to be a git working directory ('git status' returned $GIT_STATUS_EXIT_CODE) - removing it so we can freshly clone the repo..."
+ fi
+}
+
+
+#========================================================================================
+# Description: Checkout or create the build branch for the release process.
+#========================================================================================
+checkout_build_branch_for_release()
+{
+ print_function_information $FUNCNAME
+
+ # if this is a test build then create a temporary build branch off of RELEASE_BRANCH. This allows checkins to
+ # continue in RELEASE_BRANCH without affecting the release plugin work, which will fail if the branch contents
+ # change before it completes.
+ if [ "$MODE" = "test" ];
+ then
+ BUILD_BRANCH="${RELEASE_BRANCH}-test-build"
+ # delete the branch if it exists, so we can recreate it fresh
+ EXISTING_BUILD_BRANCH=`git ls-remote --heads origin "$BUILD_BRANCH"`
+ if [ -n "$EXISTING_BUILD_BRANCH" ];
+ then
+ echo "Deleting remote branch origin/$BUILD_BRANCH"
+ git branch -D -r "origin/$BUILD_BRANCH"
+ echo "Deleting local branch $BUILD_BRANCH"
+ git branch -D "$BUILD_BRANCH"
+ fi
+
+ echo "Creating and checking out local branch $BUILD_BRANCH from $RELEASE_BRANCH"
+ git checkout -b "$BUILD_BRANCH"
+ else
+ if [ "$SCM_STRATEGY" = "tag" ];
+ then
+ BUILD_BRANCH="${RELEASE_BRANCH}"
+ else
+ BUILD_BRANCH="release-$RELEASE_VERSION"
+ # delete the branch if it exists, so we can recreate it fresh
+ EXISTING_BUILD_BRANCH=`git ls-remote --heads origin "$BUILD_BRANCH"`
+ if [ -n "$EXISTING_BUILD_BRANCH" ];
+ then
+ abort "Remote repository already contains $BUILD_BRANCH."
+ fi
+
+ echo "Creating and checking out local branch $BUILD_BRANCH from $RELEASE_BRANCH"
+ git checkout -b "$BUILD_BRANCH"
+ fi
fi
-fi
-if [ ! -d "$WORKING_DIR" ]; then
- echo "Cloning the $PROJECT_NAME git repo (this will take about 10-15 minutes)..."
- git clone "$PROJECT_GIT_URL" "$WORKING_DIR"
- [ "$?" -ne 0 ] && abort "Failed to clone $PROJECT_NAME git repo ($PROJECT_GIT_URL)."
- cd "$CLONE_DIR"
- git checkout --track -b $RELEASE_BRANCH "origin/$RELEASE_BRANCH"
- [ "$?" -ne 0 ] && abort "Failed to checkout release branch ($RELEASE_BRANCH)."
-fi
-
-
-# if this is a test build then create a temporary build branch off of RELEASE_BRANCH. This allows checkins to
-# continue in RELEASE_BRANCH without affecting the release plugin work, which will fail if the branch contents
-# change before it completes.
-if [ "$MODE" = "production" ]; then
- BUILD_BRANCH="${RELEASE_BRANCH}"
-else
- BUILD_BRANCH="${RELEASE_BRANCH}-test-build"
-# delete the branch if it exists, so we can recreate it fresh
- EXISTING_BUILD_BRANCH=`git ls-remote --heads origin "$BUILD_BRANCH"`
- if [ -n "$EXISTING_BUILD_BRANCH" ]; then
- echo "Deleting remote branch origin/$BUILD_BRANCH"
- git branch -D -r "origin/$BUILD_BRANCH"
- echo "Deleting local branch $BUILD_BRANCH"
- git branch -D "$BUILD_BRANCH"
- fi
- echo "Creating and checking out local branch $BUILD_BRANCH from $RELEASE_BRANCH"
- git checkout -b "$BUILD_BRANCH"
- echo "Creating remote branch $BUILD_BRANCH"
- git pull origin "$BUILD_BRANCH"
- git push origin "$BUILD_BRANCH"
-fi
-
-
-# We should now have the build_branch checked out
-echo "Current Branch is $BUILD_BRANCH"
-
-# If the specified tag already exists remotely and we're in production mode, then abort. If it exists and
-# we're in test mode, delete it
-
-EXISTING_REMOTE_TAG=`git ls-remote --tags origin "$RELEASE_TAG"`
-if [ -n "$EXISTING_REMOTE_TAG" ] && [ "$MODE" = "production" ]; then
- abort "A remote tag named $RELEASE_TAG already exists - aborting, since we are in production mode..."
-fi
-
-if [ -n "$EXISTING_REMOTE_TAG" ] && [ "$MODE" = "test" ]; then
- echo "A remote tag named $RELEASE_TAG already exists - deleting it, since we are in test mode..."
- git push origin ":refs/tags/$RELEASE_TAG"
- [ "$?" -ne 0 ] && abort "Failed to delete remote tag ($RELEASE_TAG)."
-fi
-
-
-# See if the specified tag already exists locally - if so, delete it (even if in production mode).
-
-EXISTING_LOCAL_TAG=`git tag -l "$RELEASE_TAG"`
-if [ -n "$EXISTING_LOCAL_TAG" ]; then
- echo "A local tag named $RELEASE_TAG already exists - deleting it..."
- git tag -d "$RELEASE_TAG"
- [ "$?" -ne 0 ] && abort "Failed to delete local tag ($RELEASE_TAG)."
-fi
-
-# Run a test build before tagging. This will publish the snapshot artifacts to the local repo to "bootstrap" the repo.
-
-echo "Building project to ensure tests pass and to bootstrap local Maven repo (this will take about 15-30 minutes)..."
-# NOTE: There is no need to do a mvn clean below, since we just did either a clone or clean checkout above.
-mvn install $MAVEN_ARGS -Ddbreset
-[ "$?" -ne 0 ] && abort "Test build failed. Please see above Maven output for details, fix any issues, then try again."
-echo
-echo "Test build succeeded!"
-
-
-# Clean up the snapshot jars produced by the test build from module target dirs.
-
-echo "Cleaning up snapshot jars produced by test build from module target dirs..."
-mvn clean $MAVEN_ARGS
-[ "$?" -ne 0 ] && abort "Failed to cleanup snbapshot jars produced by test build from module target dirs. Please see above Maven output for details, fix any issues, then try again."
-
-
-# If this is a production build perform a dry run of tagging the release. Skip this for test builds to reduce the
-# build time
-# TODO: Re-enable this.
-#if [ "$MODE" = "production" ]; then
-# echo "Doing a dry run of tagging the release..."
-# mvn release:prepare $MAVEN_ARGS -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG "-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true" -DdryRun=true
-# [ "$?" -ne 0 ] && abort "Tagging dry run failed. Please see above Maven output for details, fix any issues, then try again."
-# mvn release:clean $MAVEN_ARGS
-# [ "$?" -ne 0 ] && abort "Failed to cleanup release plugin working files from tagging dry run. Please see above Maven output for details, fix any issues, then try again."
-# echo
-# echo "Tagging dry run succeeded!"
-#fi
-
-
-# If the dry run was skipped or succeeded, tag it for real.
-
-echo "Tagging the release..."
-mvn release:prepare $MAVEN_ARGS -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG "-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true" -DdryRun=false -Dusername=$GIT_USERNAME
-[ "$?" -ne 0 ] && abort "Tagging failed. Please see above Maven output for details, fix any issues, then try again."
-echo
-echo "Tagging succeeded!"
-
-
-# Checkout the tag and build it. If in production mode, publish the Maven artifacts.
-
-echo "Checking out release tag $RELEASE_TAG..."
-git checkout "$RELEASE_TAG"
-[ "$?" -ne 0 ] && abort "Checkout of release tag ($RELEASE_TAG) failed. Please see above git output for details, fix any issues, then try again."
-git clean -dxf
-[ "$?" -ne 0 ] && abort "Failed to cleanup unversioned files. Please see above git output for details, fix any issues, then try again."
-echo "Building release from tag and publishing Maven artifacts (this will take about 10-15 minutes)..."
-mvn $MAVEN_RELEASE_PERFORM_GOAL $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true
-[ "$?" -ne 0 ] && abort "Release build failed. Please see above Maven output for details, fix any issues, then try again."
-echo
-echo "Release build succeeded!"
-
-
-echo
-echo "=============================== Release Info =================================="
-echo "Version: $RELEASE_VERSION"
-echo "Branch URL: $PROJECT_GIT_WEB_URL;a=shortlog;h=refs/heads/$RELEASE_BRANCH"
-echo "Tag URL: $PROJECT_GIT_WEB_URL;a=shortlog;h=refs/tags/$RELEASE_TAG"
-echo "==============================================================================="
+}
+
+
+#========================================================================================
+# Description: Checkout or create the build branch for updating the development version.
+#========================================================================================
+checkout_build_branch_for_development()
+{
+ print_function_information $FUNCNAME
+
+ if [ "$MODE" = "production" ];
+ then
+ if [ "$SCM_STRATEGY" = "branch" ];
+ then
+ checkout_release_branch
+ BUILD_BRANCH="${RELEASE_BRANCH}"
+ fi
+ fi
+}
+
+
+
+############ MAIN SCRIPT ############
+
+parse_and_validate_options $@
+
+set_script_debug_mode $DEBUG_MODE
+
+validate_system_utilities
+
+set_local_and_environment_variables
+
+verify_tags
+
+checkout_release_branch
+
+checkout_build_branch_for_release
+
+run_release_version_and_tag_process
+
+checkout_build_branch_for_development
+
+update_development_version
+
+print_release_information
+unset_script_debug_mode $DEBUG_MODE
diff --git a/rhq_bash.lib b/rhq_bash.lib
new file mode 100644
index 0000000..8b1a300
--- /dev/null
+++ b/rhq_bash.lib
@@ -0,0 +1,253 @@
+#========================================================================================
+# Usage:
+# Include in any script file as script dependency.
+#
+# Description:
+# Library of common functions used between multiple release related scripts.
+#
+# Options:
+# N/A
+#========================================================================================
+
+
+
+#========================================================================================
+# Description: Display an error message and abort the script.
+#========================================================================================
+abort()
+{
+ echo >&2
+ for ARG in "$@"; do
+ echo "$ARG" >&2
+ echo "">&2
+ done
+ exit 1
+}
+
+
+#========================================================================================
+# Description: Prints an array of variables passed in as arguments.
+#========================================================================================
+print_variables()
+{
+ for variable in "$@"
+ do
+ temp_var='eval "echo \$$variable"'
+ eval_temp_var=`eval $temp_var`
+
+ if [ -z "$eval_temp_var" ]; then
+ echo "$variable is NOT defined!"
+ else
+ echo "$variable=$eval_temp_var"
+ fi
+ done
+}
+
+
+#========================================================================================
+# Description: Prints the eval result of each array element passed in.
+#========================================================================================
+print_program_versions()
+{
+ for variable in "$@"
+ do
+ eval $variable
+ echo
+ done
+}
+
+
+#========================================================================================
+# Description: Validates that a compatible version of Java 6 is installed.
+#========================================================================================
+validate_java_6()
+{
+ # Make sure JAVA_HOME points to a valid JDK 1.6+ install.
+
+ if [ -z "$JAVA_HOME" ]; then
+ abort "JAVA_HOME environment variable is not set - JAVA_HOME must point to a JDK (not JRE) 6 install dir."
+ fi
+
+ if [ ! -d "$JAVA_HOME" ]; then
+ abort "JAVA_HOME ($JAVA_HOME) does not exist or is not a directory - JAVA_HOME must point to a JDK (not JRE) 6 install dir."
+ fi
+
+ echo "Prepending $JAVA_HOME/bin to PATH..."
+ PATH="$JAVA_HOME/bin:$PATH"
+
+ if ! which java >/dev/null 2>&1; then
+ abort "java not found in PATH ($PATH) - JAVA_HOME must point to a JDK (not JRE) 6 install dir."
+ fi
+
+ if ! which javac >/dev/null 2>&1; then
+ abort "javac not found in PATH ($PATH) - JAVA_HOME must point to a JDK (not JRE) 6 install dir."
+ fi
+
+ if ! javap java.util.Deque >/dev/null 2>&1; then
+ abort "java.util.Deque not found - Java version appears to be less than 1.6 - Jave version must be 1.6 or later."
+ fi
+}
+
+
+#========================================================================================
+# Description: Validates that a compatible version of Java 5 is installed.
+#========================================================================================
+validate_java_5()
+{
+ echo "nothing executed here"
+ # spinder 8/30/11: commenting out the JAVA5 support, but leaving logic in place for when we need the same backwards
+ # compatibility logic for JD6 vs. JDK7 support.
+ # If this is an enterprise release, make sure JAVA5_HOME points to a valid JDK 1.5 install.
+ # We need this to validate only Java 5 or earlier APIs are used in all modules, except the CLI, which requires Java 6.
+ #
+ #if [ "$RELEASE_TYPE" = "enterprise" ]; then
+ # if [ -z "$JAVA5_HOME" ]; then
+ # abort "JAVA5_HOME environment variable is not set - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
+ # fi
+ #
+ # if [ ! -d "$JAVA5_HOME" ]; then
+ # abort "JAVA5_HOME ($JAVA5_HOME) does not exist or is not a directory - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
+ # fi
+ #
+ # if [ ! -x "$JAVA5_HOME/bin/java" ]; then
+ # abort "$JAVA5_HOME/bin/java does not exist or is not executable - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
+ # fi
+ #
+ # if [ ! -x "$JAVA5_HOME/bin/javac" ]; then
+ # abort "$JAVA5_HOME/bin/javac does not exist or is not executable - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
+ # fi
+ #
+ # if ! "$JAVA5_HOME/bin/javap" java.lang.Enum >/dev/null 2>&1; then
+ # abort "java.lang.Enum not found - JAVA5_HOME ($JAVA5_HOME) version appears to be less than 1.5 - version must be 1.5.x."
+ # fi
+ #
+ # if "$JAVA5_HOME/bin/javap" java.util.Deque >/dev/null 2>&1; then
+ # abort "java.util.Deque found - JAVA5_HOME ($JAVA5_HOME) version appears to be greater than or equal to 1.6 - version must be 1.5.x."
+ # fi
+ #fi
+}
+
+
+#========================================================================================
+# Description: Validates that a compatible version of Maven is installed.
+#========================================================================================
+validate_maven()
+{
+ # Make sure M2_HOME points to a valid Maven 2.1.x or 2.2.x install.
+ MINIMUM_MAVEN_VERSION="2.1.0"
+
+ if [ -z "$M2_HOME" ]; then
+ abort "M2_HOME environment variable is not set - M2_HOME must point to a Maven, $MINIMUM_MAVEN_VERSION or later, install dir."
+ fi
+
+ if [ ! -d "$M2_HOME" ]; then
+ abort "M2_HOME ($M2_HOME) does not exist or is not a directory - M2_HOME must point to a Maven, $MINIMUM_MAVEN_VERSION or later, install dir."
+ fi
+
+ echo "Prepending $M2_HOME/bin to PATH..."
+ PATH="$M2_HOME/bin:$PATH"
+
+ if ! which mvn >/dev/null 2>&1; then
+ abort "mvn not found in PATH ($PATH) - M2_HOME must point to a Maven, $MINIMUM_MAVEN_VERSION or later, install dir."
+ fi
+
+ mvn -version >/dev/null
+ [ $? -ne 0 ] && abort "mvn --version failed with exit code $?."
+ MAVEN_VERSION=`mvn -version | head -1 | sed 's|[^0-9]*\([^ ]*\).*|\1|'`
+ if echo $MAVEN_VERSION | grep -Ev "^(2\.[12]|3\.0)"; then
+ abort "Unsupported Maven version - $MAVEN_VERSION. Only Maven 2.1.x, 2.2.x, or 3.0.x is supported. Please update the value of M2_HOME, then try again."
+ fi
+}
+
+
+#========================================================================================
+# Description: Validates that a compatible version of Git is installed.
+#========================================================================================
+validate_git()
+{
+ # Make sure git 1.6.x or 1.7.x is in the PATH.
+
+ if ! which git >/dev/null 2>&1; then
+ abort "git not found in PATH ($PATH)."
+ fi
+
+ git --version >/dev/null
+ [ $? -ne 0 ] && abort "git --version failed with exit code $?."
+ GIT_VERSION=`git --version | sed 's|[^0-9]*\([^ ]*\).*|\1|'`
+ if echo $GIT_VERSION | grep -v "^1.[67]"; then
+ abort "Unsupported git version - $GIT_VERSION. Only git 1.6.x or 1.7.x are supported. Please add a directory containing a supported version of git to your PATH, then try again."
+ fi
+}
+
+
+#========================================================================================
+# Description: Prints the input string centered.
+#========================================================================================
+print_centered()
+{
+ max_length=90
+ string_length=${#1}
+
+ if [ $string_length -ge `expr $max_length - 2` ]
+ then
+ echo $1
+ return 0
+ fi
+
+ left_side=`expr $max_length - $string_length`
+ left_side=`expr $left_side / 2`
+
+ is_odd_number=$(( $string_length % 2 ))
+ if [ $is_odd_number -eq 0 ]
+ then
+ right_side=$left_side
+ else
+ right_side=`expr $left_side + 1 `
+ fi
+
+ eval "printf '=%.0s' {1..${left_side}}"
+ printf " $1 "
+ eval "printf '=%.0s' {1..${right_side}}"
+ printf "\n"
+}
+
+
+#========================================================================================
+# Description: Sets the script in debug mode; this will print all the commands before
+# executing them.
+#========================================================================================
+set_script_debug_mode()
+{
+ if [ -n "$1" ] && [ "$1" ];
+ then
+ set -x
+ else
+ set +x
+ fi
+}
+
+
+#========================================================================================
+# Description: Resets the script in debug mode; this will stop printing all the commands
+# before executing them.
+#========================================================================================
+unset_script_debug_mode()
+{
+ set +x
+}
+
+
+#========================================================================================
+# Description: Print function information (name and parameters).
+#========================================================================================
+print_function_information()
+{
+ function_name=$1
+ shift
+
+ function_parameters=$(printf ", %s " "$@")
+ function_parameters=${function_parameters:1}
+
+ echo "+ $function_name ($function_parameters)"
+}
+
12 years, 4 months
[rhq] modules/enterprise
by John Sanda
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java | 24 +++++++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerRemote.java | 29 +++++++++-
2 files changed, 50 insertions(+), 3 deletions(-)
New commits:
commit 572db8ca18f25bea345b03243bf9b9bb8d9bdf8a
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Dec 19 10:34:58 2011 -0500
Adding/updating javadocs
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java
index ac707cc..5a79413 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java
@@ -140,8 +140,28 @@ public interface DriftManagerLocal extends DriftManagerRemote {
void updateDriftDefinition(Subject subject, DriftDefinition driftDefinition);
/**
- * Update the provided driftDef (identified by name) on the specified EntityContext. If it exists it will be replaced. If not it will
- * be added. Agents, if available, will be notified of the change.
+ * <p>
+ * Saves or updates the provided drift definition. If the definition, identified by name, already exists, an update
+ * is performed; otherwise, a new drift definition is saved. Agents if available will be notified of the change.
+ * If agents are unreachable, the definition will still be saved/updated. Changes will then propagate to agents
+ * the next time they do an inventory sync.
+ * </p>
+ * <p>
+ * Several validation checks are performed before the definition is persisted. If it is a new definition, the
+ * following checks are performed:
+ * <ul>
+ * <li>Verify that the resource supports drift management</li>
+ * <li>Verify that the template (if specified) already exists in the database</li>
+ * <li>Verify that the template (if specified) belongs to the correct resource type</li>
+ * </ul>
+ * For new and existing definitions these additional checks are performed:
+ * <ul>
+ * <li>Verify that the definition name does not contain illegal characters</li>
+ * <li>Verify that the base directory does not contain illegal characters</li>
+ * <li>Verify that filters do not contain illegal characters</li>
+ * </ul>
+ * </p>
+ *
* @param subject
* @param entityContext
* @param driftDef
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerRemote.java
index 1d3dc82..a39108e 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerRemote.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerRemote.java
@@ -119,5 +119,32 @@ public interface DriftManagerRemote {
void pinSnapshot(Subject subject, int driftDefId, int snapshotVersion);
- void updateDriftDefinition(Subject subject, EntityContext entityContext, DriftDefinition driftConfig);
+ /**
+ * <p>
+ * Saves or updates the provided drift definition. If the definition, identified by name, already exists, an update
+ * is performed; otherwise, a new drift definition is saved. Agents if available will be notified of the change.
+ * If agents are unreachable, the definition will still be saved/updated. Changes will then propagate to agents
+ * the next time they do an inventory sync.
+ * </p>
+ * <p>
+ * Several validation checks are performed before the definition is persisted. If it is a new definition, the
+ * following checks are performed:
+ * <ul>
+ * <li>Verify that the resource supports drift management</li>
+ * <li>Verify that the template (if specified) already exists in the database</li>
+ * <li>Verify that the template (if specified) belongs to the correct resource type</li>
+ * </ul>
+ * For new and existing definitions these additional checks are performed:
+ * <ul>
+ * <li>Verify that the definition name does not contain illegal characters</li>
+ * <li>Verify that the base directory does not contain illegal characters</li>
+ * <li>Verify that filters do not contain illegal characters</li>
+ * </ul>
+ * </p>
+ *
+ * @param subject
+ * @param entityContext
+ * @param driftDef
+ */
+ void updateDriftDefinition(Subject subject, EntityContext entityContext, DriftDefinition driftDef);
}
12 years, 4 months
[rhq] modules/enterprise
by John Sanda
modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java | 104 +++++-----
1 file changed, 54 insertions(+), 50 deletions(-)
New commits:
commit 4a37ccc0f13f860f4e4831eac70431ad6beaa8a7
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Dec 19 09:34:47 2011 -0500
Commenting out tests that I added for BZ 768099
I ran into an issue where TestNG executes method in an unexpected order
that causes tests to fail.
http://groups.google.com/group/testng-users/browse_thread/thread/da279067...
provides some more background on the issue.
diff --git a/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
index ac55445..36ff31f 100644
--- a/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
+++ b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
@@ -26,16 +26,12 @@ import org.rhq.core.domain.criteria.JPADriftChangeSetCriteria;
import org.rhq.core.domain.drift.*;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.domain.shared.ResourceBuilder;
-import org.rhq.core.domain.shared.ResourceTypeBuilder;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility;
import org.rhq.test.AssertUtils;
import org.rhq.test.TransactionCallback;
import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-import javax.ejb.EJBException;
import javax.persistence.EntityManager;
import java.util.ArrayList;
import java.util.List;
@@ -47,7 +43,6 @@ import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
import static org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode.BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS;
-import static org.rhq.core.domain.resource.ResourceCategory.SERVER;
import static org.rhq.enterprise.server.util.LookupUtil.getDriftManager;
import static org.rhq.enterprise.server.util.LookupUtil.getDriftTemplateManager;
@@ -104,51 +99,60 @@ public class ManageDriftDefinitionsTest extends DriftServerTest {
assertEquals("The template association was not set on the definition", template, newDef.getTemplate());
}
- public void createEntitiesThatDoNotSupportDrift() {
- // first create the resource type that does not support drift
- driftNotSupportedType = new ResourceTypeBuilder()
- .createResourceType()
- .withId(0)
- .withName(DRIFT_NOT_SUPPORTED_TYPE)
- .withCategory(SERVER)
- .withPlugin(DRIFT_NOT_SUPPORTED_TYPE.toLowerCase())
- .build();
-
- // create a resource of the type that does not support drift
- driftNotSupportedResource = new ResourceBuilder()
- .createResource()
- .withId(0)
- .withName(DRIFT_NOT_SUPPORTED_RESOURCE)
- .withResourceKey(DRIFT_NOT_SUPPORTED_RESOURCE)
- .withRandomUuid()
- .withResourceType(driftNotSupportedType)
- .build();
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
- em.persist(driftNotSupportedType);
- em.persist(driftNotSupportedResource);
- }
- });
- }
-
- @Test(dependsOnMethods = "createEntitiesThatDoNotSupportDrift",
- expectedExceptions = EJBException.class,
- expectedExceptionsMessageRegExp = ".*Cannot create drift definition.*type.*does not support drift management")
- @InitDB(false)
- public void doNotAllowDefinitionToBeCreatedForTypeThatDoesNotSupportDrift() {
- DriftDefinition driftDef = new DriftDefinition(new Configuration());
- driftDef.setName("test_typeDoesNotSupportDrift");
- driftDef.setEnabled(true);
- driftDef.setInterval(1800L);
- driftDef.setDriftHandlingMode(normal);
- driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
-
- driftMgr.updateDriftDefinition(getOverlord(), EntityContext.forResource(driftNotSupportedResource.getId()),
- driftDef);
- }
+ // The following two tests are commented out because when they are enabled
+ // and all tests in the itests module are run, the @AfterClass method for
+ // DriftTemplateManagerBeanTest does not run immediately after all of its
+ // test methods have finished running. Instead, some of the tests in
+ // ManageDriftDefinitionsTest start running. This leads to some database
+ // constraint violations because of how agents are created in the parent
+ // class, DriftServerTest. See http://groups.google.com/group/testng-users/browse_thread/thread/da279067...
+ // more info on the order in which TestNG executes tests.
+
+// public void createEntitiesThatDoNotSupportDrift() {
+// // first create the resource type that does not support drift
+// driftNotSupportedType = new ResourceTypeBuilder()
+// .createResourceType()
+// .withId(0)
+// .withName(DRIFT_NOT_SUPPORTED_TYPE)
+// .withCategory(SERVER)
+// .withPlugin(DRIFT_NOT_SUPPORTED_TYPE.toLowerCase())
+// .build();
+//
+// // create a resource of the type that does not support drift
+// driftNotSupportedResource = new ResourceBuilder()
+// .createResource()
+// .withId(0)
+// .withName(DRIFT_NOT_SUPPORTED_RESOURCE)
+// .withResourceKey(DRIFT_NOT_SUPPORTED_RESOURCE)
+// .withRandomUuid()
+// .withResourceType(driftNotSupportedType)
+// .build();
+//
+// executeInTransaction(new TransactionCallback() {
+// @Override
+// public void execute() throws Exception {
+// EntityManager em = getEntityManager();
+// em.persist(driftNotSupportedType);
+// em.persist(driftNotSupportedResource);
+// }
+// });
+// }
+//
+// @Test(dependsOnMethods = "createEntitiesThatDoNotSupportDrift",
+// expectedExceptions = EJBException.class,
+// expectedExceptionsMessageRegExp = ".*Cannot create drift definition.*type.*does not support drift management")
+// @InitDB(false)
+// public void doNotAllowDefinitionToBeCreatedForTypeThatDoesNotSupportDrift() {
+// DriftDefinition driftDef = new DriftDefinition(new Configuration());
+// driftDef.setName("test_typeDoesNotSupportDrift");
+// driftDef.setEnabled(true);
+// driftDef.setInterval(1800L);
+// driftDef.setDriftHandlingMode(normal);
+// driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+//
+// driftMgr.updateDriftDefinition(getOverlord(), EntityContext.forResource(driftNotSupportedResource.getId()),
+// driftDef);
+// }
@SuppressWarnings("unchecked")
public void createDefinitionFromPinnedTemplate() throws Exception {
12 years, 4 months
[rhq] modules/enterprise
by John Sanda
modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java | 123 +++++++---
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java | 109 ++++----
2 files changed, 151 insertions(+), 81 deletions(-)
New commits:
commit 615c99b2a0d856b316b558a4e6fd7989b4004a15
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Dec 19 09:20:56 2011 -0500
[BZ 768099] Add validation checks when creating a drift definition
The following validation checks have been added:
* verify that the resource supports drift management
* verify that the template attached to the def exists in the db
* verify that that the template is from the correct resource type
diff --git a/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
index 6e93bb3..ac55445 100644
--- a/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
+++ b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
@@ -19,56 +19,64 @@
package org.rhq.enterprise.server.drift;
+import org.rhq.core.domain.common.EntityContext;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.criteria.DriftDefinitionCriteria;
+import org.rhq.core.domain.criteria.JPADriftChangeSetCriteria;
+import org.rhq.core.domain.drift.*;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.shared.ResourceBuilder;
+import org.rhq.core.domain.shared.ResourceTypeBuilder;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility;
+import org.rhq.test.AssertUtils;
+import org.rhq.test.TransactionCallback;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import javax.ejb.EJBException;
+import javax.persistence.EntityManager;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+
import static java.util.Arrays.asList;
import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
import static org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode.BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS;
+import static org.rhq.core.domain.resource.ResourceCategory.SERVER;
import static org.rhq.enterprise.server.util.LookupUtil.getDriftManager;
import static org.rhq.enterprise.server.util.LookupUtil.getDriftTemplateManager;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.persistence.EntityManager;
-
-import org.testng.annotations.BeforeClass;
+public class ManageDriftDefinitionsTest extends DriftServerTest {
-import org.rhq.core.domain.common.EntityContext;
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.criteria.DriftDefinitionCriteria;
-import org.rhq.core.domain.criteria.JPADriftChangeSetCriteria;
-import org.rhq.core.domain.drift.Drift;
-import org.rhq.core.domain.drift.DriftChangeSet;
-import org.rhq.core.domain.drift.DriftComplianceStatus;
-import org.rhq.core.domain.drift.DriftConfigurationDefinition;
-import org.rhq.core.domain.drift.DriftDefinition;
-import org.rhq.core.domain.drift.DriftDefinitionComparator;
-import org.rhq.core.domain.drift.DriftDefinitionTemplate;
-import org.rhq.core.domain.drift.DriftSnapshot;
-import org.rhq.core.domain.drift.JPADrift;
-import org.rhq.core.domain.drift.JPADriftChangeSet;
-import org.rhq.core.domain.drift.JPADriftFile;
-import org.rhq.core.domain.drift.JPADriftSet;
-import org.rhq.core.domain.util.PageList;
-import org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility;
-import org.rhq.test.AssertUtils;
-import org.rhq.test.TransactionCallback;
+ private final String DRIFT_NOT_SUPPORTED_TYPE = getClass().getSimpleName() + "DRIFT_NOT_SUPPORTED_RESOURCE_TYPE";
-public class ManageDriftDefinitionsTest extends DriftServerTest {
+ private final String DRIFT_NOT_SUPPORTED_RESOURCE = getClass().getSimpleName() + "DRIFT_NOT_SUPPORTED_RESOURCE";
private DriftManagerLocal driftMgr;
private DriftTemplateManagerLocal templateMgr;
+ private ResourceType driftNotSupportedType;
+
+ private Resource driftNotSupportedResource;
+
@BeforeClass
public void initClass() throws Exception {
driftMgr = getDriftManager();
templateMgr = getDriftTemplateManager();
}
+ @Override
+ protected void purgeDB(EntityManager em) {
+ deleteEntity(Resource.class, DRIFT_NOT_SUPPORTED_RESOURCE, em);
+ deleteEntity(ResourceType.class, DRIFT_NOT_SUPPORTED_TYPE, em);
+ }
+
public void createDefinitionFromUnpinnedTemplate() {
// first create a template
final DriftDefinition templateDef = new DriftDefinition(new Configuration());
@@ -96,6 +104,52 @@ public class ManageDriftDefinitionsTest extends DriftServerTest {
assertEquals("The template association was not set on the definition", template, newDef.getTemplate());
}
+ public void createEntitiesThatDoNotSupportDrift() {
+ // first create the resource type that does not support drift
+ driftNotSupportedType = new ResourceTypeBuilder()
+ .createResourceType()
+ .withId(0)
+ .withName(DRIFT_NOT_SUPPORTED_TYPE)
+ .withCategory(SERVER)
+ .withPlugin(DRIFT_NOT_SUPPORTED_TYPE.toLowerCase())
+ .build();
+
+ // create a resource of the type that does not support drift
+ driftNotSupportedResource = new ResourceBuilder()
+ .createResource()
+ .withId(0)
+ .withName(DRIFT_NOT_SUPPORTED_RESOURCE)
+ .withResourceKey(DRIFT_NOT_SUPPORTED_RESOURCE)
+ .withRandomUuid()
+ .withResourceType(driftNotSupportedType)
+ .build();
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+ em.persist(driftNotSupportedType);
+ em.persist(driftNotSupportedResource);
+ }
+ });
+ }
+
+ @Test(dependsOnMethods = "createEntitiesThatDoNotSupportDrift",
+ expectedExceptions = EJBException.class,
+ expectedExceptionsMessageRegExp = ".*Cannot create drift definition.*type.*does not support drift management")
+ @InitDB(false)
+ public void doNotAllowDefinitionToBeCreatedForTypeThatDoesNotSupportDrift() {
+ DriftDefinition driftDef = new DriftDefinition(new Configuration());
+ driftDef.setName("test_typeDoesNotSupportDrift");
+ driftDef.setEnabled(true);
+ driftDef.setInterval(1800L);
+ driftDef.setDriftHandlingMode(normal);
+ driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+
+ driftMgr.updateDriftDefinition(getOverlord(), EntityContext.forResource(driftNotSupportedResource.getId()),
+ driftDef);
+ }
+
@SuppressWarnings("unchecked")
public void createDefinitionFromPinnedTemplate() throws Exception {
// We first need to create a pinned template. Users can only create a pinned
@@ -209,8 +263,19 @@ public class ManageDriftDefinitionsTest extends DriftServerTest {
}
public void unpinDefinition() {
+ // First create the template
+ final DriftDefinition templateDef = new DriftDefinition(new Configuration());
+ templateDef.setName("test_unpin_def_template");
+ templateDef.setEnabled(true);
+ templateDef.setDriftHandlingMode(normal);
+ templateDef.setInterval(2400L);
+ templateDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+
+ final DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(), resourceType.getId(), true,
+ templateDef);
+
// First create the definition
- DriftDefinition definition = new DriftDefinition(new Configuration());
+ DriftDefinition definition = template.createDefinition();
definition.setName("test_unpin");
definition.setEnabled(true);
definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
index 12c7233..3da8bd2 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
@@ -18,73 +18,25 @@
*/
package org.rhq.enterprise.server.drift;
-import static java.util.Arrays.asList;
-import static javax.ejb.TransactionAttributeType.NOT_SUPPORTED;
-import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
-import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
-import static org.rhq.core.domain.drift.DriftComplianceStatus.IN_COMPLIANCE;
-import static org.rhq.core.domain.drift.DriftComplianceStatus.OUT_OF_COMPLIANCE_DRIFT;
-
-import java.io.File;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.ejb.EJB;
-import javax.ejb.Stateless;
-import javax.ejb.TransactionAttribute;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
import difflib.DiffUtils;
import difflib.Patch;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Hibernate;
-
import org.jboss.remoting.CannotConnectException;
-
import org.rhq.core.clientapi.agent.drift.DriftAgentService;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.common.EntityContext;
-import org.rhq.core.domain.criteria.DriftChangeSetCriteria;
-import org.rhq.core.domain.criteria.DriftCriteria;
-import org.rhq.core.domain.criteria.DriftDefinitionCriteria;
-import org.rhq.core.domain.criteria.GenericDriftChangeSetCriteria;
-import org.rhq.core.domain.criteria.GenericDriftCriteria;
-import org.rhq.core.domain.drift.Drift;
-import org.rhq.core.domain.drift.DriftCategory;
-import org.rhq.core.domain.drift.DriftChangeSet;
-import org.rhq.core.domain.drift.DriftChangeSetCategory;
-import org.rhq.core.domain.drift.DriftComplianceStatus;
-import org.rhq.core.domain.drift.DriftComposite;
-import org.rhq.core.domain.drift.DriftConfigurationDefinition;
+import org.rhq.core.domain.criteria.*;
+import org.rhq.core.domain.drift.*;
import org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode;
-import org.rhq.core.domain.drift.DriftDefinition;
import org.rhq.core.domain.drift.DriftDefinition.BaseDirectory;
-import org.rhq.core.domain.drift.DriftDefinitionComparator;
import org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode;
-import org.rhq.core.domain.drift.DriftDefinitionComposite;
-import org.rhq.core.domain.drift.DriftDefinitionTemplate;
-import org.rhq.core.domain.drift.DriftDetails;
-import org.rhq.core.domain.drift.DriftFile;
-import org.rhq.core.domain.drift.DriftSnapshot;
-import org.rhq.core.domain.drift.DriftSnapshotRequest;
-import org.rhq.core.domain.drift.FileDiffReport;
-import org.rhq.core.domain.drift.Filter;
import org.rhq.core.domain.drift.dto.DriftChangeSetDTO;
import org.rhq.core.domain.drift.dto.DriftDTO;
import org.rhq.core.domain.drift.dto.DriftFileDTO;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.domain.util.PageOrdering;
@@ -103,6 +55,28 @@ import org.rhq.enterprise.server.util.CriteriaQueryGenerator;
import org.rhq.enterprise.server.util.CriteriaQueryRunner;
import org.rhq.enterprise.server.util.LookupUtil;
+import javax.ejb.EJB;
+import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
+import javax.jms.*;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import java.io.File;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import static java.util.Arrays.asList;
+import static javax.ejb.TransactionAttributeType.NOT_SUPPORTED;
+import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
+import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
+import static org.rhq.core.domain.drift.DriftComplianceStatus.IN_COMPLIANCE;
+import static org.rhq.core.domain.drift.DriftComplianceStatus.OUT_OF_COMPLIANCE_DRIFT;
+
+import java.lang.IllegalStateException;
+
/**
* The SLSB supporting Drift management to clients.
*
@@ -716,7 +690,6 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
@Override
public void updateDriftDefinition(Subject subject, EntityContext entityContext, DriftDefinition driftDef) {
-
// before we do anything, validate certain field values to prevent downstream errors
validateDriftDefinition(driftDef);
@@ -728,6 +701,11 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
throw new IllegalArgumentException("Entity not found [" + entityContext + "]");
}
+ if (!isDriftMgmtSupported(resource)) {
+ throw new IllegalArgumentException("Cannot create drift definition. The resource type " +
+ resource.getResourceType() + " does not support drift management");
+ }
+
// Update or add the driftDef as necessary
DriftDefinitionComparator comparator = new DriftDefinitionComparator(
CompareMode.ONLY_DIRECTORY_SPECIFICATIONS);
@@ -752,6 +730,7 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
}
if (!isUpdated) {
+ validateTemplateForNewDef(driftDef, resource);
resource.addDriftDefinition(driftDef);
// We call persist here because if this definition is created
// from a pinned template, then we need to generate the initial
@@ -826,6 +805,32 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
}
}
+ private boolean isDriftMgmtSupported(Resource resource) {
+ ResourceType type = resource.getResourceType();
+ return type.getDriftDefinitionTemplates() != null && !type.getDriftDefinitionTemplates().isEmpty();
+ }
+
+ private void validateTemplateForNewDef(DriftDefinition driftDef, Resource resource) {
+ if (driftDef.getTemplate() == null) {
+ return;
+ }
+
+ DriftDefinitionTemplate template = entityManager.find(DriftDefinitionTemplate.class,
+ driftDef.getTemplate().getId());
+
+ if (template == null) {
+ throw new IllegalArgumentException("Cannot create drift definition with template " +
+ DriftDefinitionTemplate.class.getSimpleName() + "[" + driftDef.getTemplate().getName() +
+ "] that has not been saved");
+ }
+
+ if (!template.getResourceType().equals(resource.getResourceType())) {
+ throw new IllegalArgumentException("Cannot create drift definition with template " +
+ DriftDefinitionTemplate.class.getSimpleName() + "[" + driftDef.getTemplate().getName() +
+ "] that is from a different resource type, " + template.getResourceType());
+ }
+ }
+
@Override
public boolean isBinaryFile(Subject subject, Drift<?, ?> drift) {
return DriftUtil.isBinaryFile(drift);
12 years, 4 months
[rhq] modules/enterprise
by Heiko W. Rupp
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties | 24 +++++-----
1 file changed, 12 insertions(+), 12 deletions(-)
New commits:
commit 95df570457b745fc77231ea8ffa86ac82b6063e4
Author: Fusayuki Minamoto <fminamot(a)redhat.com>
Date: Mon Dec 19 10:19:02 2011 +0100
Translate remaining properties
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
index 67d4a7f..41a33be 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
@@ -425,7 +425,7 @@ view_adminRoles_permissions_permDesc_manageBundles = (誰でも閲覧可能な)
view_adminRoles_permissions_permDesc_manageInventory = すべてのリソースについて、以下に示すように、すべてのリソース権限を持ちます。つまり、グループの作成、更新、削除、そして自動検出された、または手動で検出されたリソースのインポートができます
view_adminRoles_permissions_permDesc_manageRepositories = (自分自身のリポジトリを作成可能な)ユーザーのリポジトリの作成、更新、削除が可能です。
view_adminRoles_permissions_permDesc_manageSecurity = (誰でも閲覧可能な)ユーザーとロールの作成、更新、削除
-## view_adminRoles_permissions_permDesc_manageSettings = RHQサーバー構成の修正と任意のサーバー関連の機能の実行ができます
+view_adminRoles_permissions_permDesc_manageSettings = {0}サーバーの修正と任意のサーバー関連の機能の実行ができます
view_adminRoles_permissions_permReadDesc_configure = リソース構成とリソース構成リビジョン履歴の閲覧
view_adminRoles_permissions_permReadDesc_control = 利用可能オペレーションとオペレーション実行履歴の(暗黙的な)閲覧
view_adminRoles_permissions_permReadDesc_createChildResources = (暗黙的な)子リソースの作成履歴の閲覧
@@ -496,30 +496,30 @@ view_admin_configuration = 構成
view_admin_content = コンテント
view_admin_downloads_agentDownload = エージェントのダウンロード
view_admin_downloads_agent_buildNumber = エージェントビルド
-## view_admin_downloads_agent_help = <p> これはRHQ Agentの更新バイナリJARファイルです。このJARファイルの目的はユーザーがエージェントがまだ存在しないマシン上に新しいエージェントをインストールできるようにすることと、すでにインストール済みのエージェントを更新できるようにするためです。詳細は、このエージェントダウンロードJARで次のように--helpコマンドラインオプションをつけて実行してください。<br/> <b>java -jar <agent-download.jar> --help</b> </p> <h3>エージェントのインストール</h3> <p> <b>java -jar <agent-download.jar> --install[=<新しいエージェントディレクトリ>]</b><br/> このコマンドは新しいエージェントをインストールします。もし新しいディレクトリを指定しなければ、デフォルトは"."となります。</p> <h3>エージェントの更新</h3> <p> <b>java -jar <agent-download.jar> --update[=<古いエージェントディレクトリ>]</b><br/> これはすでにインストールされた既存のエージェントを更新します。もし古い、既存のエージェントがインストールされたディレクトリを指定しなかったなら、"rhq-agent"が仮定されます。</p>
+view_admin_downloads_agent_help = <p> これは {0} Agentの更新バイナリJARファイルです。このJARファイルの目的はユーザーがエージェントがまだ存在しないマシン上に新しいエージェントをインストールできるようにすることと、すでにインストール済みのエージェントを更新できるようにするためです。詳細は、このエージェントダウンロードJARで次のように--helpコマンドラインオプションをつけて実行してください。<br/> <b>java -jar <agent-download.jar> --help</b> </p> <h3>エージェントのインストール</h3> <p> <b>java -jar <agent-download.jar> --install[=<新しいエージェントディレクトリ>]</b><br/> このコマンドは新しいエージェントをインストールします。もし新しいディレクトリを指定しなければ、デフォルトは"."となります。</p> <h3>エージェントの更新</h3> <p> <b>java -jar <agent-download.jar> --update[=<古いエージェントディレクトリ>]</b><br/> これはすでにインストールされた既存のエージェントを更新します。もし古い、既存のエージェントがインストールされたディレクトリを指定しなかったなら、"rhq-agent"が仮定されます。</p>
view_admin_downloads_agent_link_label = リンク
view_admin_downloads_agent_link_value = エージェント {0} ({1}) のダウンロード
view_admin_downloads_agent_loadError = エージェントバージョン情報が取得できません
view_admin_downloads_agent_md5 = エージェント MD5
view_admin_downloads_agent_version = エージェントバージョン
view_admin_downloads_bundleDownload = バンドルデプロイヤのダウンロード
-## view_admin_downloads_bundle_help = <p> これはバンドルデプロイヤツールで、開発者とRHQバンドルによって使われます。このスタンドアロンツールを使うとバンドルやコンソールからのレシピをテストできるようにします。</p>
+view_admin_downloads_bundle_help = <p> これはバンドルデプロイヤツールで、{0}バンドルの開発者とパッケージ開発者によって使われます。このスタンドアロンツールを使うとバンドルやコンソールからのレシピをテストできるようにします。</p>
view_admin_downloads_bundle_link_label = リンク
view_admin_downloads_bundle_link_value = バンドルデプロイヤー {0} をダウンロード
view_admin_downloads_bundle_loadError = バンドルデプロイヤー情報が取得できません
view_admin_downloads_cliDownload = コマンドラインクライアントのダウンロード
view_admin_downloads_cli_buildNumber = CLIビルド
-## view_admin_downloads_cli_help = <p> これはコマンドラインツールで、CLIとして知られているものです。コンソールから実行するスタンドアロンツールで、RHQサーバーに対してコマンドラインインタフェースを提供します。自動化されたタスクを実行するためにCLIやrunスクリプトを介してコマンドを呼び出すことが可能です。CLIのインストール方法と使い方についての詳細情報はドキュメントをご覧ください。</p>
+view_admin_downloads_cli_help = <p> これはコマンドラインツールで、CLIとして知られているものです。コンソールから実行するスタンドアロンツールで、{0}サーバーに対してコマンドラインインタフェースを提供します。自動化されたタスクを実行するためにCLIやrunスクリプトを介してコマンドを呼び出すことが可能です。CLIのインストール方法と使い方についての詳細情報はドキュメントをご覧ください。</p>
view_admin_downloads_cli_link_label = リンク
view_admin_downloads_cli_link_value = CLI {0} ({1}) をダウンロード
view_admin_downloads_cli_loadError = CLIバージョン情報が取得できません
view_admin_downloads_cli_md5 = CLI MD5
view_admin_downloads_cli_version = CLIバージョン
view_admin_downloads_connectorsDownload = コネクタのダウンロード
-## view_admin_downloads_connectors_help = コネクターは製品がRHQによって管理可能であるために必要となるソフトウェアです。RHQエージェントが通信できるように、管理製品にコネクターをインストールします。詳細はドキュメントをご覧ください。
+view_admin_downloads_connectors_help = コネクターは製品が{0}によって管理可能であるために必要となるソフトウェアです。RHQエージェントが通信できるように、管理製品にコネクターをインストールします。詳細はドキュメントをご覧ください。
view_admin_downloads_connectors_loadError = コネクター情報を取得できません
view_admin_downloads_connectors_none = ダウンロードのためのコネクターが見つかりません
-## view_admin_landing = このセクションにおいて、RHQグローバル設定が管理されます。これはセキュリティ構成、プラグイン設定、RHQサーバーとエージェントの管理を含みます。
+view_admin_landing = このセクションにおいて、{0}グローバル設定が管理されます。これはセキュリティ構成、プラグイン設定、RHQサーバーとエージェントの管理を含みます。
view_admin_measTemplates_updateExisting_title = 既存スケジュールの更新
view_admin_measTemplates_updateExisting_tooltip = このボックスをチェックすると、このタイプのすべてのリソースを対象に選択したメトリックスの収集スケジュールを更新します。もしこれがチェックされていなければ、テンプレートスケジュールが将来的にインベントリに追加されるこのタイプの新規リソースに適用されるだけです。
view_admin_plugins_agent = エージェント
@@ -1171,7 +1171,7 @@ view_dashboardManager_saved = ダッシュボード {0} をサーバーへ保存
view_dashboardManager_success = ダッシュボードを保存しました
view_dashboard_favorites_error1 = 好みのリソースをロードするのに失敗しました
view_dashboardsManager_error1 = 新しいダッシュボードを追加するのに失敗しました
-## view_dashboardsManager_message_title_details = <h1>RHQへようこそ</h1>\n<p>RHQプロジェクトは抽象化されたプラグインベースのシステム管理スイートで、複数のプロダクトやプラットフォームに対してコア機能を横断的に適用できる拡張可能で、統合化されたシステム管理を提供します。このプロジェクトはレイヤ化されたモジュールによって設計されていて、デプロイのための柔軟なアーキテクチャを提供します。それは企業全体に対する監査と履歴の管理を提供するコアとなるユーザーインタフェースを導入します。サーバー/エージェントアーキテクチャはリモートでの管理と特定プロダクトのサポートを実現するプラグインを提供します。 </p>\n <p>このデフォルトのダッシュボードは上の「編集モード」ボタンをすることで編集可能です。</p>
+view_dashboardsManager_message_title_details = <h1>{0}へようこそ</h1>\n<p>RHQプロジェクトは抽象化されたプラグインベースのシステム管理スイートで、複数のプロダクトやプラットフォームに対してコア機能を横断的に適用できる拡張可能で、統合化されたシステム管理を提供します。このプロジェクトはレイヤ化されたモジュールによって設計されていて、デプロイのための柔軟なアーキテクチャを提供します。それは企業全体に対する監査と履歴の管理を提供するコアとなるユーザーインタフェースを導入します。サーバー/エージェントアーキテクチャはリモートでの管理と特定プロダクトのサポートを実現するプラグインを提供します。 </p>\n <p>このデフォルトのダッシュボードは上の「編集モード」ボタンをすることで編集可能です。</p>
view_dashboards_confirm1 = 削除してもよろしいですか
view_dashboards_portlets_refresh_fail1 = 自動リフレッシュするポートレットのリフレッシュ間隔の更新に失敗しました
view_dashboards_portlets_refresh_fail2 = 自動リフレッシュするポートレットのリロードの無効化に失敗しました
@@ -1341,10 +1341,10 @@ view_groupConfigEdit_tooltip_1 = メンバー値の違い - 編集するため
view_groupConfigEdit_unset = 設定解除
view_groupConfigEdit_valsDiff = メンバー値の違い
view_groupConfigEdit_valsDiffForProp = プロパティ [{0}] のためのメンバー値
-## view_groupCreateWizard_createFailure = リソースグループの作成に失敗しました
+view_groupCreateWizard_createFailure = リソースグループ [{0}] の作成に失敗しました : {1}
view_groupCreateWizard_createStepName = グループ設定
view_groupCreateWizard_createStep_recursive = 再帰
-## view_groupCreateWizard_createSuccessful_concise = 新規のリソースグループを作成しました。
+view_groupCreateWizard_createSuccessful_concise = [{0}] という名前の新規のリソースグループを作成しました。
view_groupCreateWizard_createSuccessful_full = [{2}] メンバーリソースを含む 名前 [{1}] の新規 [{0}] リソースグループを作成しました。
view_groupCreateWizard_membersStepName = メンバーの選択
view_groupCreateWizard_title = グループ作成
@@ -1505,7 +1505,7 @@ view_login_prompt = ログインしてください
view_login_registerLater = (キャンセル - 登録を後で完成させてください)
view_login_registerLdapSuccess = 新しいLDAPユーザーの登録に成功しました
view_login_registerUser = ユーザの登録
-## view_login_welcomeMsg = RHQへようこそ! <br/><br/> 登録を完成させるために次のフィールドを入力/更新してください。<br/> "OK"をクリックしたら、ログインします。<br/><br/>
+view_login_welcomeMsg = {0}へようこそ! <br/><br/> 登録を完成させるために次のフィールドを入力/更新してください。<br/> "OK"をクリックしたら、ログインします。<br/><br/>
view_measureRange_last = 時間の範囲 - 直前
view_measureRange_simple = シンプル...
view_measureRange_start = 時間の範囲 - 開始
@@ -1545,7 +1545,7 @@ view_operationScheduleDetails_enterParametersBelow = 以下にパラメーター
view_operationScheduleDetails_fieldDefault_description = 説明を見るとためオペレーションを選択してください
view_operationScheduleDetails_fieldDefault_parameters = パラメーターを見るためにオペレーションを選択してください
view_operationScheduleDetails_fieldHelp_description = このスケジュールされたオペレーションのための任意の説明 (例、夜間保守のためのアプリサーバー再起動)
-## view_operationScheduleDetails_fieldHelp_timeout = 時間間隔 - もし指定されていて、その間隔がスケジュールされたオペレーション実行が完了する前に経過してしまったならば、RHQサーバーはそのオペレーションをタイムアウトにし、それを失敗させることを検討します。注意:通常はすでに開始させられた根本の管理リソースオペレーションをアボートすることは不可能です。
+view_operationScheduleDetails_fieldHelp_timeout = 時間間隔 - もし指定されていて、その間隔がスケジュールされたオペレーション実行が完了する前に経過してしまったならば、{0} サーバーはそのオペレーションをタイムアウトにし、それを失敗させることを検討します。注意:通常はすでに開始させられた根本の管理リソースオペレーションをアボートすることは不可能です。
view_operationScheduleDetails_field_description = 説明
view_operationScheduleDetails_field_parameters = パラメーター
view_operationScheduleDetails_field_timeout = タイムアウト
@@ -1919,7 +1919,7 @@ widget_resourceFactoryWizard_infoStepName = リソース情報
widget_resourceFactoryWizard_infoStep_loadFail = アーキテクチャーを利用可能にするのに失敗しました
widget_resourceFactoryWizard_namePrompt = 新規リソース名
widget_resourceFactoryWizard_templatePrompt = コネクション設定テンプレート
-## widget_resourceFactoryWizard_timeoutHelp = タイムアウト間隔。もし指定されたならば(RHQエージェント上での)子のリソース作成のためのデフォルトタイムアウトを上書きします。大きなアプリケーションのデプロイのような長時間かかる作成アクションに特に有用です。通常、前回の試みのときにタイムアウトの失敗だった場合に使われます。
+widget_resourceFactoryWizard_timeoutHelp = タイムアウト間隔。もし指定されたならば({0}エージェント上での)子のリソース作成のためのデフォルトタイムアウトを上書きします。大きなアプリケーションのデプロイのような長時間かかる作成アクションに特に有用です。通常、前回の試みのときにタイムアウトの失敗だった場合に使われます。
widget_resourceFactoryWizard_uploadFailure = ファイルアップロードの失敗
widget_resourceFactoryWizard_uploadFileStepName = リソースコンテントファイルのアップロード
widget_resourceFactoryWizard_uploadInProgress = アップロードは処理中です... 大きなファイルを配布するには数分かかることもあります。
12 years, 4 months
[rhq] etc/eclipse-tools
by mazz
etc/eclipse-tools/maven/RHQ | 11 +++++++++++
1 file changed, 11 insertions(+)
New commits:
commit 227c63ec1caf645f19173e1e39b588b5b112ca4a
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Dec 16 17:34:31 2011 -0500
eclipse tool to build for both FF and chrome
diff --git a/etc/eclipse-tools/maven/RHQ Maven Build - Dev Profile Web UI Only (GWT) (FF,Chrome).launch b/etc/eclipse-tools/maven/RHQ Maven Build - Dev Profile Web UI Only (GWT) (FF,Chrome).launch
new file mode 100644
index 0000000..9fcb8fb
--- /dev/null
+++ b/etc/eclipse-tools/maven/RHQ Maven Build - Dev Profile Web UI Only (GWT) (FF,Chrome).launch
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
+<stringAttribute key="bad_container_name" value="\rhq\etc\eclipse-tools\maven"/>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.ui.externaltools.launchGroup"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${env_var:M2_HOME}/bin/${MAVEN_EXE}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-o -Dgwt.userAgent=gecko1_8,safari -Dmaven.test.skip=true -Pdev gwt:clean install"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/rhq/modules/enterprise/gui/coregui}"/>
+</launchConfiguration>
12 years, 4 months