forked from binarybabel/docker-jdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
37 lines (32 loc) · 1.35 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
29
30
31
32
33
34
35
36
37
language: ruby
rvm:
- 2.2
branches:
only:
- master
install: []
script:
- mkdir -p dist
- curl -fso dist/JDK8.json https://lv.binarybabel.org/catalog-api/java/jdk8.json
after_success:
# PIN BUILDS TO LATEST JAVA VERSION
- cp -v src/*.sh dist/
- java_version () { ruby -e "require 'json'; puts JSON.parse(File.read('dist/JDK$1.json'))['version']"; }
- java_download () { ruby -e "require 'json'; puts JSON.parse(File.read('dist/JDK$1.json'))['downloads']['$2']"; }
- |
for V in "8" ; do
sed -i'' "s/jdk${V}\.svg/jdk${V}.svg?v=$(java_version ${V})/" README.md
sed "s^JAVA_DOWNLOAD=^JAVA_DOWNLOAD=$(java_download ${V} tgz)^g" src/alpine.Dockerfile > dist/${V}-alpine.Dockerfile
sed "s^JAVA_DOWNLOAD=^JAVA_DOWNLOAD=$(java_download ${V} rpm)^g" src/centos.Dockerfile > dist/${V}-centos.Dockerfile
sed "s^JAVA_DOWNLOAD=^JAVA_DOWNLOAD=$(java_download ${V} tgz)^g" src/debian.Dockerfile > dist/${V}-debian.Dockerfile
done
# CREATE GIT TAG
- export BUILD_LABEL="$(date +'%Y.%m.%d')"
- git config --global user.email "[email protected]"
- git config --global user.name "Travis CI"
- git add dist
- git commit -am ${BUILD_LABEL}
- git tag ${BUILD_LABEL} -am ${BUILD_LABEL}
- git push --quiet --force https://[email protected]/binarybabel/docker-jdk ${BUILD_LABEL} > /dev/null 2>&1
notifications:
email: false