Refreshing Build Assets / CI (Jenkins) Integration

Document created by Dave Murphy Employee on Dec 6, 2017
Version 1Show Document
  • View in full screen mode

When we integrate with a CI system, it is not uncommon for the customer's build management team to have policies that restrict their  "ownership" of (i.e. downloading and storing copies of) 3rd party code that their builds depend on. In this case, we are talking about the Akamai CloudTest scommand command-line utility, which the Jenkins integration depends on.

 

Furthermore, scommand is refreshed from time to time as CloudTest versions change, so it is a best practice to ensure that your scommand utility is kept up-to-date with your CloudTest instance. This technique ensures that your local copy of scommand and CloudTest are always kept in sync.

 

In your Ant build XML, you would have lines such as these inside a target definition - some of these items are part of the Jenkins integration template:

 

<!-- You must set all paths to YOUR system's paths - these are listed as a reference only! -->

<property name="scommand.home" location="${user.home}/.jenkins/scommand" />

 

<!-- pull down the latest SOASTA scommand from YOUR CT instance -->
<get src="http://[CT SERVER IP ADDRESS/HOSTNAME]/concerto/downloads/scommand/scommand.zip"
dest="${scommand.home}/scommand.zip" />

 

<unzip src="${scommand.home}/scommand.zip" dest="${scommand.home}/scommand" overwrite="true"/>

 

<path id="scommand.classpath">
  <fileset dir="${scommand.home}/lib">
    <include name="*.jar" />
  </fileset>
</path>

 

 

Jenkins console output for a this technique combined with a simple CloudTest execution looks like this:

Started by user anonymousBuilding in workspace /Users/bsb/.jenkins/jobs/CTLite/workspace 
[.jenkins] $ ant -file apache-ant-sample.xml play-tests Buildfile: /Users/bsb/.jenkins/apache-ant-sample.xml play-tests:      
[get] Getting: http://[CT SERVER IP ADDRESS]/concerto/downloads/scommand/scommand.zip     
[get] To: /Users/bsb/.jenkins/scommand.zip    
[unzip] Expanding: /Users/bsb/.jenkins/scommand.zip into /Users/bsb/.jenkins/scommand     
[play] Playing "/Recordings/TestComp_FieldOfDreams"     
[play] Finished in 13.413 sec. 
BUILD SUCCESSFULTotal time: 15 seconds Recording test results Finished: SUCCESS

 

NOTE:

The best way to handle this on-demand build technique is to have a build script that pulls down the CloudTest assets once a day at the beginning of your build cycle, rather than adding this particular Ant target technique to every build configuration, which would have unintended consequences, such as concurrent builds impacting each other.

Attachments

    Outcomes