javajenkinsazure-devopsdevopspvcs

Can we upload aritfacts (.jar/.zip) created as part of jenkins pipeline to Azure Devops?


I am working on a project which needs me to migrate the storage of artifacts from PVCS to Azure Devops. (Problem statement was provided like that)

Current Setup:

The Jenkins Pipeline takes a master.xls file from a folder created (unique for each build number) in PVCS and based on the data manually entered into master.xls, it interacts with Pega DB and creates an Artifact (Rules.Zip).

To interact with the PEGA DB, the Jenkins job executes few Java programs and executes a few batch and ant scripts. The ant scripts produce the artifacts.

Finally it stores that artifact in the same PVCS folder created initially with an empty master.xls file.

Jenkins is interacting with PVCS usling PCLI commands which will be executed from Java programs run by Jenkins jobs.

Required Setup:

The PVCS needs to be replaced with Azure Devops, i.e. the Jenkins Pipeline should be able to do the following:

  1. Create a folder in Azure Devops with an empty master.xls
  2. After master.xls is updated manually, The pipeline should be interacting with Pega DB as usual and store the artifact thus created into Azure Devops.

I am pretty new to Azure Devops. Kindly help me understand if the said requirement is possible and If so, how can that be achieved. A list of abstract steps would be of great help. I will work on them.


Solution

  • There is Jenkins Download Artifacts task in azure devops pipeline that you can make use of to download the artifacts from Jenkins pipeline to azure devops pipeline.

    First you need to create Jenkins service connection in your azure devops project. Open the Service connections page under the project settings page, and select New service connection and choose Jenkins. enter image description here

    Then you can initialize a empty azure repo. Click the + beside your project name and select New Repository

    enter image description here

    Then you need to create a build pipeline, selecting your azure repo as the location of your source code. Below example is in classic view(Choose use the classic editor to create a classic view build pipepline).

    enter image description here

    Then choose start with an empty job to create a empty build pipeline enter image description here

    When your pipeline is initiated you can add Jenkins Download Artifacts task to download the artifacts from Jenkins pipeline. And you can add command line task to run git command in your pipeline to commit and push the artifacts to your azure repo.

    enter image description here

    You can also add Publish build artifacts task to publish the artifacts to azure devops pipeline server.

    Here is more information about how to integrate Jenkins with azure devops.