Failed Travis CI Deploy to ElasticBeanstalk

98 Views Asked by At

I am trying to deploy an app AWS Beanstalk using Travis. Each time I used I get an error message saying failed to deploy and access_key_id.

Below is my travis.yml file for the build:

sudo: required
language: generic

services:
  - docker

before_install:
  - docker build -t muhammadhussain/docker-react -f dockerfile.dev .

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

deploy:
  provider: elasticbeanstalk
  region: "us-east-1"
  app:  "docker-react"
  env:  "Dockerreact-env"
  bucket_name:  "elasticbeanstalk-us-east-1-976709496734"
  bucket_path:  "docker-react"
  on:
    branch: master
    access_key_id:  "$AWS_ACCESS_KEY"
    secrect_access_key: "$AWS_SECRET_KEY"`

Below is the following output from Travis CI :

Installing deploy dependencies
Preparing deploy 
No stash entries found. 
missing access_key_id 
failed to deploy
1

There are 1 best solutions below

0
Rita Bradley On

It looks like there's some incorrect tabbing and spelling in your YAML file

replace this block

on:
  branch: master
  access_key_id:  "$AWS_ACCESS_KEY"
  secrect_access_key: "$AWS_SECRET_KEY"

with this

on:
  branch: master
access_key_id:  "$AWS_ACCESS_KEY"
secret_access_key: "$AWS_SECRET_KEY"