2012/07/26

Jenkins in Weblogic Application Server 12c

To deploy jenkins in Weblogic server 12c you need a little ajustment as it is described in "Install the Jenkins as a WAR to the Weblogic server".

Here a bash shellscript using "Here Documents" to do it faster:

---------------------------------------------------------------------------------------
#!/bin/bash
TARGET=$1

if [ -z "$TARGET" ] || [ ! -e $TARGET ]
then
        echo "I need an absolut path to the jenkins war!"
        exit 1
fi

TMPDIR=$HOME/tmp/jenkins-ci/jenkins
MYPWD=$(pwd)
rm -fr $TMPDIR
mkdir -p $TMPDIR
cd $TMPDIR
unzip $TARGET

cat > WEB-INF/weblogic.xml <<ENDOFMESSAGE
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app
    xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsdhttp://xmlns.oracle.com/weblogic/weblogic-web-apphttp://xmlns.oracle.com/weblogic/weblogic-web-app/1.2/weblogic-web-app.xsd">
    <wls:weblogic-version>10.3.4</wls:weblogic-version>
    <wls:context-root>jenkins</wls:context-root>
    <wls:container-descriptor>
        <wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
    </wls:container-descriptor>
</wls:weblogic-web-app>
ENDOFMESSAGE

mkdir -p $MYPWD/weblogic
RESULT=$MYPWD/weblogic/jenkins.war
zip -r $RESULT *

ls -l $RESULT

---------------------------------------------------------------------------------------

 Example:

./weblogic-jenkins.sh jenkins.war

Enjoy!

No comments:

Post a Comment