-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml.dist
38 lines (33 loc) · 1.02 KB
/
.travis.yml.dist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
sudo: required
services:
- docker
env:
global:
- REGISTRY=registry.heroku.com
- APP=audio2video
- TYPE=web
before_script:
- docker build . -t ${REGISTRY}/${APP}/${TYPE}
script:
- echo 'no tests'
# - docker run ${REGISTRY}/${APP}/${TYPE} bin/phpunit
after_success:
- if [ "${TRAVIS_PULL_REQUEST}" == "false" ] && [ "${TRAVIS_BRANCH}" == "master" ]; then
# push image
docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}" ${REGISTRY};
docker push ${REGISTRY}/${APP}/${TYPE};
# release it
IMAGE_ID=`docker inspect ${REGISTRY}/${APP}/${TYPE} --format={{.Id}}`
curl -n -X PATCH https://api.heroku.com/apps/${APP}/formation \
-d '{
"updates": [
{
"type": "'${TYPE}'",
"docker_image": "'$IMAGE_ID'"
}
]
}' \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.heroku+json; version=3.docker-releases" \
-H "Authorization: Bearer ${DOCKER_PASSWORD}"
fi