Skip to content

Commit

Permalink
Executor and parameters for resource class (#42)
Browse files Browse the repository at this point in the history
* feat: adding executor and parameters for resource class

* fix: changing to camel case

* typo fix

* adding resource_class to readme

* better help text

Co-authored-by: Steve Persch <[email protected]>
Co-authored-by: Steve Persch <[email protected]>
  • Loading branch information
3 people authored Jun 4, 2020
1 parent 1d4a2b5 commit 12bb51a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ Jobs from CircleCI Orbs can take parameters (variables) that alter the behavior
|----------------------------|---------|---------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `checkout` | boolean | `true` | no | Determines whether a git checkout will be the first command called by the job. Set to false if you have already called "checkout" in the `pre-steps` section. |
| `env_create_max_time` | string | `"10m"` | no | The maximum amount of time to wait for Pantheon environment creation (terminus -n build:env:create). This parameter maps to CircleCI's native `no_output_timeout` option." |
| `resource_class` | string | `"medium"` | no | The [size of the container](https://circleci.com/product/features/resource-classes/) can be increased for memory-intensive build steps or decreased to reduce billing impact. |
| `terminus_clone_env` | string | `"live"` | no | The source environment from which the database and uploaded files are cloned. |
| `directory_to_push` | string | `"."` | no | The directory within the repository to push to Pantheon. Use this setting if you have a more complex repo structure that puts your Pantheon root in a deeper directory. For instance, if you are using a monorepo to manage a backend CMS on Pantheon and a decoupled frontend deployed elsewhere, set this param to the name of the directory that holds your `pantheon.yml` file. |
| `set_env_vars` | boolean | `true` | no | Should this job run a script to set env vars like TERMINUS_ENV? Set to false if you set variables in 'pre-steps' |
Expand Down
20 changes: 18 additions & 2 deletions src/@orb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ description: |
display:
source_url: https://github.com/pantheon-systems/circleci-orb
home_url: https://pantheon.io/
executors:
default:
description: "Default executor to use when running this orb's jobs"
parameters:
resource_class:
type: string
default: "medium"
docker:
- image: quay.io/pantheon-public/build-tools-ci:6.x
resource_class: <<parameters.resource_class>>
jobs:
push:
docker:
- image: quay.io/pantheon-public/build-tools-ci:6.x
working_directory: ~/sitedir
environment:
TZ: "/usr/share/zoneinfo/America/Los_Angeles"
Expand All @@ -16,6 +24,10 @@ jobs:
TERM: dumb
PANTHEON_REPO_DIR: "/tmp/pantheon_repo"
parameters:
resource_class:
description: "Override the resource class used by the job"
default: "medium"
type: string
directory_to_push:
description: "The directory within the repository to push to Pantheon. Defaults to the git root: '.' Use this setting if you have a more complex repo structure that puts your Pantheon root in a deeper directory. For instance, if you are using a monorepo to manage a backend CMS on Pantheon and a decoupled frontend deployed elsewhere, set this param to the name of the directory that holds your `pantheon.yml` file."
default: "."
Expand All @@ -37,6 +49,10 @@ jobs:
default: "live"
type: string

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

steps:
- when:
condition: <<parameters.checkout>>
Expand Down

0 comments on commit 12bb51a

Please sign in to comment.