Sanjeev
Sanjeev

Reputation: 495

queue a azure pipeline yaml stage to execute at specific datetime

We have a multistage release pipeline which targets all environments like dev->int->qa->prod-staging slot. For final swaping of slot we have a requirement to to run at specified datetime during non-business hrs. How can we delay a specific stage of multi stage yaml to run at certain datetime.

Upvotes: 1

Views: 1113

Answers (1)

Mengdi Liang
Mengdi Liang

Reputation: 18958

Though I agree with the idea of Hany, but the link he shared is about the Release which configured with UI. It does not suitable for your multi-stage YAML pipeline.

Since what you are using is multi-stage YAML pipeline, you can check below sample to configure the corresponding schedule trigger into your YAML.

For example, here is the schedule which make the YAML pipeline run at Sunday weekly:

schedules:
- cron: "0 12 * * 0"
  displayName: Build on Sunday weekly
  branches:
    include:
    - releases/*
  always: true

For 0 12 * * 0, it is following the syntax of:

mm HH DD MM DW
 \  \  \  \  \__ Days of week
  \  \  \  \____ Months
   \  \  \______ Days
    \  \________ Hours
     \__________ Minutes

I saw you said you want this pipeline run during non-business hours, so you can focus on the last field DW(Days of week). It's available value it 0~6 and starting with Sunday.Or you can input with like Sun:

"0 12 * * Sun"

Check this doc for more details.

Upvotes: 2

Related Questions