Skip to content

Commit

Permalink
fix-docs: auto-detect is true by default; fix ignore file includes (#51)
Browse files Browse the repository at this point in the history
* fix .gitignore includes for modules
* add logging methods
* corrects logic

---------

Co-authored-by: Emma Doyle <emma@sbevision.com>
  • Loading branch information
emmeowzing and Emma Doyle committed May 13, 2023
1 parent 217f901 commit 8b52c8f
Show file tree
Hide file tree
Showing 10 changed files with 161 additions and 86 deletions.
8 changes: 2 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ setup: true
orbs:
orb-tools: circleci/orb-tools@11.6.1
circleci-cli: circleci/circleci-cli@0.1.9
dynamic: bjd2385/dynamic-continuation@dev:alpha
# dynamic: bjd2385/dynamic-continuation@3.5.0
# dynamic: bjd2385/dynamic-continuation@dev:alpha
dynamic: bjd2385/dynamic-continuation@3.6.7
general: bjd2385/general@0.6.3
slack: circleci/slack@4.12.5

Expand All @@ -28,10 +28,6 @@ workflows:

- dynamic/continue:
context: orb-publishing
filters:
branches:
ignore:
- master

# On tag

Expand Down
20 changes: 4 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
args: [--maxkb=10000, --enforce-all]
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: mixed-line-ending
- id: trailing-whitespace
Expand All @@ -16,20 +16,8 @@ repos:
- id: shellcheck
args:
- -x
- -s
- bash

- repo: https://github.com/bjd2385/circleci-config-pre-commit-hook
rev: v1.1.2
hooks:
- id: circleci-config-validate

# - repo: https://github.com/premiscale/pre-commit-hooks
# rev: v0.0.9
# hooks:
# - id: msg-issue-prefix

- repo: https://github.com/bjd2385/circleci-orb-pre-commit-hook
rev: v1.3.2
- repo: https://github.com/premiscale/pre-commit-hooks
rev: v0.0.9
hooks:
- id: circleci-orb-validate
- id: msg-issue-prefix
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@ Get up-and-running with dynamically continued pipelines in these 4 steps:

1. Add this orb, a `continue` job to your CI config (`.circleci/config.yml`), and the `setup` keyword, such as

```shell
setup: true
```shell
setup: true

orbs:
dynamic: bjd2385/dynamic-continuation@<version>
orbs:
dynamic: bjd2385/dynamic-continuation@<version>

workflows:
on-commit:
jobs:
- dynamic/continue:
auto-detect: true
context: circleci
```
workflows:
on-commit:
jobs:
- dynamic/continue:
context: circleci
```

2. Enable **setup workflows** in your project under **Advanced Settings**.

Expand Down Expand Up @@ -187,7 +186,7 @@ workflows:
jobs:
- dynamic/continue:
context: circleci
auto-detect: true
# auto-detect: true
```

or, exactly the same as above.
Expand Down
5 changes: 5 additions & 0 deletions src/commands/filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ parameters:
description: Whether or not to cache (i.e. you're calling these commands in your own job, not 'continue').
type: boolean
default: true
debug:
description: Enable debug logging.
type: boolean
default: false
steps:
- run:
name: Filter
Expand All @@ -83,6 +87,7 @@ steps:
SH_INCLUDE_CONFIG_CHANGES: << parameters.include-config-changes >>
SH_AUTO_DETECT: << parameters.auto-detect >>
SH_ROOT_MODULE: << parameters.root-config >>
SH_DYNAMIC_CONTINUATION_DEBUG: << parameters.debug >>
command: << include(scripts/filter.sh) >>
- when:
condition: << parameters.cache >>
Expand Down
5 changes: 5 additions & 0 deletions src/commands/reduce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ parameters:
description: Whether or not to cache (i.e. you're calling these commands in your own job, not 'continue').
type: boolean
default: true
debug:
description: Enable debug logging.
type: boolean
default: false
steps:
- when:
condition: << parameters.cache >>
Expand All @@ -43,4 +47,5 @@ steps:
SH_MODULES_FILTERED: << parameters.modules-filtered >>
SH_ROOT_CONFIG: << parameters.root-config >>
SH_CONTINUE_CONFIG: << parameters.continue-config >>
SH_DYNAMIC_CONTINUATION_DEBUG: << parameters.debug >>
command: << include(scripts/reduce.sh) >>
16 changes: 0 additions & 16 deletions src/examples/dynamic_continuation_pipeline.yml

This file was deleted.

17 changes: 17 additions & 0 deletions src/examples/example-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
description: |+
Use the "continue" job to dynamically execute workflows in directories/modules.
usage:
version: 2.1

setup: true


orbs:
dynamic: bjd2385/dynamic-continuation@3.7.0


workflows:
on-commit:
jobs:
- dynamic/continue:
context: circleci
6 changes: 6 additions & 0 deletions src/jobs/continue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ parameters:
https://github.com/mikefarah/yq/releases
type: string
default: v4.31.1
debug:
description: Enable debug logging.
type: boolean
default: false

# CircleCI continuation orb.
parameters:
Expand Down Expand Up @@ -147,13 +151,15 @@ steps:
include-config-changes: << parameters.include-config-changes >>
auto-detect: << parameters.auto-detect >>
cache: false
debug: << parameters.debug >>
- reduce:
modules-filtered: << parameters.modules-filtered >>
continue-config: << parameters.continue-config >>
root-config: << parameters.root-config >>
circle-token: << parameters.circle-token >>
project-type: << parameters.project-type >>
cache: false
debug: << parameters.debug >>
- run:
name: Validate
command: |
Expand Down
Loading

0 comments on commit 8b52c8f

Please sign in to comment.