Repositories

Artifacts

Maven

uDeploy

Available Steps

Download Artifacts

Download artifacts from a VFS server to the working directory.

Sync Modes

Sync modes are set to determine what action will be taken with the files in the working directory as compaired to the files in the version being deployed. This is probably best described with examples. I will list the output of the download artifacts step given each mode of syncing.

Assumptions:

Working directory contains 1.txt-4.txt from version 1, and a 5.txt, not from a version

Version 2 contains 1.txt, 2.txt, 3.txt (which has been modified), and NOT 4.txt


Scenario 1, Sync:

Compared to the previously deployed version, Sync will only download and overwrite changed files and delete those removed from this version.


Deleting '4.txt'


Calculating hashes...

Computed hashes for 3 files.


Downloading 1 file...

Downloading file '.\3.txt'

Download complete


Not changed: './1.txt'

Not changed: './2.txt'


Scenario 2, None:

None will download and overwrite all files in this version, leaving any others.


Downloading files...

Downloading file '.\1.txt'

Downloading file '.\2.txt'

Downloading file '.\3.txt'

Download complete


Scenario 3, Sync and Clean:

Compared to the previously deployed version, Sync will only download on overwrite changed files and delete all others.


Deleting '.\4.txt'

Deleting '.\5.txt'


Calculating hashes...

Computed hashes for 3 files.


Downloading 1 file...

Downloading file '.\3.txt'

Download complete


Not changed: './1.txt'

Not changed: './2.txt'


Upload Artifacts

Upload artifacts to a VFS server from the working directory.

Verify Local Artifacts

Compare artifacts on local machine with inventory.

Source

Jenkins

Installing the Jenkins Plugin

  1. In your Jenkins interface, navigate to Manage Jenkins>Manage Plugins>Advanced.
  2. Click "choose file" and navigate to the urbandeploypublisher.hpi provided to you by Urbancode or drag the file from your file system browser to the "choose file' button, and click upload.
  3. Shutdown and restart Jenkins.
  4. From the Jenkins dashboard, navigate to Manage Jenkins>Configure System, and scroll to the UrbanDeploy Server section.
  5. Fill in the fields and click save.
  • Profile Name = The name you would like the Profile to have
  • UrbanDeploy URL = the web url for your uDeploy server. Don't forget the port
  • User Name = The username that Jenkins will use to access uDeploy
  • Password = The password for said user

!!!Note!!!! Jenkins often uses an older log4j file then our plugin needs. You may need to replace it. See below for instructions:

  1. Unpackage the jenkins.war
  2. Open /web-inf/lib in the unpacked .war's directory to determine the name of Jenkin's log4j.jar
  3. Navigate to your uDeploy server's %serverLocation%/lib directory and copy our log4j.jar to Jenkin's /web-inf/lib/ directory, overwriting the existing log4j with uDeploy's (rename it to match Jenkin's)

On standalone instances of Jenkins (not the Tomcat app), Jenkins keeps a hash of all of it's files and will throw an error when starting Jenkins due to a mismatched hash after modifying the log4j file. The only solution is to remove the values in the file that tracks the hashes.

Configure Your Jenkins Build to Push Artifacts to uDeploy

  1. Create a component in uDeploy with the Jenkins Source Config Type.
  2. From the Jenkins dashboard, click on the build that you would like to use to import artifacts
  3. Click Configure
  4. In the Post-build Action drop down menu, choose to publish artifacts to UrbanDeploy
  5. Fill in the fields and click save
  • UrbanDeploy Server = the profile for the uDeploy server you'd like to push artifacts to
  • Component = the name of the component that you created earlier that will be receiving the artifacts
  • Base Artifact Directory = the location Jenkins is storing the artifacts (${WORKSPACE} will take you to the base directory of the workspace)
  • Directory Offset = the sub-directory in the workspace where it should search for artifacts
  • Version = the name of the version to be created
  • Include = what files to include
  • Exclude = what files to exclude
  • Skip Publishing = click this if you want to disable publishing to uDeploy without deleting your configuration
  • Deploy = click this if you would like to initiate a deployment after the build and publication
  • Deploy Application = the application to use to deploy
  • Deploy Environment = the environment to deploy to
  • Deploy Process = the application process to use to deploy

Common Jenkins Errors

at java.lang.Thread.run(Thread.java:724) Caused by: java.lang.NoSuchMethodError: org.apache.log4j.Logger.isTraceEnabled()Z

  • Ensure you've switched out the log4j file as described above

ERROR: Failed to upload filesjava.lang.Exception: Error connecting to UrbanDeploy: UrbanDeploy returned error code: 400

  • Check to make sure your receiving component's source config type is set to Jenkins

ERROR: Failed to upload filesjava.lang.Exception: Server error adding path to staging directory: org.codehaus.jettison.json.JSONException: JSONObject["repoId"] not found.

  • Compare the name of your component between Jenkins and uDeploy

PVCS Checkout

Subversion

TeamForge