-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
28 lines (24 loc) · 1.2 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 MAVEN_VERSION=3.5.3
- JVM=zulu JVM_MAJOR=8 JVM_MINOR=162 MAVEN_VERSION=3.5.3
- JVM=zulu JVM_MAJOR=9 JVM_MINOR=04 MAVEN_VERSION=3.5.3
- JVM=zulu JVM_MAJOR=10 MAVEN_VERSION=3.5.3
before_script:
- git clone https://github.com/docker-library/official-images.git ~/official-images
- env | sort
- if [ ${JVM_MAJOR} -gt 9 ]; then cd ${JVM}_${JVM_MAJOR}; else cd ${JVM}; fi;
- version_array=(${MAVEN_VERSION//./ })
- IMAGE_NAME="jiminhsieh/maven:${JVM}_${JVM_MAJOR}-${version_array[0]}.${version_array[1]}"
- IMAGE_FULL_NAME="jiminhsieh/maven:${JVM}_${JVM_MAJOR}u${JVM_MINOR}-${MAVEN_VERSION}"
script:
- travis_retry docker build -t ${IMAGE_FULL_NAME} --build-arg jvm_major=${JVM_MAJOR} --build-arg jvm_minor=${JVM_MINOR} --build-arg maven=${MAVEN_VERSION} .
- ~/official-images/test/run.sh ${IMAGE_FULL_NAME}
- docker run ${IMAGE_FULL_NAME} java -version && docker run ${IMAGE_FULL_NAME} mvn -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}