From b518c7d53d9fc593cbb75e3797ded01904aa94d6 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Mon, 8 Jun 2020 14:48:26 -0500 Subject: [PATCH] adding clone_content option (#44) * adding clone_content option * adding clone_content option * adding param to readme * flag fix * update comparison --- README.md | 1 + src/@orb.yml | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fb3fae4..f33abfe 100644 --- a/README.md +++ b/README.md @@ -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. | diff --git a/src/@orb.yml b/src/@orb.yml index 95d25ef..36dfe43 100644 --- a/src/@orb.yml +++ b/src/@orb.yml @@ -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 @@ -140,9 +144,14 @@ jobs: command: | export COMMIT_MSG=$(git log -1 --pretty=%B) cd $PANTHEON_REPO_DIR + if [ "true" = "<>" ] ; 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: |