-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
28 lines (23 loc) · 1.09 KB
/
.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
language: bash
services: docker
env:
- JVM=openj9 JVM_MAJOR=8 JVM_MINOR=162 GRADLE_VERSION=4.7
- JVM=zulu JVM_MAJOR=8 JVM_MINOR=162 GRADLE_VERSION=4.7
- JVM=zulu JVM_MAJOR=9 JVM_MINOR=04 GRADLE_VERSION=4.7
before_script:
- git clone https://github.com/docker-library/official-images.git ~/official-images
- env | sort
- cd ${JVM}
- version_array=(${GRADLE_VERSION//./ })
- IMAGE_NAME="jiminhsieh/gradle:${JVM}_${JVM_MAJOR}-${version_array[0]}.${version_array[1]}.x"
- IMAGE_FULL_NAME="jiminhsieh/gradle:${JVM}_${JVM_MAJOR}u${JVM_MINOR}-${GRADLE_VERSION}"
script:
- travis_retry docker build -t ${IMAGE_FULL_NAME} --build-arg jvm_major=${JVM_MAJOR} --build-arg jvm_minor=${JVM_MINOR} --build-arg gradle=${GRADLE_VERSION} .
- ~/official-images/test/run.sh ${IMAGE_FULL_NAME}
- docker run ${IMAGE_FULL_NAME} java -version && docker run ${IMAGE_FULL_NAME} gradle -v
after_success:
- docker tag ${IMAGE_FULL_NAME} ${IMAGE_NAME}
- docker images
- docker login -u ${DOCKER_HUB_USERNAME} -p ${DOCKER_HUB_PASSWORD}
- docker push ${IMAGE_NAME}
- docker push ${IMAGE_FULL_NAME}