pantheon-systems / circleci-orb

Use CircleCI to push code to Pantheon Dev and Multidev Environments
10 stars 18 forks source link

Add option for whether to switch to SFTP mode #28

Open stevector opened 5 years ago

stevector commented 5 years ago

updated issued description:

Switching to SFTP mode after pushing code adds time to the build process and may not be wanted. This would be best addressed by a change in the underlying Terminus Build Tools Plugin: https://github.com/pantheon-systems/terminus-build-tools-plugin/issues/351

Farnoosh63 commented 4 years ago

The link above does not exist or is private. I added terminus connection:set "$TERMINUS_SITE.$TERMINUS_ENV" git to post steps. Watching this issue for any updates on this request..

maskedjellybean commented 4 years ago

Hi @Farnoosh63 , would you mind giving me an example of adding that line to post steps? Thanks!

maskedjellybean commented 4 years ago

Here's what I have in .circleci/config.yml, but CircleCI sees the syntax as incorrect and the build fails:

version: 2.1
workflows:
  version: 2
  pantheon_push:
    jobs:
      - pantheon/push:
        post-steps:
          - run: terminus connection:set "$TERMINUS_SITE.$TERMINUS_ENV" git

orbs:
  pantheon: pantheon-systems/pantheon@0.2.0

The build fails with this error:

# ERROR IN CONFIG FILE:
# [#/workflows/pantheon_push] only 1 subschema matches out of 2
# 1. [#/workflows/pantheon_push/jobs/0] 0 subschemas matched instead of one
# |   1. [#/workflows/pantheon_push/jobs/0] expected type: String, found: Mapping
# |   |   SCHEMA:
# |   |     type: string
# |   |   INPUT:
# |   |     push: null
# |   |     post-steps:
# |   |     - run: terminus connection:set \"$TERMINUS_SITE.$TERMINUS_ENV\" git
# |   2. [#/workflows/pantheon_push/jobs/0/post-steps] expected type: Mapping, found: Sequence
# |   |   SCHEMA:
# |   |     type: object
# |   |   INPUT:
# |   |     - run: terminus connection:set \"$TERMINUS_SITE.$TERMINUS_ENV\" git
stevector commented 4 years ago

Hi @maskedjellybean, I think you need to indent post-steps

maskedjellybean commented 4 years ago

Thanks @stevector , that was it! My config.yml now looks like this:

version: 2.1
workflows:
  version: 2
  pantheon_push:
    jobs:
      - pantheon/push:
          post-steps:
            - run:
                name: Reset Development Mode
                command: terminus connection:set ${TERMINUS_SITE}.${TERMINUS_ENV} git

orbs:
  pantheon: pantheon-systems/pantheon@0.2.0
Farnoosh63 commented 3 years ago

Mine is the same as @maskedjellybean => terminus connection:set "$TERMINUS_SITE.$TERMINUS_ENV" git