0

I added some AWS keys to my .travis.yml file so that it would deploy my application over to ElasticBeanstalk, but after I committed the changes to the file and pushed to master, nothing happened.

I thought perhaps I needed to restart build. This added my AWS keys, but no installation of deployment dependencies as I had expected and no deployment to AWS.

Not sure what happened here. Did I not wait long enough for TravisCI to start the new build?

This is my .travis.yml file:

sudo: required
services:
  - docker

before_install:
  - docker build -t danale/project-name -f Dockerfile.dev .

script:
  - docker run danale/project-name npm run test -- --coverage

  deploy:
    provider: elasticbeanstalk
    region: "us-east-1"
    app: "project-name"
    env: "ProjectName-env"
    bucket_name: "elasticbeanstalk-us-east-1-123456789"
    bucket_path: "project-name"
    on:
      branch: master
    access_key_id: $AWS_ACCESS_KEY
    secret_access_key: 
      secure: "$AWS_SECRET_KEY"

I conducted a git add . && git commit -m "added travis deploy script" && git push origin master

No deployment afterwards. I don't see where I missed a step here: https://docs.travis-ci.com/user/deployment/elasticbeanstalk/

0

One of the headaches of .yml files is the indentation. So the parse error I was getting in the Request tab was saying no newline added. I was not clear whether that meant it needed a new line or was missing a new line, but by running: wc -l .travis.yml I was able to detect that it was not outputting the correct number of lines.

I tried about five different ways to format the .yml file allowing it to keep me focused towards the end of the files line number where the error was pointing towards.

I happen to look up and realized the beginning of the deploy: script was not properly aligned, so I adjusted with a shift+tab and after I got it properly aligned, TravisCI recognized my changes and properly ran the script and successfully deployed the application to Elasticbeanstalk.

  • Try adding yamllint to your git workflow, so before committing an unparsable yaml file you can validate it. I end up adding this to my git-hook scripts. – Hashfyre Feb 22 at 9:27
  • 1
    @Hashfyre, thank you for the tip. I am going to look into that today. – Daniel Feb 22 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.