Use specific executor based on branch with dynamic configuration

Switch executors based on branch

It is possible to utilize a common tool such as sed in order to choose an executor to run by changing the line in place like so:

setup: true

version: 2.1

orbs:
continuation: circleci/continuation@0.3.1

workflows:
setup:
when:
equal: [ main, << pipeline.git.branch >> ]
jobs:
- continuation/continue:
configuration_path: ".circleci/continue-config1.yml"
parameters: /home/circleci/parameters.json
pre-steps:
- checkout
- run:
name: Based on branch, choose executor
command: |
sed -i 's/base\:edge/node\:latest/g' ./.circleci/continue-config1.yml
cat ./.circleci/continue-config1.yml
Was this article helpful?
0 out of 3 found this helpful

Comments

0 comments

Article is closed for comments.