Skip to content

Instantly share code, notes, and snippets.

@BretFisher
Created February 15, 2016 21:26
Show Gist options
  • Select an option

  • Save BretFisher/14cd228f0d7e40dae085 to your computer and use it in GitHub Desktop.

Select an option

Save BretFisher/14cd228f0d7e40dae085 to your computer and use it in GitHub Desktop.

Revisions

  1. BretFisher created this gist Feb 15, 2016.
    23 changes: 23 additions & 0 deletions .travis.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    sudo: required #is required to use docker service in travis

    language: php #can be any language, just php for example

    services:
    - docker # required, but travis uses older version of docker :(

    install:
    - echo "install nothing!" # put your normal pre-testing installs here

    script:
    - echo "no tests!" # put your normal testing scripts here

    after_success:
    - docker --version # document the version travis is using
    - pip install --user awscli # install aws cli w/o sudo
    - export PATH=$PATH:$HOME/.local/bin # put aws in the path
    - eval $(aws ecr get-login --region us-east-1) #needs AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY envvars
    - docker build -t my_example_app .
    - docker tag my_example_app:latest [your_ecr_account].dkr.ecr.us-east-1.amazonaws.com/my_example_app:latest
    - docker push [your_ecr_account].dkr.ecr.us-east-1.amazonaws.com/my_example_app:latest

    # sadly, travis doesn't cache docker builds yet, so each build will take a while