Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. sudo: required #is required to use docker service in travis
  2.  
  3. language: php #can be any language, just php for example
  4.  
  5. services:
  6. - docker # required, but travis uses older version of docker :(
  7.  
  8. install:
  9. - echo "install nothing!" # put your normal pre-testing installs here
  10.  
  11. script:
  12. - echo "no tests!" # put your normal testing scripts here
  13.  
  14. after_success:
  15. - docker --version # document the version travis is using
  16. - pip install --user awscli # install aws cli w/o sudo
  17. - export PATH=$PATH:$HOME/.local/bin # put aws in the path
  18. - eval $(aws ecr get-login --region us-east-1) #needs AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY envvars
  19. - docker build -t my_example_app .
  20. - docker tag my_example_app:latest [your_ecr_account].dkr.ecr.us-east-1.amazonaws.com/my_example_app:latest
  21. - docker push [your_ecr_account].dkr.ecr.us-east-1.amazonaws.com/my_example_app:latest
  22.  
  23. # sadly, travis doesn't cache docker builds yet, so each build will take a while
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement