Eu nunca encontrei uma resposta para isso usando apenas travis para construir e enviar, eu tive que criar manualmente um arquivo zip depois que o Travis executou o grunt build e usou o awscli para carregá-lo em s3 e disparar uma implementação do EB.
.travis.yml
language: node_js
node_js:
- 0.10
before_install:
- sudo pip install awscli
- ls /usr/local/bin/
- which aws
- npm set progress=false
- npm install -g grunt-cli grunt grunt-bower -loglevel=error
script:
- echo "success"
before_deploy:
- cd ${TRAVIS_BUILD_DIR}/wp-content/themes/mytheme && npm install --loglevel=error
- cd ${TRAVIS_BUILD_DIR}/wp-content/themes/mytheme && grunt build
- cd ${TRAVIS_BUILD_DIR}
- echo $(git rev-parse --short HEAD) >> /tmp/version
- cd ${TRAVIS_BUILD_DIR} && zip -0 /tmp/travisci-$(cat /tmp/version).zip -r ./ -x "wp-content/themes/mytheme/node_modules/*" "*.git*" > /dev/null
- chmod +x scripts/deploy/production.sh
deploy:
- provider: script
skip_cleanup: true
script: scripts/deploy/production.sh
on:
branch: master
scripts / deploy / production.sh
mkdir ~/.aws
touch ~/.aws/config
chmod 600 ~/.aws/config
echo "[default]" > ~/.aws/config
echo "aws_access_key_id = $AWS_ACCESS_KEY_ID" >> ~/.aws/config
echo "aws_secret_access_key = $AWS_SECRET_ACCESS_KEY" >> ~/.aws/config
cp ~/.aws/config ~/.aws/credentials
aws s3 cp /tmp/travisci-*.zip s3://elasticbeanstalk-us-east-1-1234567890/
aws elasticbeanstalk create-application-version --region us-east-1 --application-name "app" --version-label 'cat /tmp/version' --source-bundle S3Bucket="elasticbeanstalk-us-east-1-1234567890",S3Key="travisci-'cat /tmp/version'.zip"
aws elasticbeanstalk update-environment --region us-east-1 --environment-name "app-production" --version-label 'cat /tmp/version'