> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# pantheon-systems/pantheon

Use CircleCI to push code to Pantheon Dev and Multidev Environments and run some tests.


## Jobs

### static_tests

| Parameter | Type | Default | Description |
|---|---|---|---|
| `resource_class` | string | medium | Override the resource class used by the job |
| `checkout` | boolean | true | Should this job checkout your repository as the first step? Set to false if you are calling 'checkout' in 'pre-steps' |
| `set_env_vars` | boolean | true | Should this job run a script to set env vars like TERMINUS_ENV? Set to false if you set variables in 'pre-steps' |
| `static_tests_script` | string | ./.ci/test/static/run | Script to run static tests |

### push

| Parameter | Type | Default | Description |
|---|---|---|---|
| `resource_class` | string | medium | Override the resource class used by the job |
| `directory_to_push` | string | . | 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. |
| `checkout` | boolean | true | Should this job checkout your repository as the first step? Set to false if you are calling 'checkout' in 'pre-steps' |
| `set_env_vars` | boolean | true | Should this job run a script to set env vars like TERMINUS_ENV? Set to false if you set variables in 'pre-steps' |
| `env_create_max_time` | string | 10m | 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. |
| `terminus_clone_env` | string | dev | The source environment from which the database and uploaded files are cloned. |
| `clone_content` | boolean | true | 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. |

### visual_regression

| Parameter | Type | Default | Description |
|---|---|---|---|
| `resource_class` | string | medium | Override the resource class used by the job |
| `checkout` | boolean | true | Should this job checkout your repository as the first step? Set to false if you are calling 'checkout' in 'pre-steps' |
| `set_env_vars` | boolean | true | Should this job run a script to set env vars like TERMINUS_ENV? Set to false if you set variables in 'pre-steps' |
| `vrt_run_script` | string | ./.ci/test/visual-regression/run | Script to run vrt |

### behat_tests

| Parameter | Type | Default | Description |
|---|---|---|---|
| `resource_class` | string | medium | Override the resource class used by the job |
| `checkout` | boolean | true | Should this job checkout your repository as the first step? Set to false if you are calling 'checkout' in 'pre-steps' |
| `set_env_vars` | boolean | true | Should this job run a script to set env vars like TERMINUS_ENV? Set to false if you set variables in 'pre-steps' |
| `behat_initialize_script` | string | ./.ci/test/behat/initialize | Script to initialize behat tests |
| `behat_run_script` | string | ./.ci/test/behat/run | Script to run behat tests |
| `behat_clean_script` | string | ./.ci/test/behat/cleanup | Script to clean behat tests |

### composer_lock_updater

| Parameter | Type | Default | Description |
|---|---|---|---|
| `resource_class` | string | medium | Override the resource class used by the job |
| `checkout` | boolean | true | Should this job checkout your repository as the first step? Set to false if you are calling 'checkout' in 'pre-steps' |
| `set_env_vars` | boolean | true | Should this job run a script to set env vars like TERMINUS_ENV? Set to false if you set variables in 'pre-steps' |

## Executors

### default

Default executor to use when running this orb's jobs

| Parameter | Type | Default | Description |
|---|---|---|---|
| `resource_class` | string | medium |  |

## Examples

### just_push

The simplest example of using this Orb.


```yaml
version: 2.1
workflows:
  version: 2
  just_push:
    jobs:
      - pantheon/push
orbs:
  pantheon: pantheon-systems/pantheon@0.2.0
```

### full_example

Compile Sass in a separate job before pushing to Pantheon. Also run tests. See this example in use at https://github.com/kporras07/circleci-orb-demo


```yaml
version: 2.1
workflows:
  version: 2
  build_deploy_and_test:
    jobs:
      - pantheon/static_tests
      - npmbuild_and_persist
      - pantheon/push:
          requires:
            - npmbuild_and_persist
            - pantheon/static_tests
          checkout: false
          pre-steps:
            - checkout
            - attach_workspace:
                at: .
            - run: rm web/themes/custom/default/.gitignore
            - run: ./.ci/build/php
      - pantheon/visual_regression:
          requires:
            - pantheon/push
          filters:
            branches:
              ignore:
                - master
      - pantheon/behat_tests:
          requires:
            - pantheon/visual_regression
  scheduled_update_check:
    triggers:
      - schedule:
          cron: 10 21 * * *
          filters:
            branches:
              only:
                - master
    jobs:
      - pantheon/composer_lock_updater
orbs:
  pantheon: pantheon-systems/pantheon@0.2.0
jobs:
  npmbuild_and_persist:
    docker:
      - image: node:12.16.1
    steps:
      - checkout
      - run:
          name: install npm dependencies in a custom Drupal child theme
          command: cd web/themes/custom/default && yarn install
      - run:
          name: Compile Sass
          command: >-
            cd web/themes/custom/default && yarn production && rm -rf
            web/themes/custom/default/node_modules
      - persist_to_workspace:
          root: .
          paths:
            - web/themes/custom/default
```