DevOps Platform

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

    Posted 30 days ago

    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 29 days ago

    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 29 days ago

    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 26 days ago

    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 26 days ago

    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 19 days ago

    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 18 days ago

    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 16 days ago

    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 12 days ago

    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 11 days ago
    Edited by Tung Vu Thanh 11 days ago

    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
    ------------------------------