0

I'm new to jython and python scripts.

My new requirement is to deploy a war file from windows client to windows server, using scripts.

I have done using ant, in local environment completed. From remote I have done R&D but I didn't get solution.

That's why I moved to jython scripting, and local environment deployment completed. But remote deployment is not working.

Can you please share any ideas and how to deploy the war file from my environment to a remote locations, please?

Nander Speerstra
  • 1,496
  • 6
  • 24
  • 29

2 Answers2

0

Murali , refer to http://www.jroller.com/holy/entry/was_6_0_ant_tasks. Did this help. Are you getting a specific error. You can also refer : Using Ant to deploy EAR to remote websphere application server for details.

You can deploy using service tasks , you can mention remote server ports and host name for deployment

<target name="_startEarApp" depends="" description="Start a deployed ear app on the WAS server">
            <wsStartApp wasHome="${was.root}" conntype="SOAP"
                        application="AppName"
                        host="my-remote-server" 
port="remote-server-soap-port"
                        user="me" password="pass"
                        failonerror="true"
                        />

Found this as well for other WS versions : https://www.ibm.com/developerworks/websphere/library/samples/SampleScripts.html

Ramachandran.A.G
  • 4,788
  • 1
  • 12
  • 24
  • This is the script i have written for deploying the war file in my local WAS can you please share any document or procedure to deploy the war file in remote location .either windows or linux – Murali Krishna Jul 26 '16 at 06:36
  • contextRoot = sys.argv[0] appPath = sys.argv[1] appName = sys.argv[2] projectName = sys.argv[3] global warFile for word in words: if word.endswith('.war'): warFile=word print warFile nodeName= AdminControl.getNode() cellName=AdminControl.getCell( ) wsadminSvr = AdminControl.queryNames("node="+AdminControl.getNode( )+",type=Server,*" ) wsadminServer = AdminControl.getAttribute(wsadminSvr, "name" ) – Murali Krishna Jul 26 '16 at 06:42
  • appOptions = "[-server " + wsadminServer + " -node " + nodeName + " -contextroot " + '/'+contextRoot appOptions = appOptions + " -MapWebModToVH [["+"\""+projectName+"\"" +" "+warFile+",WEB-INF/web.xml default_host ]]" appOptions = appOptions + " -appname " + appName appOptions = appOptions + "]" installedapps = AdminApp.list().splitlines() appManager = AdminControl.queryNames("cell="+cellName+",node="+nodeName+",type=ApplicationManager,process=server1,*") print installedapps if appName in installedapps: print 'app exists' isExist = 1 if( isExist == 1 ): – Murali Krishna Jul 26 '16 at 06:43
  • print "stopping %s" % (appName) AdminControl.invoke(appManager, "stopApplication", appName) sleep(10) #if exists, uninstall application print "Uninstalling %s" % (appName) AdminApplication.uninstallApplication(appName) else: print 'app does not exists' #isExist = 0 print appOptions AdminApp.install(appPath, appOptions) print "before saving" AdminConfig.save() print "after saving" – Murali Krishna Jul 26 '16 at 07:31
  • print appManager print "before invoking" AdminControl.invoke(appManager, "startApplication", appName) – Murali Krishna Jul 26 '16 at 07:31
  • this is the scripts i have developed and can you please share the procedure or any sample to deploy the war file in remote location – Murali Krishna Jul 26 '16 at 07:34
0

Every one suggesting set the class path to wasanttask.jar or com.ibm.websphere.v61_6.1.100.ws_runtime.jar

and get the details.

but there is no jars is available with that name in WAS 8.5