Skip to content

Commit

Permalink
Merge pull request #670 from Financial-Times/next-circleci-skip-revie…
Browse files Browse the repository at this point in the history
…w-jobs

Don't run review jobs on tagged releases on next
  • Loading branch information
ivomurrell authored Sep 10, 2024
2 parents 9367499 + f373212 commit da05eaf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions lib/schemas/src/hooks/circleci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const CircleCiWorkflowJob = z.object({
name: z.string(),
requires: z.array(z.string()),
splitIntoMatrix: z.boolean().optional(),
runOnRelease: z.boolean().default(true),
custom: z.unknown().optional()
})
export type CircleCiWorkflowJob = z.infer<typeof CircleCiWorkflowJob>
Expand Down
6 changes: 6 additions & 0 deletions plugins/circleci-deploy/.toolkitrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ options:
- 'setup'
- 'waiting-for-approval'
splitIntoMatrix: false
runOnRelease: false
custom:
filters:
branches:
Expand All @@ -34,6 +35,7 @@ options:
requires:
- 'setup'
splitIntoMatrix: false
runOnRelease: false
custom:
filters:
branches:
Expand All @@ -42,6 +44,7 @@ options:
requires:
- 'deploy-review'
splitIntoMatrix: false
runOnRelease: false
custom:
!toolkit/if-defined '@dotcom-tool-kit/circleci.cypressImage':
executor: cypress
Expand All @@ -50,6 +53,7 @@ options:
system-code: !toolkit/option '@dotcom-tool-kit/serverless.systemCode'
- name: 'e2e-test-staging'
splitIntoMatrix: false
runOnRelease: false
requires:
- 'deploy-staging'
custom:
Expand All @@ -60,6 +64,7 @@ options:
- 'test'
- 'e2e-test-staging'
splitIntoMatrix: false
runOnRelease: false
custom:
filters:
branches:
Expand All @@ -74,6 +79,7 @@ options:
- 'setup'
- 'waiting-for-approval'
splitIntoMatrix: false
runOnRelease: false
custom:
filters:
branches:
Expand Down
14 changes: 7 additions & 7 deletions plugins/circleci/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ Options provided in your repository's `.toolkitrc.yml` for this hook are merged
Unless they conflict, your options are appended to options from plugins, allowing you to define custom CircleCI jobs and workflows in your repository that work alongside those from plugins.
#### Hook options

| Property | Description | Type |
| :------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `executors` | an array of additional CircleCI executors to output in the generated config. | _Array of objects:_<br /><ul><li>`name`: `string`</li><li>`image`: `string`</li></ul> |
| `jobs` | an array of additional CircleCI jobs to output in the generated config. these are used for running Tool Kit commands. for running arbitrary shell commands, use `custom`. | _Array of objects:_<br /><ul><li>`name`: `string`</li><li>`command`: `string`</li></ul> |
| `workflows` | an array of additional CircleCI workflows to output in the generated config. these reference jobs defined in the `jobs` option. | _Array of objects:_<br /><ul><li>`name`: `string`</li><li>`jobs`: _Array of objects:_<br /><ul><li>`name`: `string`</li><li>`requires`: `Array<string>`</li><li>`splitIntoMatrix`: `boolean`</li><li>`custom`: `unknown` (_nullable_)</li></ul></li><li>`runOnRelease`: `boolean`</li><li>`custom`: `unknown` (_nullable_)</li></ul> |
| `custom` | arbitrary additional CircleCI configuration that will be merged into the Tool Kit-generated config. | _Object with dynamic keys of type_ `string` _and values of type_ `unknown` (_optional & nullable_) |
| `disableBaseConfig` | set to `true` to omit the Tool Kit CircleCI boilerplate. should be used along with `custom` to provide your own boilerplate. | `boolean` |
| Property | Description | Type |
| :------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `executors` | an array of additional CircleCI executors to output in the generated config. | _Array of objects:_<br /><ul><li>`name`: `string`</li><li>`image`: `string`</li></ul> |
| `jobs` | an array of additional CircleCI jobs to output in the generated config. these are used for running Tool Kit commands. for running arbitrary shell commands, use `custom`. | _Array of objects:_<br /><ul><li>`name`: `string`</li><li>`command`: `string`</li></ul> |
| `workflows` | an array of additional CircleCI workflows to output in the generated config. these reference jobs defined in the `jobs` option. | _Array of objects:_<br /><ul><li>`name`: `string`</li><li>`jobs`: _Array of objects:_<br /><ul><li>`name`: `string`</li><li>`requires`: `Array<string>`</li><li>`splitIntoMatrix`: `boolean`</li><li>`runOnRelease`: `boolean`</li><li>`custom`: `unknown` (_nullable_)</li></ul></li><li>`runOnRelease`: `boolean`</li><li>`custom`: `unknown` (_nullable_)</li></ul> |
| `custom` | arbitrary additional CircleCI configuration that will be merged into the Tool Kit-generated config. | _Object with dynamic keys of type_ `string` _and values of type_ `unknown` (_optional & nullable_) |
| `disableBaseConfig` | set to `true` to omit the Tool Kit CircleCI boilerplate. should be used along with `custom` to provide your own boilerplate. | `boolean` |

_All properties are optional._

Expand Down
2 changes: 1 addition & 1 deletion plugins/circleci/src/circleci-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ const generateJobs = (workflow: CircleCiWorkflow): Job[] => {
return `${requiredOrb}-${splitIntoMatrix ? '<< matrix.executor >>' : 'node'}`
})
},
workflow.runOnRelease ? tagFilter : {},
workflow.runOnRelease && job.runOnRelease ? tagFilter : {},
job.custom
)
}
Expand Down

0 comments on commit da05eaf

Please sign in to comment.