Nayden Van
Nayden Van

Reputation: 1569

Azure pipeline cron trigger

I have an azure DevOps pipeline in yaml format that I would like to run every 3 hours.

I configured the yaml file to have a cron trigger as follow:

schedules:
  - cron: '0 */1 * * *'
    displayName: Daily Trigger
    branches:
      include:
        - master
    always: true

variables:
  vmImageName: 'ubuntu-latest'

steps:
  - task: UsePythonVersion@0
    inputs:
      versionSpec: '3.x'
      addToPath: true
  - script: |
      python -m pip install --upgrade pip
      pip install selenium

  - task: Pythonscript@0
    inputs:
      scriptSource: 'filePath'
      scriptPath: './test.py'

But the pipeline does not trigger at all. Am I missing something?

Upvotes: 0

Views: 2368

Answers (1)

Krzysztof Madej
Krzysztof Madej

Reputation: 40849

Please check your branch name in cron schedule. If you have there a typo it could be a reason why it doesn't work.

I tested with this:

schedules:
  - cron: '* */3 * * *'
    displayName: Daily Trigger
    branches:
      include:
        - master
    always: true


trigger: none
pr: none

pool:
  vmImage: ubuntu-latest

steps:
- script: echo Hello, world!
  displayName: 'Run a one-line script'

- script: |
    echo Add other tasks to build, test, and deploy your project.
    echo See https://aka.ms/yaml
  displayName: 'Run a multi-line script'

And it works:

enter image description here

Can you try to re-add your pipeline?

Upvotes: 2

Related Questions