Combine "triggers" and dynamic-config

Hello,

We’re using the path-filtering which uses dynamic configuration pipelines underneath. I’m trying to combine but path-filtering/filter with triggers but although the configuration is valid, circleCI comes with “No Workflow”, hence nothing runs.

My config:

workflows:
  deploy:
    triggers:
      - schedule:
          cron: "0 8 * * *"
          filters:
            branches:
              only:
                - develop
    jobs:
      # infra related jobs
      - queue/block_workflow:
          circleci-api-key: CIRCLECI_TOKEN
      - infra-janitor:
          cluster: << pipeline.parameters.cluster_id_dev >>
          dryrun: false
          requires:
            - queue/block_workflow
      # Decide what to deploy
      - path-filtering/filter:
          config-path: .circleci/config_continue.yml
          base-revision: HEAD~1
          mapping: |
            modules/path1.* workflow1 true
            modules/path2.* workfow2 true
          filters:
            branches:
              only:
                - /dev\/.*/
                - develop

If I comment out triggers and other jobs the setup works as expected, otherwise doesn’t.

Is there any way I can combine the two?

Hi @atmosx
I was trying to do the same thing and I managed to figure it out. My configs isn’t the same as yours but you’ll be able to achieve the desired effect with some copy paste.

You’ll need to use the Triggers functionality in your Project Settings.
Add Trigger with the parameter to select which workflow to run. In my case, I use nightly: true.

Here’s my config, hopefully it helps someone out:

# iOS CircleCI 2.1 configuration file
version: 2.1

setup: true
orbs:
  tb-services: touchbistro/tb-services@volatile
  slack: circleci/slack@3.4.2
  path-filtering: circleci/path-filtering@0.1.2
  continuation: circleci/continuation@0.2.0

################################# PARAMETERS ####################################
parameters:
  nightly:
    type: boolean
    default: false

workflows:
  workflow_analysis:
    when:
      not: <<pipeline.parameters.nightly>>
    jobs:
      - project_analysis
      - path-filtering/filter:
          name: "PR Workflow"
          mapping: |
            Shared/.* build-and-test true
            iOS/.* build-and-test-ios true
            macOS/.* build-and-test-macos true
          base-revision: master
          config-path: .circleci/continue_config.yml
          requires:
            - project_analysis

  nightly-cron:
    when: <<pipeline.parameters.nightly>>
    jobs:
      - continuation/continue:
          name: "Nightly Regression Workflow"
          configuration_path: ./nightly.yml

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.