forked from mingchen/docker-android-build-box
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
34 lines (26 loc) · 847 Bytes
/
.travis.yml
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
language: bash
services:
- docker
env:
global:
- COMMIT=${TRAVIS_COMMIT::8}
- REPO=bohsen/android-build-box
script:
- export TAG=`if [[ $TRAVIS_PULL_REQUEST == "false" ]] && [[ $TRAVIS_BRANCH == "master" ]]; then echo "latest"; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi`
- export REPO=bohsen/android-build-box
- docker build -t $REPO:$TAG -f Dockerfile .
after_script:
- docker images
after_success:
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- if [[ $TRAVIS_PULL_REQUEST == "false" ]] && [[ $TRAVIS_BRANCH == "master" ]]; then
docker tag $REPO:$TAG $REPO:$TRAVIS_BUILD_NUMBER;
docker push $REPO:$TRAVIS_BUILD_NUMBER;
fi
- docker push $REPO:$TAG
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/