简体   繁体   中英

travis-ci could not parse yml file

I want to do AWS Elastic Beanstalk Deployment. But tvavis say "could not parse" This happens after adding the part of the code that begins with the word "deploy"

sudo: required
services:
    - docker
before_install:
    - docker build -t alex-sbk/docker-react -f Dockerfile.dev .

script:
    - docker run -e CI=true alex-sbk/docker-react npm run test 

    deploy:
    provider: elasticbeanstalk
    region: "us-east-2"
    app: "docker-react"
    env: "DockerReact-env"
    bucket_name: "elasticbeanstalk-us-east-2-282895571233"
    bucket_path: "docker-react"
    on:
        branch: master
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY

There are apparent issues with indentations . You code does not pass YAML format validators. I fixed it a bit, and now it passes

--- 
before_install: 
  - "docker build -t alex-sbk/docker-react -f Dockerfile.dev ."
script: 
  - "docker run -e CI=true alex-sbk/docker-react npm run test"
  - 
    deploy: 
      access_key_id: $AWS_ACCESS_KEY
      app: docker-react
      bucket_name: elasticbeanstalk-us-east-2-282895571233
      bucket_path: docker-react
      env: DockerReact-env
      provider: elasticbeanstalk
      region: us-east-2
      secret_access_key: $AWS_SECRET_KEY
      true: 
        branch: master
services: 
  - docker
sudo: required

The format should be OK now, but I can't guarantee that the deployment will successed. There could be other issue with actual data provided.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM