diff options
Diffstat (limited to 'tools/scripts')
| -rwxr-xr-x | tools/scripts/mvn-deploy-files | 185 | ||||
| -rwxr-xr-x | tools/scripts/mvn-deploy-wlp92-jars | 158 |
2 files changed, 343 insertions, 0 deletions
diff --git a/tools/scripts/mvn-deploy-files b/tools/scripts/mvn-deploy-files new file mode 100755 index 0000000..a972753 --- /dev/null +++ b/tools/scripts/mvn-deploy-files @@ -0,0 +1,185 @@ +#!/bin/sh +# +# Copyright (c) 2003, 2004, 2005, 2006 Israfil Consulting Services Corporation +# Copyright (c) 2003, 2004, 2005, 2006 Christian Edward Gruber +# All Rights Reserved +# +# This software is licensed under a Berkeley Standard Distribution license +# equivalent (BSD license) as defined below: +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# 3. Neither the name of Israfil Consulting Services nor the names of its contributors +# may be used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +# OF SUCH DAMAGE. +# +# $Id$ +# + +command=`basename $0` + +original_command_line="${@}" + +#set -x + +function usage () { + + echo "usage: ${command} [-t <type>] [-e <ext>] [--test] -u <repo_url> -g <group_id> -v <version> <file> [<file>...] " + echo "Options: -t --type <type> sets the maven 2 packaging type " + echo " -e --ext <extension> the file extension (defaults to type) " + echo " -u --url <repo_url> the url to the deployment repository " + echo " -g --group <group_id> the groupId to which the artifacts will be deployed " + echo " -v --version <version> the version to which the artifacts will be deployed " + echo " -e --ext <extension> the file extension (defaults to type) " + echo " -p --poms <pomsfolder> a folder with poms, structured \${groupId}/\${artifactId}/\${version} " + echo " -o --pom-overrides determines whether a discovered pom file will override group/artifact/version " + echo " --test run the app without invoking maven, for testing " + +} + +function validate () { + valid="true" + echo "" + + if [ ! -n "${files}" ]; then + echo "[${command}] No files to deploy." ; valid="false" + fi + + if [ "${repository_url}" = "" ]; then + echo "[${command}] Missing repository url." ; valid="false" + fi + if [ "${group_id}" = "" ]; then + echo "[${command}] Missing group id." ; valid="false" + fi + if [ "${version}" = "" ]; then + echo "[${command}] Missing version." ; valid="false" + fi + if [ "${poms_dir}" != "" -a ! -d "${poms_dir}" ]; then + echo "[${command}] ${poms_dir} is not a valid directory" ; valid="false" + fi + if [ "${valid}" = "false" ]; then + echo "" ; usage ; exit 1 + fi +} + +# set initial defaults +type="jar" +test="false" +extension=__DEFAULT__ +repository_url="" +group_id="" +version="" +poms_dir="" +pom_overrides="false" +done="false" +export repository group_id version + +# loop through possible commands. +until [ "${done}" = "true" ]; do + + if [ "${1}" = "-t" -o "${1}" = "--type" ]; then + shift + type="${1}" + shift + elif [ "${1}" = "-e" -o "${1}" = "--ext" ]; then + shift + extension="${1}" + shift + elif [ "${1}" = "--test" ]; then + shift + test=true + elif [ "${1}" = "-u" -o "${1}" = "--url" ]; then + shift + repository_url="${1}" + shift + elif [ "${1}" = "-g" -o "${1}" = "--group" ]; then + shift + group_id="${1}" + shift + elif [ "${1}" = "-v" -o "${1}" = "--version" ]; then + shift + version="${1}" + shift + elif [ "${1}" = "-p" -o "${1}" = "--poms" ]; then + shift + poms_dir="${1}" + shift + elif [ "${1}" = "-o" -o "${1}" = "--pom-overrides" ]; then + shift + pom_overrides=true + else + # assume we're into files now. + done="true" + fi + +done +files=${@} + +# Validate whether key variables are set +validate + +# Given validated parameters, attend to any dynamic default settings. +if [ "${extension}" = "__DEFAULT__" ]; then + extension=${type} +fi +if [ "${poms_dir}" = "" ]; then + poms_dir=. +fi + + +echo "" +echo "Deploying ${type} artifacts into repository ${repository_url} with group ${group_id}." +echo "Deploying files: ${files}" +echo "" + +for file in ${files} ; do + + if [ ! -f "${file}" ]; then + echo "" && echo "[${command}] Cannot find file ${file}. Skipping..." && echo "" + break; + fi + + artifact_id=`basename ${file} .${extension}` + + # two ways to spec, or both. + pom_file=${poms_dir}/${group_id}/${artifact_id}/${version}/${artifact_id}-${version}.pom + artifact_spec="-DgroupId=${group_id} -DartifactId=${artifact_id} -Dversion=${version} -Dpackaging=${type}" + + echo -n "Deploying artifact: ${group_id}:${artifact_id}:${type}:${version} to ${repository_url}" + if [ -f ${pom_file} ]; then + echo " with ${pom_file}" + pom_arg="-DpomFile=${pom_file}" + if [ "${pom_overrides}" = "true" ]; then + artifact_spec="" + fi + fi + + + cmd="mvn --batch-mode deploy:deploy-file -Durl=${repository_url} ${artifact_spec} -Dfile=${file} ${pom_arg}" + + if [ "${test}" = "true" ]; then + echo "cmd: ${cmd}" + else + ${cmd} + fi + +done + + diff --git a/tools/scripts/mvn-deploy-wlp92-jars b/tools/scripts/mvn-deploy-wlp92-jars new file mode 100755 index 0000000..415d825 --- /dev/null +++ b/tools/scripts/mvn-deploy-wlp92-jars @@ -0,0 +1,158 @@ +#!/bin/sh +# +# Copyright (c) 2003, 2004, 2005, 2006 Israfil Consulting Services Corporation +# Copyright (c) 2003, 2004, 2005, 2006 Christian Edward Gruber +# All Rights Reserved +# +# This software is licensed under a Berkeley Standard Distribution license +# equivalent (BSD license) as defined below: +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# 3. Neither the name of Israfil Consulting Services nor the names of its contributors +# may be used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +# OF SUCH DAMAGE. +# +# $Id$ +# + +command=`basename $0` +cmd_dir=`dirname $0` + +#set -x + +function usage () { + + echo "usage: ${command} [--test]-u <repo_url> -b <bea_home> [-p <poms_folder>] " + echo "Options: -u --url <repo_url> the url to the deployment repository " + echo " -b --bea-home <bea_home> the BEA_HOME folder " + echo " -p --poms <pomsfolder> a folder with poms, structured \${groupId}/\${artifactId}/\${version} " + Echo " --test run the app without invoking maven, for testing " + +} + +function validate () { + valid="true" + echo "" + if [ "${bea_home}" = "" ]; then + echo "${command} requires that a bea home folder be given" ; valid="false" + elif [ ! -d "${bea_home}" ]; then + echo "BEA home folder ${bea_home} is not a valid directory." ; valid="false" + fi + if [ "${repository_url}" = "" ]; then + echo "${command} requires a repository URL" ; valid="false" + fi + if [ "${poms_dir}" != "" -a ! -d ${poms_dir} ]; then + echo "${poms_dir} is not a valid directory" ; valid="false" + fi + if [ "${valid}" = "false" ]; then + echo "" ; usage ; exit 1 + fi +} + +# loop through possible commands. +until [ "${done}" = "true" ]; do + + if [ "${1}" = "-b" -o "${1}" = "--bea-home" ]; then + shift + bea_home="${1}" + shift + elif [ "${1}" = "-u" -o "${1}" = "--url" ]; then + shift + repository_url="${1}" + shift + elif [ "${1}" = "--test" ]; then + shift + test="true" + else + # assume we're into files now. + done="true" + fi + +done + + +validate + +echo "Installing BEA weblogic portal 9.2 folders from ${bea_home} to ${repository_url}" +echo "" + +function install () { + group_id=$1 + shift + if [ "${test}" = "true" ]; then do_test="--test" ; fi + ${cmd_dir}/mvn-deploy-files -u ${repository_url} -g ${group_id} -v 9.2 ${do_test} $@ +} + +function installFromJ2EELibrary () { + j2eeLibrary=$1 + shift + group_id=$1 + shift + if [ "${test}" = "true" ]; then do_test="--test" ; fi + curdir=`pwd` + tmpdir=`mktemp.exe -d -p ${curdir}` + cd ${tmpdir} + jar -xf ${curdir}/${j2eeLibrary} + ${cmd_dir}/mvn-deploy-files -u ${repository_url} -g ${group_id} -v 9.2 ${do_test} $@ + cd ${curdir} + rm -r ${tmpdir} +} + + +# Visitor Tools +cd ${bea_home}/weblogic92/portal/lib/modules/ && installFromJ2EELibrary wlp-tools-visitor-web-lib.war com.bea.weblogic.portal.visitor WEB-INF/lib/*.jar + +# The big one. +cd ${bea_home}/weblogic92/server/lib && install com.bea.weblogic.server weblogic*.jar +cd ${bea_home}/weblogic92/server/lib && install com.bea.weblogic.server *api.jar + +# The workshop stuff - important for ant support. +cd ${bea_home}/weblogic92/workshop/lib && install com.bea.weblogic.workshop *.jar + +# Critical beehive/netui stuff +cd ${bea_home}/weblogic92/beehive/weblogic-beehive/lib/netui && install com.bea.weblogic.beehive.netui *.jar +cd ${bea_home}/weblogic92/beehive/weblogic-beehive/lib/controls && install com.bea.weblogic.beehive.controls *.jar +cd ${bea_home}/weblogic92/beehive/weblogic-beehive/lib/controls/runtime && install com.bea.weblogic.beehive.controls.runtime *.jar + +# The portal platform +cd ${bea_home}/weblogic92/platform/lib/wlp && install com.bea.weblogic.portal.core *.jar +cd ${bea_home}/weblogic92/platform/lib/p13n && install com.bea.weblogic.portal.p13n *.jar +cd ${bea_home}/weblogic92/common/deployable-libraries/ && installFromJ2EELibrary p13n-app-lib.ear com.bea.weblogic.portal.p13n APP-INF/lib/*.jar *.jar + +# Console and netuix stuff. +cd ${bea_home}/weblogic92/server/lib/consoleapp/webapp/WEB-INF/lib && install com.bea.weblogic.portal.core netuix_servlet.jar +cd ${bea_home}/weblogic92/portal/lib/modules/ && installFromJ2EELibrary wlp-framework-full-web-lib.war com.bea.weblogic.portal.core WEB-INF/lib/netuix_servlet-full.jar +cd ${bea_home}/weblogic92/server/lib/consoleapp/webapp/WEB-INF/lib && install com.bea.weblogic.portal.core struts-adapter.jar +cd ${bea_home}/weblogic92/portal/lib/modules/ && installFromJ2EELibrary wlp-framework-full-app-lib.ear com.bea.weblogic.portal.core netuix.jar +cd ${bea_home}/weblogic92/server/lib/consoleapp/webapp/WEB-INF/lib && install com.bea.weblogic.server console.jar + +cd ${bea_home}/weblogic92/portal/lib/modules/ && installFromJ2EELibrary wlp-tools-app-lib.ear com.bea.weblogic.portal.core APP-INF/lib/tools-framework.jar APP-INF/lib/wlptools_en.jar + +# Taglibs +cd ${bea_home}/weblogic92/server/lib/consoleapp/webapp/WEB-INF/lib && install com.bea.weblogic.server *_taglib.jar +cd ${bea_home}/weblogic92/portal/lib/netuix/web && install com.bea.weblogic.portal *_taglib.jar +cd ${bea_home}/weblogic92/portal/eclipse/plugins/com.bea.wlp.eclipse.common.taglib_9.2.0 && install com.bea.weblogic.portal *_taglib.jar +cd ${bea_home}/weblogic92/portal/eclipse/plugins/com.bea.wlp.eclipse.im.taglib_9.2.0 && install com.bea.weblogic.portal *_taglib.jar +cd ${bea_home}/weblogic92/portal/eclipse/plugins/com.bea.wlp.eclipse.p13n.taglib_9.2.0 && install com.bea.weblogic.portal *_taglib.jar +cd ${bea_home}/weblogic92/portal/eclipse/plugins/com.bea.wlp.eclipse.wsrp.taglib_9.2.0 && install com.bea.weblogic.portal *_taglib.jar + + + |
