Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTS How to Trigger a Deployment Containing Multiple Release Definitions

We have 20 release definitions that need to be deployed together for a deployment to an environment.

Is there a way to link the release definitions and manually trigger a "global" release to deploy all 20 release definitions to a specific environment?

At this moment we manually start each release, lots of clicking!

Thank you!!

like image 357
Brian Avatar asked Mar 08 '18 20:03

Brian


People also ask

How do you trigger a release pipeline from another release pipeline?

To trigger a pipeline upon the completion of another pipeline, configure a pipeline resource trigger. The following example configures a pipeline resource trigger so that a pipeline named app-ci runs after any run of the security-lib-ci pipeline completes. This example has the following two pipelines.

How do you trigger deployment in Azure DevOps?

Select trigger: Set the trigger that will start the deployment to this stage automatically. Select "Release" to deploy to the stage every time a new release is created. Use the "Stage" option to deploy after deployments to selected stages are successful. To allow only manual deployments, select "Manual".

Can a azure pipeline have multiple triggers?

Check this out docs.microsoft.com/en-us/azure/devops/pipelines/test/… Yes, you can have multiple .

What is multi-stage deployment?

The multi-stage pipelines feature is relatively new in Azure DevOps, and it is currently in preview mode. This feature allows you to split the deployment process into multiple stages and reuse them across multiple projects. Pipelines are described in yaml format.


1 Answers

You could create/manage releases through the VSTS API.

https://www.visualstudio.com/en-us/docs/integrate/api/rm/releases

specifically look at the example for "Start deployment on an environment".

An example scenario could look like this

  1. Create a release from the API

    POST https://{instance}/{project}/_apis/release/releases?api-version={4.0-preview.4}
    
  2. The response "A Release object" will contain key elements you need to trigger environment deployments. You'll need the Release ID and the environment ID(s). Find this in the response release ID will be returned in the response, save it, this is your key to automating environment deployments later

  3. Let's say the release ID created was 77 and the environment (Production) id was 3

  4. The final step is to kick off a release:

    PATCH https://{instance}/{project}/_apis/Release/releases/77/environments/3
    
    {
        "status": "inProgress",
        "scheduledDeploymentTime": null,
        "comment": null
    }
    
like image 130
raterus Avatar answered Nov 07 '22 07:11

raterus