export RHQROOT=/home/ayoung/devel/jboss/workspace/rhq #export GIT_DIR=/home/ayoung/devel/jboss/workspace/rhq/.git export RHQBIN=$RHQROOT/dev-container/bin/ export RHQCMD=$RHQBIN/rhq-server.sh export RHQCLIDIR=$RHQROOT/modules/enterprise/remoting/cli/target/rhq-remoting-cli-3.0.0-SNAPSHOT export RHQCLI=$RHQCLIDIR/bin/rhq-cli.sh export RHQ_PORTAL=$RHQROOT/modules/enterprise/gui/portal-war export RHQ_PORTAL_WEBAPP=$RHQ_PORTAL/src/main/webapp export RHQ_GIT_URL=ssh://git.fedorahosted.org/git/rhq/rhq.git #export RHQ_GIT_REMOTE_BRANCH=raw-config export RHQ_GIT_REMOTE_BRANCH=bundle #export RHQ_GIT_LOCAL_BRANCH=raw-config export RHQ_GIT_LOCAL_BRANCH=bundle #needed to keep the agent from crashing export LANG=C export RHQ_LICENSE_SOURCE=$RHQROOT/modules/enterprise/server/ear/src/main/license/license.xml export RHQ_LICENSE_TARGET_DIR=$RHQROOT/dev-container/jbossas/server/default/deploy/rhq.ear/license/ unset WINDOWID rhq-cli(){ $RHQCLIDIR/bin/rhq-cli.sh } rhq-git-clean(){ rhq-pushd git clean -fdx popd } rhq-start(){ $RHQCMD start } rhq-stop(){ $RHQCMD stop } rhq-restart(){ rhq-stop && rhq-start && zenity --info --text "rhq restarted" } rhq-tail(){ tail -f $RHQBIN/../logs/rhq-server-log4j.log } rhq-start-tail(){ rhq-start rhq-tail } #most common args. rhq-mvn(){ cd $RHQROOT mvn -o -Penterprise,dev -Dmaven.test.skip=true install cd - } rhq-recycle(){ rhq-stop && rhq-mvn && rhq-enable-debug && rhq-license-upload && rhq-start && zenity --info --text "Build successful " || zenity --warning --text "Build failed " } rhq-mvn-plugin-contianer(){ cd $RHQROOT/modules/core/plugin-container mvn -o -Pdev install \ && zenity --info --text "Plugin Container Build is completed" \ || zenity --warning --text "Plugin-continer Build Failed" cd - } rhq-mvn-portal(){ cd $RHQROOT/modules/core/gui mvn -o -Pdev install cd - cd $RHQROOT/modules/enterprise/gui/portal-war mvn -o -Pdev install \ && zenity --info --text "Portal Build is completed" \ || zenity --warning --text "Portal Build Failed" cd - } rhq-mvn-dbinit(){ pushd $RHQROOT rhq-stop dropdb rhq -U rhqadmin createdb rhq -U rhqadmin mvn -Penterprise,dev -Dmaven.test.skip=true -Ddbsetup clean install \ && rhq-mvn-raw-plugin-noalert \ && rhq-enable-debug \ && rhq-license-upload \ && rhq-start && zenity --info --text "DBinit Build is completed" \ || zenity --warning --text "iDBinit Build Failed" popd } rhq-mvn-db-reset(){ cd $RHQROOT rhq-stop dropdb rhq -U rhqadmin createdb rhq -U rhqadmin mvn -o -Penterprise,dev -Dmaven.test.skip=true -Ddbsetup install \ && rhq-start \ && zenity --info --text "DBinit Build is completed" \ || zenity --warning --text "DBinit Build Failed" cd - } rhq-agent-root(){ sudo rlwrap $RHQROOT/modules/enterprise/agent/target/rhq-agent/bin/rhq-agent.sh } rhq-agent-tail(){ tail -f $RHQROOT/modules/enterprise/agent/target/rhq-agent/logs/agent.log } rhq-agent(){ rlwrap $RHQROOT/modules/enterprise/agent/target/rhq-agent/bin/rhq-agent.sh } rhq-agent-reset(){ rlwrap $RHQROOT/modules/enterprise/agent/target/rhq-agent/bin/rhq-agent.sh -ls } rhq-agent-delete(){ sudo rm -rf $RHQROOT/modules/enterprise/agent/target } rhq-pushd(){ pushd $RHQROOT } rhq-pushd-webapp(){ pushd $RHQROOT/modules/enterprise/gui/portal-war/src/main/webapp } rhq-less(){ less $RHQROOT/dev-container/logs/rhq-server-log4j.log } rhq-sync-xhtml(){ rsync -r \ --include "*/" --include "*xhtml" --include "*.js" --include "*.css" \ --include "*.jsp" --exclude "*" \ $RHQROOT/modules/enterprise/gui/portal-war/src/main/webapp/* \ $RHQROOT/dev-container/jbossas/server/default/deploy/rhq.ear/rhq-portal.war } rhq-git-push(){ echo "running git push $RHQ_GIT_URL $RHQ_GIT_REMOTE_BRANCH:$RHQ_GIT_LOCAL_BRANCH " rhq-pushd && \ git push $RHQ_GIT_URL $RHQ_GIT_REMOTE_BRANCH:$RHQ_GIT_LOCAL_BRANCH } rhq-git-pull(){ rhq-pushd && \ git pull $RHQ_GIT_URL $RHQ_GIT_LOCAL_BRANCH } rhq-mvn-plugin-nss(){ cd $RHQROOT/modules/plugins/nss/ mvn -Pdev clean install \ && zenity --info --text "plugin build is completed" \ || zenity --warning --text "Plugin Build Failed" cd - } rhq-mvn-raw-plugin-noalert(){ cd $RHQROOT/modules/plugins/raw-config-test/ mvn -Pdev clean install } rhq-mvn-raw-plugin(){ rhq-mvn-raw-plugin-noalert \ && zenity --info --text "Raw-config-test pluging build is completed" \ || zenity --warning --text "Raw-config-test Plugin Build Failed" } rhq-enable-debug(){ echo 'JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n $JAVA_OPTS"' \ >> $RHQROOT/dev-container/jbossas/bin/run.conf echo 'RHQ_AGENT_ADDITIONAL_JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,address=9797,server=y,suspend=n"' \ >> $RHQROOT/modules/enterprise/agent/target/rhq-agent/bin/rhq-agent-env.sh } rhq-import-all(){ $RHQCLI <<-endofinput login rhqadmin rhqadmin criteria = ResourceCriteria(); criteria.addFilterInventoryStatus(InventoryStatus.NEW); resources = ResourceManager.findResourcesByCriteria(criteria); var resourceIds = new Array(); for (i = 0; i < resources.size(); i++) { resourceIds[i] = resources.get(i).id;}; DiscoveryBoss.importResources(resourceIds); quit endofinput } rhq-license-upload(){ mkdir -p $RHQ_LICENSE_TARGET_DIR cp $RHQ_LICENSE_SOURCE $RHQ_LICENSE_TARGET_DIR } rhq-resource-functions(){ . ~/bin/rhq-dev-functions } rhq-edit-functions(){ vi ~/bin/rhq-dev-functions . ~/bin/rhq-dev-functions } class2path(){ echo $1 | sed 's!\.!\/!g' } rhq-mvn-domain(){ cd $RHQROOT/modules/core/domain mvn -Pdev install \ && zenity --info "Completed" || zenity --error "Failed" cd - } rhq-mvn-jar(){ cd $RHQROOT/modules/enterprise/server/jar mvn -Pdev install \ && zenity --info "Completed" || zenity --error "Failed" cd - } rhq-bundle-test(){ cd $RHQROOT/modules/enterprise/server/jar mvn -Dtest=BundleManagerBeanTest test \ && zenity --info "Completed" || zenity --error "Failed" cd - } rhq-bundle-test-remote(){ cd $RHQROOT/modules/enterprise/server/jar mvn -Dtest.debug -Dtest=BundleManagerBeanTest test \ && zenity --info "Completed" || zenity --error "Failed" cd - }