Skip to content

Commit

Permalink
feat(jobs): add resource_class overrides (#152)
Browse files Browse the repository at this point in the history
- Add the ability to set resource classes for jobs, setting the default
  `resource_class` to `medium`.
- Add a new `default` executor here; replacing the one we called
  from CircleCI-Public/circleci-cli-orb
- Update cimg python executor to `cimg/python:3.10.5`
  • Loading branch information
wyardley authored Aug 25, 2022
1 parent b0813b8 commit c34bc9d
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 3 deletions.
19 changes: 19 additions & 0 deletions src/executors/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
description: >
The circleci-cli Docker image, which includes the CircleCI CLI
parameters:
tag:
type: string
default: latest
description: >
What version of the CircleCI CLI Docker image? For full list, see
https://hub.docker.com/r/circleci/circleci-cli/tags
resource_class:
description: Configure the xecutor resource class
type: enum
enum: ["small", "medium", "medium+", "large", "xlarge", "2xlarge", "2xlarge+"]
default: "medium"

resource_class: << parameters.resource_class >>
docker:
- image: circleci/circleci-cli:<< parameters.tag >>
6 changes: 6 additions & 0 deletions src/jobs/continue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ description: |
docker:
- image: cimg/base:current
resource_class: << parameters.resource_class >>

parameters:
pipeline-number:
Expand All @@ -28,6 +29,11 @@ parameters:
description: Host URL of CircleCI Web UI. If you are using self-hosted CircleCI, this value should be set.
type: string
default: https://app.circleci.com
resource_class:
description: Configure the executor resource class
type: enum
enum: ["small", "medium", "medium+", "large", "xlarge", "2xlarge", "2xlarge+"]
default: "medium"

steps:
- checkout
Expand Down
10 changes: 9 additions & 1 deletion src/jobs/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ description: |
Lint all YAML files in the project. A ".yamllint" file will be generated for you automatically by the Orb Development Kit.
docker:
- image: cimg/python:3.10.2
- image: cimg/python:3.10.5
resource_class: << parameters.resource_class >>

parameters:
resource_class:
description: Configure the executor resource class
type: enum
enum: ["small", "medium", "medium+", "large", "xlarge", "2xlarge", "2xlarge+"]
default: "medium"

steps:
- checkout
Expand Down
9 changes: 8 additions & 1 deletion src/jobs/pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ description: |
For self-hosted CircleCI servers, please ensure you set the `circleci-api-host` job parameter and CIRCLE_TOKEN environment variable.
parameters:
resource_class:
description: Configure the executor resource class
type: enum
enum: ["small", "medium", "medium+", "large", "xlarge", "2xlarge", "2xlarge+"]
default: "medium"
source-dir:
description: Path to the orb source. Path must be absolute or relative to the working directory.
type: string
Expand All @@ -16,7 +21,9 @@ parameters:
type: string
default: https://circleci.com

executor: cli/default
executor:
name: default
resource_class: << parameters.resource_class >>

steps:
- checkout
Expand Down
10 changes: 9 additions & 1 deletion src/jobs/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@ description: |
Publish a new version of your orb.
This job will produce a development version of an orb by default or will produce a new production version if the $CIRCLE_TAG environment variable is , and the "pub-type" parameter is set to "production".
executor: cli/default
executor:
name: default
resource_class: << parameters.resource_class >>

parameters:
resource_class:
description: Configure the executor resource class
type: enum
enum: ["small", "medium", "medium+", "large", "xlarge", "2xlarge", "2xlarge+"]
default: "medium"
orb-name:
type: string
description: >
Expand Down Expand Up @@ -59,6 +66,7 @@ parameters:
- dev
- production
default: "dev"

steps:
- attach_workspace:
at: <<parameters.orb-dir>>
Expand Down
6 changes: 6 additions & 0 deletions src/jobs/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ parameters:
Example: "RC001,RC002"
type: string
default: ""
resource_class:
description: Configure the executor resource class
type: enum
enum: ["small", "medium", "medium+", "large", "xlarge", "2xlarge", "2xlarge+"]
default: "medium"

docker:
- image: cimg/base:current
resource_class: << parameters.resource_class >>

steps:
- checkout
Expand Down

0 comments on commit c34bc9d

Please sign in to comment.