DevOps Automation

 View Only
Expand all | Collapse all

I need help to push Jenkins build to UrbanCode Velocity

  • 1.  I need help to push Jenkins build to UrbanCode Velocity

    Posted Thu February 23, 2023 05:47 AM

    Hello everyone, wish you guys a good day.

    I'm facing an issue when trying to push Jenkins build to UrbanCode Velocity.

    For Jenkins server, I've installed UrbanCode Velocity plugin and configured connection to Velocity server.

    Then, I created a Jenkins pipeline with script to push Jenkins build to Velocity

    stage ("Build") {
            echo "Building ${VELOCITY_APP_NAME} (Build:${currentBuild.displayName}, GIT_COMMIT:${GIT_COMMIT})"
            step([$class: 'UploadBuild', 
               tenantId: "<tenantId>",
               revision: "${GIT_COMMIT}",
               appName: "${VELOCITY_APP_NAME}",
               versionName:"${currentBuild.displayName}",
               requestor: "admin",
               status: "success",
               name: "upload build asm",
               id: "${currentBuild.displayName}",
               appId: "<appId>"
            ])
        }
    

    And got message on Jenkins 

    > Could not upload builds to Velocity as there is no configuration specified.

    Does anyone know how to fix this?

    Thanks you for your time!



    ------------------------------
    Tung Vu Thanh
    ------------------------------


  • 2.  RE: I need help to push Jenkins build to UrbanCode Velocity

    User Group Leader
    Posted Fri February 24, 2023 11:11 AM

    Did you had a look at this article: https://urbancode.github.io/velocity-info/workbooks/introductionToValueStreams.html#4-working-with-jenkins

    it may give you some insight.



    ------------------------------
    Osman Burucu
    Product Manager UrbanCode Family
    IBM
    Vienna
    00431211454746
    ------------------------------



  • 3.  RE: I need help to push Jenkins build to UrbanCode Velocity

    Posted Fri February 24, 2023 07:40 PM

    Yeah, i did. I followed exactly that article, but still getting the issue.



    ------------------------------
    Tung Vu Thanh
    ------------------------------



  • 4.  RE: I need help to push Jenkins build to UrbanCode Velocity

    Posted Sun February 26, 2023 08:19 PM

    Hello there, you said you configured the velocity plugin in Jenkins, but did you also configure a Jenkins integration in Velocity ? 

    Muriel



    ------------------------------
    Muriel VIALE
    Technical Pre-sale consultant
    IBM
    La Gaude
    (049) 211-4264
    ------------------------------



  • 5.  RE: I need help to push Jenkins build to UrbanCode Velocity

    Posted Mon February 27, 2023 01:37 AM

    Yes i did, that where i got Integration ID and Integration Token for my Jenkins server configuration.

    Any other ideas?

    Thanks for replying!



    ------------------------------
    Tung Vu Thanh
    ------------------------------



  • 6.  RE: I need help to push Jenkins build to UrbanCode Velocity

    User Group Leader
    Posted Mon March 06, 2023 07:18 AM

    have you checked if the velocity app name exists in the pipeline view in velocity? 



    ------------------------------
    Osman Burucu
    Product Manager UrbanCode Family
    IBM
    Vienna
    00431211454746
    ------------------------------



  • 7.  RE: I need help to push Jenkins build to UrbanCode Velocity

    Posted Mon March 06, 2023 10:18 PM

    Yeah i've checked it, the app name exist in pipeline view, you can see below



    ------------------------------
    Tung Vu Thanh
    ------------------------------



  • 8.  RE: I need help to push Jenkins build to UrbanCode Velocity

    Posted Thu March 09, 2023 02:47 AM

    By the way, I'm using UrbanCode Velocity CE, does this cause any effect?



    ------------------------------
    Tung Vu Thanh
    ------------------------------



  • 9.  RE: I need help to push Jenkins build to UrbanCode Velocity

    User Group Leader
    Posted Mon March 13, 2023 03:23 AM

    No shouls not be a problem. Please could you also show the jenkins pipeline with the code? maybe there is something different?



    ------------------------------
    Osman Burucu
    Product Manager UrbanCode Family
    IBM
    Vienna
    00431211454746
    ------------------------------



  • 10.  RE: I need help to push Jenkins build to UrbanCode Velocity

    Posted Mon March 13, 2023 09:54 PM
    Edited by Tung Vu Thanh Mon March 13, 2023 09:56 PM

    Sure, here's my jenkins pipeline script

    node {
    
        //URL to Github repository https://github.com/<owner>/<repo>
        def GITHUB_REPO_URL="https://github.com/Bigguy98/AssetManagement"
        def GITHUB_BRANCH="master"
        
        //Retrieve ENV ID values for DEV and Staging from "Download attributes from API" json file
        def VELOCITY_ENV_ID_DEV="9a2062d9-dd5c-4866-93b0-a57fa7535d77"
        def VELOCITY_ENV_ID_STAGING="12f789ed-e9ba-4485-a4f6-ee43dfa3de3e"
    
        //VELOCITY_APP_NAME must match your Velocity pipeline application name
        def VELOCITY_APP_NAME="ASMModule01"
    
        //Do not change below this line.
        def GIT_COMMIT
        
        stage ('cloning the repository'){
          currentBuild.displayName = "2.1.1.${BUILD_NUMBER}"
          majorVersion="${BUILD_NUMBER}"
          def scm = git branch: "${GITHUB_BRANCH}", url: "${GITHUB_REPO_URL}"
          GIT_COMMIT = sh(returnStdout: true, script: "git rev-parse HEAD").trim()
          echo "GIT_COMMIT=${GIT_COMMIT}"
        }
        stage ("Build") {
            echo "Building ${VELOCITY_APP_NAME} (Build:${currentBuild.displayName}, GIT_COMMIT:${GIT_COMMIT})"
            step([$class: 'UploadBuild', 
                tenantId: "5ade13625558f2c6688d15ce",
                revision: "${GIT_COMMIT}",
                appName: "${VELOCITY_APP_NAME}",
                versionName:"${currentBuild.displayName}",
                requestor: "admin",
                status: "success",
                name: "upload build asm",
               id: "${currentBuild.displayName}",
               appId: "109d65fc-a45e-4577-98b1-b75e7f4ec226"
            ])
        }
    
    }

    And this is attributes API I got from Velocity 

    {
      "pipelineId": "c5cc6f20-aa0e-4100-aab6-1d45b71f72cf",
      "tenantId": "5ade13625558f2c6688d15ce",
      "environments": [
        {
          "name": "Input",
          "id": "0c7ab5a5-5b9b-4c40-9ad9-ad5dfb5e2e3a"
        },
        {
          "name": "DEV",
          "id": "9a2062d9-dd5c-4866-93b0-a57fa7535d77"
        },
        {
          "name": "Staging",
          "id": "12f789ed-e9ba-4485-a4f6-ee43dfa3de3e"
        },
        {
          "name": "PROD",
          "id": "0ba3657c-33b1-45e6-9b4b-aea4b869dc01"
        }
      ],
      "applications": [
        {
          "name": "ASMModule01",
          "id": "109d65fc-a45e-4577-98b1-b75e7f4ec226"
        }
      ]
    }

    If you need anything else, please tell me.

    Thanks for your time!



    ------------------------------
    Tung Vu Thanh
    ------------------------------



  • 11.  RE: I need help to push Jenkins build to UrbanCode Velocity

    User Group Leader
    Posted Mon April 03, 2023 02:41 AM

    Hello Tung,

    Please accept my aplogies for slow reaction, we were preparing for new releases. With Velocity 4.0.9 we also have provided a totally new Jenkins plug-in. This new plug-in is now a Velocity native plug-in, means you install it only in Velocity and configure it from there to access Jenkins data. No need to change your jobs anymore. 
    The documentation of the plug-in is not released now but should be done in a few days. Please have a look at it



    ------------------------------
    Osman Burucu
    Product Manager UrbanCode Family
    IBM
    Vienna
    00431211454746
    ------------------------------



  • 12.  RE: I need help to push Jenkins build to UrbanCode Velocity

    Posted Mon April 03, 2023 03:22 AM

    Dear Mr. Burucu,
    Thank you for your response. The new release of Velocity sounds great, I'm looking forward to try it.  I just want to ask if it still available for trial/community edition?



    ------------------------------
    Tung Vu Thanh
    ------------------------------



  • 13.  RE: I need help to push Jenkins build to UrbanCode Velocity

    User Group Leader
    Posted Mon April 24, 2023 03:50 AM

    Yes it should be available as trial/community edition. You should be able to download it from IBM FixCentral (search for 4.0.8 as installed version to get 4.0.9)



    ------------------------------
    Osman Burucu
    Product Manager UrbanCode Family
    IBM
    Vienna
    00431211454746
    ------------------------------



  • 14.  RE: I need help to push Jenkins build to UrbanCode Velocity

    Posted 16 days ago

    Hi Tung

    I noticed in the above image that you have not mapped the Jenkins jobs to the each of the pipeline environments.

    Click on the "+" in each - Input, Dev, Staging, and PROD. Select the Jenkins job which does the build to populate the Input column. Repeat the process mapping the Jenkins jobs used to deploy that build to the Dev, Staging and PROD envs. When done, you should see the build version available for deployment (Input) and which version resides in each of the pipeline stages.

    Al



    ------------------------------
    Al Wagner
    ------------------------------