1
votes

my scenario is like this

  1. I have Jenkins server which triggers build flow ( this can't be changed )
  2. the source code is checkout out from 3 repos to the Jenkins server
  3. the files get manipulated and changed on the Jenkins server
  4. I installed azure self-hosted Linux agent in the Jenkins server.
    And it is online as I see it on the azure DevOps dashboard.
    in the Azure DevOps, i defined a project that checkouts simple azure-pipelines.yml.
    I want to copy files from the Jenkins server to the azure hosted agent and build there the files. then after the build is done I want to copy back the files to the Jenkins server

my missing part is how do i start the steps in the pipeline in the hosted azure that will listen to the self-hosted Linux server agent that it needs to copy the files?
also how i do trigger the self-hosted server to trigger pipeline steps in the hosted server.

1

1 Answers

0
votes

This isn't ideal... But what you could do:

  • disable all triggers on your azure pipeline
  • disable the repo checkout steps
  • add a queue time variable that can hold the location of the contents.
  • add a queue time variable that can hold the target location of the outcome.
  • on jenkins copy the contents to a central location
  • on jenkins, use the Rest API to trigger your Azure Pipelines build, pass the queue time variable
  • on Azure Pipelines add a script at the start to grab the contents from the variable location
  • on Azure Pipelines add a script at the end to copy the contents from the variable location
  • on Jenkins, use the REST API in a loop to detect the status of the pipeline

To get started: