To deploy a simple ear I did:
${JAVA_BIN} -cp ${WL_JAR} weblogic.Deployer -adminurl t3://${HOST_NAME}:${HOST_PORT} -user ${HOST_USER} -password ${HOST_PASS} -targets ${SERVER} -deploy -upload ${TMP_DIR}${DEPLOYEAR} -name ${APPNAME}
But on the second script I had to do a stop(kill) of the server, cleanup the tmp and cache folder then start the server. Here I needed to use the NodeManager command.
So here we have to connect to WLST and then to NM(nodemanager) kind of complicated really! But then I had to do it using a python script.
This is the dynamic creation of the python script to Start or Stop the Server.
/bin/cat >${TMP_DIR}${ACT}_${SERVER}.py<Script Deploy 1 (weblogic deploy API)
Jenkins – chiamare via ssh il script di deploy con i parametri
parametri ? (server,appname,package )

    unzipDeployFile
    backup
    source $WLENV
    agentDeployer $FILESDEP (one.ear file at a time)
    waitdep
    checklog $WL_LOG
    checklog $WL_LOGOUT
    checkapp

2-B) Script Deploy 2 (manual: stop, cleanup, copyear, start)
Functions:

    unzipDeployFile
    createScript start
    createScript stop
    backup
    cleanup
    source $WLENV
    stopApp
    copyear
    startApp
    waitdep
    checklog $WL_LOG
    checklog $WL_LOGOUT
    checkapp

Here is the code for script 1 :

Tags: , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *