Release Automation

 View Only
  • 1.  Updating an existing deployment with a new artifact package

    Posted Feb 09, 2015 05:31 PM

    Hello,

    I was wondering if anyone could shed some light on a particular issue we are experiencing with the move from 4.7 to 5.0+. We are using the "CA Release Automation Deployment Plugin" for Jenkins CI and have run into the limitation of deploying SNAPSHOT artifacts using this new configuration.

     

    By SNAPSHOT artifacts I mean a Jenkins job configured to use Apache Maven. There are two types of artifacts that are built in this configuration. For example:

    myapp-1.0.0-SNAPSHOT

    myapp-1.0.0

    These artifacts are then pushed to our Sonatype Nexus artifact repository.

     

    This new plugin is great because it allows the user to define the Artifact Source in order to tightly integrate with RA Deployment processes. For example, you can define your artifact like this:

    Artifact Type: RPM

    Artifact Definition: ${nolio.artifact.name}

    Artifact Version: ${nolio.artifact.version}

    Artifact Version Description:${BUILD_URL}

     

    Artifacts Source: REPOSITORY

    Repository URL: http://***.sppcorp.org:8080/nexus/content/groups/ExampleGroup

    Repository Username: admin    

    Repository Password: ****

    Repository Type: rpm

    Repository Classfier: rpm

    Repository GroupId: ${nolio.artifact.groupId}

    Repository ArtifactId: ${nolio.artifact.name}

    Repository Artifact Version: ${nolio.artifact.version}

     

    This will not work for SNAPSHOT artifacts. The following error message is generated:

    Stage Error Details: ["Failed to download artifact [Artifact [ topmap.RPM'ver. 1.0.2-SNAPSHOT']] to retrieval agent [xxxx.sppdev.org]. Local agent error is [Retrieval action failed - <br/>Internal Error:<br/>Artifact download failed: Http Get request from url [http://xxxx.sppcorp.org:8080/nexus/content/groups/ExampleGroup/org/spp/automation/nolio/cfgmgt/topmap/1.0.2-SNAPSHOT/topmap-1.0.2-SNAPSHOT-rpm.rpm] ]"]

     

    This is because a SNAPSHOT artifact is just the top layer of multiple underlying artifacts that are generated each time you build your code. In this example the correct URL would be:

    http://xxxxx.sppcorp.org:8080/nexus/content/groups/ExampleGroup/org/spp/automation/nolio/cfgmgt/topmap/1.0.2-SNAPSHOT/…

     

    This leaves the deployment in a (Pending Artifacts Distribution) state.


    What steps should I take in order to remove the current deployments artifact package and add a new one? Can this been done? I have tried multiple REST API commands but it seems like there isn't a way to update a deployment when its in this state (Pending Artifacts Distribution).

     

    The assgin-new-artifact-package-to-deployment-plan REST call seems like it would work but when I try to do this with a pre-existing artifact package the follow error occurs.

    Input:

    {

    "deploymentPlan":"Jenkins-topmap",

    "applicationId":"10",

    "application":"esbmon",

    "build":"http://xxxx.sppdev.org:8080/job/topmap/23/",

    "project":"Deploy RPM",

    "xml":"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><p:package xmlns:p=\"http://www.example.org/ArtifactPackage\"><p:name>testPackage</p:name><p:description>Creates a test package containing a HTTP artifact.</p:description><p:artifactVersionByPath><p:definition>topmap</p:definition><p:type>RPM</p:type><p:version>1.0.2-SNAPSHOT-test</p:version></p:artifactVersionByPath></p:package>"

    }

     

    Output:

    {

    "description": "Failed to create artifact-package [validate artifact package creation/update]",

    "result": false

    }



  • 2.  Re: Updating an existing deployment with a new artifact package

    Posted Feb 27, 2015 12:04 PM

    Anyone have any feedback for JJ?

     

    Thanks

    CJ

     

    Hello,

    I was wondering if anyone could shed some light on a particular issue we are experiencing with the move from 4.7 to 5.0+. We are using the "CA Release Automation Deployment Plugin" for Jenkins CI and have run into the limitation of deploying SNAPSHOT artifacts using this new configuration.

     

    By SNAPSHOT artifacts I mean a Jenkins job configured to use Apache Maven. There are two types of artifacts that are built in this configuration. For example:

    myapp-1.0.0-SNAPSHOT

    myapp-1.0.0

    These artifacts are then pushed to our Sonatype Nexus artifact repository.

     

    This new plugin is great because it allows the user to define the Artifact Source in order to tightly integrate with RA Deployment processes. For example, you can define your artifact like this:

    Artifact Type: RPM

    Artifact Definition: ${nolio.artifact.name}

    Artifact Version: ${nolio.artifact.version}

    Artifact Version Description:${BUILD_URL}

     

    Artifacts Source: REPOSITORY

    Repository URL: http://***.sppcorp.org:8080/nexus/content/groups/ExampleGroup

    Repository Username: admin   

    Repository Password: ****

    Repository Type: rpm

    Repository Classfier: rpm

    Repository GroupId: ${nolio.artifact.groupId}

    Repository ArtifactId: ${nolio.artifact.name}

    Repository Artifact Version: ${nolio.artifact.version}

     

    This will not work for SNAPSHOT artifacts. The following error message is generated:

    Stage Error Details: ["Failed to download artifact [Artifact [ topmap.RPM'ver. 1.0.2-SNAPSHOT']] to retrieval agent [xxxx.sppdev.org]. Local agent error is [Retrieval action failed - <br/>Internal Error:<br/>Artifact download failed: Http Get request from url [http://xxxx.sppcorp.org:8080/nexus/content/groups/ExampleGroup/org/spp/automation/nolio/cfgmgt/topmap/1.0.2-SNAPSHOT/topmap-1.0.2-SNAPSHOT-rpm.rpm] ]"]

     

    This is because a SNAPSHOT artifact is just the top layer of multiple underlying artifacts that are generated each time you build your code. In this example the correct URL would be:

    http://xxxxx.sppcorp.org:8080/nexus/content/groups/ExampleGroup/org/spp/automation/nolio/cfgmgt/topmap/1.0.2-SNAPSHOT/…

     

    This leaves the deployment in a (Pending Artifacts Distribution) state.


    What steps should I take in order to remove the current deployments artifact package and add a new one? Can this been done? I have tried multiple REST API commands but it seems like there isn't a way to update a deployment when its in this state (Pending Artifacts Distribution).

     

    The assgin-new-artifact-package-to-deployment-plan REST call seems like it would work but when I try to do this with a pre-existing artifact package the follow error occurs.

    Input:

    {

    "deploymentPlan":"Jenkins-topmap",

    "applicationId":"10",

    "application":"esbmon",

    "build":"http://xxxx.sppdev.org:8080/job/topmap/23/",

    "project":"Deploy RPM",

    "xml":"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><p:package xmlns:p=\"http://www.example.org/ArtifactPackage\"><p:name>testPackage</p:name><p:description>Creates a test package containing a HTTP artifact.</p:description><p:artifactVersionByPath><p:definition>topmap</p:definition><p:type>RPM</p:type><p:version>1.0.2-SNAPSHOT-test</p:version></p:artifactVersionByPath></p:package>"

    }

     

    Output:

    {

    "description": "Failed to create artifact-package [validate artifact package creation/update]",

    "result": false

    }