Skip to content

Commit

Permalink
adding clone_content option (#44)
Browse files Browse the repository at this point in the history
* adding clone_content option

* adding clone_content option

* adding param to readme

* flag fix

* update comparison
  • Loading branch information
stevector authored Jun 8, 2020
1 parent 12bb51a commit b518c7d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ Jobs from CircleCI Orbs can take parameters (variables) that alter the behavior
| parameter name | type | default value | required | description |
|----------------------------|---------|---------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `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. |
| `clone_content` | boolean | `true` | no | Determines whether or not every build will re-clone content from the environment set in terminus_clone_env. Set to false if cloning the database and files means builds are taking too long. |
| `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. |
Expand Down
11 changes: 10 additions & 1 deletion src/@orb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ jobs:
description: "The source environment from which the database and uploaded files are cloned."
default: "live"
type: string
clone_content:
description: "Determines whether or not every build will re-clone content from the environment set in terminus_clone_env. Set to false if cloning the database and files means builds are taking too long."
default: true
type: boolean

executor:
name: default
Expand Down Expand Up @@ -140,9 +144,14 @@ jobs:
command: |
export COMMIT_MSG=$(git log -1 --pretty=%B)
cd $PANTHEON_REPO_DIR
if [ "true" = "<<parameters.clone_content>>" ] ; then
export CLONE_CONTENT="--clone-content"
else
export CLONE_CONTENT=""
fi
# This command will commit any changed files and push to Pantheon.
# New multidevs will be created as necessary.
terminus -n build:env:create "$TERMINUS_SITE.<< parameters.terminus_clone_env >>" "$TERMINUS_ENV" --yes --clone-content --message="CI: $COMMIT_MSG"
terminus -n build:env:create "$TERMINUS_SITE.<< parameters.terminus_clone_env >>" "$TERMINUS_ENV" --yes $CLONE_CONTENT --message="CI: $COMMIT_MSG"
- run:
name: Delete Multidev environments made for now-closed pull requests
command: |
Expand Down

0 comments on commit b518c7d

Please sign in to comment.