wste 11012011 using headless build ant generate deploy able ear server deployment gregory
TRANSCRIPT
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
1/39
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
2/39
IBM Software Group
WebSphere Support Technical Exchange 2 of 39
Agenda
Automated builds in WID vs WPS
WID build script and Ant tasks
Running Ant scripts using WID
Automated component testingWPS build script and WPS/WAS Ant tasks
Running Ant scripts using WPS
Additional info on serviceDeploy
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
3/39
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
4/39
IBM Software Group
WebSphere Support Technical Exchange 4 of 39
Why two approaches?
Recommended: serviceDeploy
Simpler
Intended to be the command-line tool for packaging SCA applications prior todeployment
Headless WID
Avoids limitations of serviceDeploy
Some generated artifacts can only becreated using WID builds
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
5/39
IBM Software Group
WebSphere Support Technical Exchange 5 of 39
Basic WID build script
Checkout source projects from repository
Import projects into workspace
Build projects in workspace
Deploy projects to server
Run unit tests against deployed projects
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
6/39
IBM Software Group
WebSphere Support Technical Exchange 6 of 39
Basic WID build script
Checkout BuildImport
Projects in file system Projects in workspace Projects built
NextSlide
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
7/39
IBM Software Group
WebSphere Support Technical Exchange 7 of 39
Basic WID build script
Deploy Test
Projects on server Projects built Test results
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
8/39
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
9/39
IBM Software Group
WebSphere Support Technical Exchange 9 of 39
Simple WID Ant Script
Many script variations
For example, iterate over a list of project names
Project names to build stored in property file Projects to build computed from dependencies
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
10/39
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
11/39
IBM Software Group
WebSphere Support Technical Exchange 11 of 39
WID Ant tasks
Import projects into workspace:
Brings projects into WID workspace
Necessary if project folders were not previouslypart of a workspace
Alternative:
Brings projects into the workspace from aproject interchange file
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
12/39
IBM Software Group
WebSphere Support Technical Exchange 12 of 39
WID Ant tasks
Build projects:
Equivalent to building using WID workbench
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
13/39
IBM Software Group
WebSphere Support Technical Exchange 13 of 39
WID Ant tasksDeploy modules to server:
Equivalent to adding to the Servers view
Starts the server if needed
Starts the application after installingTo avoid a plain text password in the script,see wsadmin command reference
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
14/39
IBM Software Group
WebSphere Support Technical Exchange 14 of 39
WID Ant tasksAutomated testing:
Http call to Testcase servlet in test project
Puts results in a file
URL depends on what is being tested. See automated component test slides
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
15/39
IBM Software Group
WebSphere Support Technical Exchange 15 of 39
Running Ant scripts using WID
Command to launch headless WIDjava.exe %VMARGS% -cp %STARTUP_JAR%org.eclipse.core.launcher.Main -applicationcom.ibm.wbit.comptest.ant.RunAntWid -buildFile
MyBuild.xml
VMARGS: same values as WID\eclipse.ini
STARTUP_JAR:WID\plugins\org.eclipse.equinox.launcher.jar
See WID\bin\runAntWid.bat
Use runAntWID as-is or customize as needed
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
16/39
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
17/39
IBM Software Group
WebSphere Support Technical Exchange 17 of 39
Running Ant scripts using WID
Troubleshooting: investigate headless build errors
Try opening the workspace used in the Antscript with WID
Turn off auto builds to preserve previousbuild state
Compare a workspace built by WID with onebuilt using Ant script
Differences may give hint to cause
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
18/39
IBM Software Group
WebSphere Support Technical Exchange 18 of 39
Running Ant scripts using WID
Keep scripts simple as possible to isolate problems
Other RAD Ant tasks generally work
ImportProjectSet has been reported to causeproblems (WID index not populated properly)
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
19/39
IBM Software Group
WebSphere Support Technical Exchange 19 of 39
Automated component tests
To run component tests after deploying:http:// hostname : port /TestProjectName Web/TestServlet
To run individual test suites or test cases:TestServlet?suite= TestSuiteName
TestServlet?suite= TestSuiteName &testcases= testcase1 ,testcase2
To provide security credentialsTestServlet?username= username &password= password
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
20/39
IBM Software Group
WebSphere Support Technical Exchange 20 of 39
Automated component tests
Results returned as an XML string
Not currently in standard JUnit format, butusers typically use XSLT to use with JUnit tools
Example results
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
21/39
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
22/39
IBM Software Group
WebSphere Support Technical Exchange 22 of 39
Simple WPS Ant script
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
23/39
IBM Software Group
WebSphere Support Technical Exchange 23 of 39
WPS and WAS Ant tasks
Note: When using runAntWid, taskdefs are notnecessary
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
24/39
IBM Software Group
WebSphere Support Technical Exchange 24 of 39
WPS and WAS Ant tasks
Checkout source projects (Same as WID script)
Tasks such as bring projects into filesystem
f
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
25/39
IBM Software Group
WebSphere Support Technical Exchange 25 of 39
WPS and WAS Ant tasks
Zip projects:
Input to serviceDeploy is a project interchangefile
One PI file per moduleProject interchange file is a zip of the sourceproject and dependencies
IBM S f G
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
26/39
IBM Software Group
WebSphere Support Technical Exchange 26 of 39
WPS and WAS Ant tasks
Create deployable application:
IBM S f G
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
27/39
IBM Software Group
WebSphere Support Technical Exchange 27 of 39
WPS and WAS Ant tasks
Optional: Start the server:
IBM S ft G
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
28/39
IBM Software Group
WebSphere Support Technical Exchange 28 of 39
WPS and WAS Ant tasks
Install and start applications
IBM S ft G
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
29/39
IBM Software Group
WebSphere Support Technical Exchange 29 of 39
WPS and WAS Ant tasks
Automated testing:
Same as WID Ant script
Note: do not call WPS or WAS Ant tasks whenrunning Ant script using WID
Need to run in their own JVM
IBM Software Group
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
30/39
IBM Software Group
WebSphere Support Technical Exchange 30 of 39
Running Ant scripts using WPS
Command to launch ant script using WPS
ws_ant.bat -f MyBuildScript.xmlExample
C:\WID75\runtimes\bi_v7\bin>ws_ant.bat-f \Workspaces\BuildHWSampleSD.xml
IBM Software Group
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
31/39
IBM Software Group
WebSphere Support Technical Exchange 31 of 39
Running Ant scripts using WPS
Troubleshooting: if problems occur try
Compare EARs on server
Deployed from WID vs installed fromserviceDeploy
Compare EARs generated
From WID vs from serviceDeploy
IBM Software Group
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
32/39
IBM Software Group
WebSphere Support Technical Exchange 32 of 39
ServiceDeploy limitations
Before V7.0:
Component Test Projects not recognized
Java TM code not generated for
Custom mediations and maps Adapter bindings
Starting from 7.0.0.3
Adapter binding Java code not generated
IBM Software Group
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
33/39
IBM Software Group
WebSphere Support Technical Exchange 33 of 39
Building projects before and after v7.0
Prior to 7.0, SCA projects were built in WID or serviceDeploy
Installing an app on the server only created
general J2EE artifacts
IBM Software Group
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
34/39
IBM Software Group
WebSphere Support Technical Exchange 34 of 39
Building projects before and after v7.0
7.0 and beyond, SCA projects are build during appinstall.
WID does some building (e.g. Maps can be
tested when not running on the server) but notnecessary for deployment
ServiceDeploy simply packages projects as anEAR that is ready for install
IBM Software Group
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
35/39
IBM Software Group
WebSphere Support Technical Exchange 35 of 39
Summary
Covered differences between running WPS andWID ant scripts
Examples of each type of script with descriptions of
individual Ant tasksRunning automated component tests
Troubleshooting
IBM Software Group
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
36/39
IBM Software Group
WebSphere Support Technical Exchange 36 of 39
References
Automated builds: WID documentation:http://publib.boulder.ibm.com/infocenter/esbsoa/wesbv7r5/index.jsp?topic=%2Fcom.ibm.wbpm.wid.admin.doc%2Ftopics%2Ftscripttest.html
ServiceDeploy: WPS documentation:http://publib.boulder.ibm.com/infocenter/dmndhelp/v7r0mx/index.jsp?topic=%2Fcom.ibm.websphere.wps.doc%2Fdoc%2Frdev_servicedeploy.html
ServiceDeploy Ant Task documentation:http://publib.boulder.ibm.com/infocenter/dmndhelp/v7r0mx/topic/com.ibm.websphere.wps.doc/doc/tdep_usingant.html
wsadmin command reference:http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/rxml_commandline.html
http://publib.boulder.ibm.com/infocenter/esbsoa/wesbv7r5/index.jsp?topic=/com.ibm.wbpm.wid.admin.doc/topics/tscripttest.htmlhttp://publib.boulder.ibm.com/infocenter/esbsoa/wesbv7r5/index.jsp?topic=/com.ibm.wbpm.wid.admin.doc/topics/tscripttest.htmlhttp://publib.boulder.ibm.com/infocenter/dmndhelp/v7r0mx/index.jsp?topic=/com.ibm.websphere.wps.doc/doc/rdev_servicedeploy.htmlhttp://publib.boulder.ibm.com/infocenter/dmndhelp/v7r0mx/index.jsp?topic=/com.ibm.websphere.wps.doc/doc/rdev_servicedeploy.htmlhttp://publib.boulder.ibm.com/infocenter/dmndhelp/v7r0mx/topic/com.ibm.websphere.wps.doc/doc/tdep_usingant.htmlhttp://publib.boulder.ibm.com/infocenter/dmndhelp/v7r0mx/topic/com.ibm.websphere.wps.doc/doc/tdep_usingant.htmlhttp://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/rxml_commandline.htmlhttp://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/rxml_commandline.htmlhttp://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/rxml_commandline.htmlhttp://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/rxml_commandline.htmlhttp://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/rxml_commandline.htmlhttp://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/rxml_commandline.htmlhttp://publib.boulder.ibm.com/infocenter/dmndhelp/v7r0mx/topic/com.ibm.websphere.wps.doc/doc/tdep_usingant.htmlhttp://publib.boulder.ibm.com/infocenter/dmndhelp/v7r0mx/topic/com.ibm.websphere.wps.doc/doc/tdep_usingant.htmlhttp://publib.boulder.ibm.com/infocenter/dmndhelp/v7r0mx/index.jsp?topic=/com.ibm.websphere.wps.doc/doc/rdev_servicedeploy.htmlhttp://publib.boulder.ibm.com/infocenter/dmndhelp/v7r0mx/index.jsp?topic=/com.ibm.websphere.wps.doc/doc/rdev_servicedeploy.htmlhttp://publib.boulder.ibm.com/infocenter/esbsoa/wesbv7r5/index.jsp?topic=/com.ibm.wbpm.wid.admin.doc/topics/tscripttest.htmlhttp://publib.boulder.ibm.com/infocenter/esbsoa/wesbv7r5/index.jsp?topic=/com.ibm.wbpm.wid.admin.doc/topics/tscripttest.html -
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
37/39
IBM Software Group
-
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
38/39
IBM Software Group
WebSphere Support Technical Exchange 38 of 39
Connect with us!
1. Get notified on upcoming webcastsSend an e-mail to [email protected] with subject line wste subscribe to get a list of mailing lists and to subscribe
2. Tell us what you want to learnSend us suggestions for future topics or improvements about our webcasts to [email protected]
3. Be connected!Connect with us on FacebookConnect with us on Twitter
IBM Software Group
mailto:[email protected]?subject=wste%20subscribemailto:[email protected]?subject=wste%20subscribemailto:[email protected]://www.facebook.com/pages/WebSphere-Support-Technical-Exchange/121293581419http://www.twitter.com/ibmwstehttp://www.twitter.com/ibmwstehttp://www.facebook.com/pages/WebSphere-Support-Technical-Exchange/121293581419mailto:[email protected]:[email protected]?subject=wste%20subscribemailto:[email protected]?subject=wste%20subscribe -
8/3/2019 WSTE 11012011 Using Headless Build Ant Generate Deploy Able Ear Server Deployment Gregory
39/39
IBM Software Group
b h h l h f
Questions and Answers