140 likes | 332 Views
Rational Asset Manager v7.2 Using Scripting. Tutorial for using command line and scripting using Ant Tasks Carlos Ferreira Product Manager. Agenda. Setup Demo Downloading and Asset Demo Publishing and Asset Demo Relating assets to previously published assets. Setup Ant.
E N D
Rational Asset Manager v7.2 Using Scripting Tutorial for using command line and scripting using Ant Tasks Carlos Ferreira Product Manager
Agenda • Setup • Demo Downloading and Asset • Demo Publishing and Asset • Demo Relating assets to previously published assets
Setup Ant • Download Ant 1.7.1 or later - http://ant.apache.org/bindownload.cgi • Unzip files in C:\ant\ • Install Ant – Directions found here http://ant.apache.org/manual/index.html • Set environment variables • ANT_HOME=C:\ant\apache-ant-1.7.1 • JAVA_HOME=c:\jdk-1.5.0.05 or where ever you have Java with tools.jar • PATH=C:\ant\apache-ant-1.7.1\bin append to you existing path • Download Contributor files • http://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-0.6/ant-contrib-0.6-bin.zip/download • Unzip files and copy the ant-contrib-0.6.jar into the C:\ant\apache-ant-1.7.1\lib
Setup RAM scripting client jars • Go RAM Web Client, Help, Extensions • http://<hostname>:<port>/ram/ramclient.zip replace hostname and port http://ibmdev.com:9080/ram/ramclient.zip • Download ramclient.zip, unzip it to a folder, like C:\ramclient • Add unzipped folder on the ANT library path when you execute one of the ANT scripts. • ANT_HOME=C:\ant\apache-ant-1.7.1;C:\ramclient
Agenda • Setup • Demo Downloading and Asset • Demo Publishing and Asset • Demo Relating assets for published assets
Modify Download script to download and asset • Copy the file c:\ramclient\ramDownloadAsset.xml • Add the properties in black replacing the values with your own for the asset to download • Save the file <project name="downloadAnAsset" default="downloadAsset" xmlns:ram="antlib:com.ibm.ram.ant"> <property name="lib.dir" value="C:\libdir" /> <property name="ram.user.id" value="admin" /> <property name="ram.user.passwd" value="admin" /> <property name="ram.url" value="http://qvmw127.ibmratltst01.com:9080/ram.ws" /> <property name="ram.asset.quid" value="{8141FA04-E837-FA50-7052-5269E7C6937C}" /> <property name="ram.asset.version" value="1.0" /> <property name="build.id" value="1234" /> Directory to download asset to RAM WebService URL from Extensions page RAM asset unique id from Asset page RAM asset version from Asset page
Run download script Verbose • C:\ramclient>ant -v -lib C:\ramclient -file ramDownloadAsset-2.xml • Other options below • ant -v -lib <ramclient jars path> -file ramDownloadAsset.xml -Dlib.dir=<location where to download the artifacts> -Dram.url=<URL to repository location from Extension page> -Dram.user.id=<ram uid> -Dram.user.passwd=<ram passwd> -Dram.asset.quid=<guid> -Dram.asset.version=<version> -Dbuild.id=<An ID that denotes what this download is for> RAM scripts to download Ant command
Ant Script Help • Under Reference • Rational Asset Manager Custom ANT Library • Under Extending • BuildForge
Agenda • Setup • Demo Downloading and Asset • Demo Publishing and Asset • Demo Relating assets for published assets
Modify Publish script to publish an asset • Copy the file c:\ramclient\ramPublishAsset.xml • Add the properties in red box below replacing the values with your own for the asset to download • Save the file RAM WebService URL from Extensions page RAM asset unique name RAM asset version RAM asset unique ID and version this asset is related to as part of a release Build metadata about asset
Run publish script Verbose • C:\ramclient>ant -v -lib C:\ramclient -file ramPublishAsset-2.xml RAM scripts to publish Ant command
Agenda • Setup • Demo Downloading and Asset • Demo Publishing and Asset • Demo Relating assets for published assets
Modify RelateArtifacts-Link script to download and asset • Copy the file c:\ramclient\ramDownloadArtifactLinks.xml • Add the properties in black replacing the values with your own for the asset to download • Save the file. RAM WebService URL from Extensions page Eclipse workspace where rambuildercontrol.xml files are
Run publish script again this time with relate • Modify the publish script to also include all the related files that were dependencies in the project specified in the rambuildercontrol.xml in the .settings folder of the workspace • This will generate a relationship file in the ram.download.result.file location • Add properties: <property name="build.dir" value="C:\Documents and Settings\Administrator\Desktop\RTC Workspace\" /> <property name="ram.download.result.file" value="C:\BuildDir\publishresults" /> • C:\ramclient>ant -v -lib C:\ramclient -file ramPublishAsset-2.xml Verbose RAM scripts to publish Ant command