Skip to content

Commit

Permalink
Put commands on one line (#884)
Browse files Browse the repository at this point in the history
Multi-lines aren't supported this way in YAML. See https://yaml-multiline.info/.

Furthermore, the following **isn't supported** in our YAML DSL:

```
deploy:
  provider: script
  script:
    - command_1
    - command_2
```

Commands must be **on one line**:

```
deploy:
  provider: script
  script: command_1 && command_2
```

Otherwise, the best suggestion would be to put your commands **in an external script**:

```
deploy:
  provider: script
  script: ./external-script.sh
```
  • Loading branch information
cotsog authored and Kai Hendry committed Oct 3, 2019
1 parent 21951e3 commit ae4f1d8
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,15 @@ matrix:
deploy:
provider: script
skip_cleanup: true
script:
- AWS_ACCESS_KEY_ID=$AWS_915001051872_ID
AWS_SECRET_ACCESS_KEY=$AWS_915001051872_SECRET
./deploy.sh -d
script: AWS_ACCESS_KEY_ID=$AWS_915001051872_ID AWS_SECRET_ACCESS_KEY=$AWS_915001051872_SECRET ./deploy.sh -d
on:
tags: true
- env: DEPLOY=prod
if: tag IS present
deploy:
provider: script
skip_cleanup: true
script:
- AWS_ACCESS_KEY_ID=$AWS_192458993663_ID
AWS_SECRET_ACCESS_KEY=$AWS_192458993663_SECRET
./deploy.sh -p
- AWS_ACCESS_KEY_ID=$AWS_192458993663_ID AWS_SECRET_ACCESS_KEY=$AWS_192458993663_SECRET aws cloudfront create-invalidation
--distribution-id E173XT6X8V4A18 --paths '/*'
script: AWS_ACCESS_KEY_ID=$AWS_192458993663_ID AWS_SECRET_ACCESS_KEY=$AWS_192458993663_SECRET ./deploy.sh -p && AWS_ACCESS_KEY_ID=$AWS_192458993663_ID AWS_SECRET_ACCESS_KEY=$AWS_192458993663_SECRET aws cloudfront create-invalidation --distribution-id E173XT6X8V4A18 --paths '/*'
on:
tags: true

Expand Down

0 comments on commit ae4f1d8

Please sign in to comment.