Merge pull request #147 from JohnNiang/dev

Fix autobuild for docker hub
pull/148/head
RYAN0UP_ 2019-05-09 09:35:37 +08:00 committed by GitHub
commit 8d76d7a975
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 5 deletions

View File

@ -1,15 +1,20 @@
language: java language: java
jdk: jdk:
- oraclejdk8 - oraclejdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache: cache:
directories: directories:
- .autoconf - $HOME/.gradle/caches/
- $HOME/.m2 - $HOME/.gradle/wrapper/
script: script:
- mvn clean package -Pci - ./gradlew check
- ./gradlew clean build -x test
branches: branches:
only: only:
- master - master
- dev
notifications: notifications:
webhooks: webhooks:
- https://fathomless-fjord-24024.herokuapp.com/notify - https://fathomless-fjord-24024.herokuapp.com/notify

View File

@ -2,10 +2,11 @@ FROM openjdk:8-jdk-alpine
VOLUME /tmp VOLUME /tmp
ARG JAR_FILE=build/libs/halo-1.0.0.bata.jar ARG JAR_FILE=build/libs/halo-1.0.0.beta.jar
ARG PORT=8090 ARG PORT=8090
ARG TIME_ZONE=Asia/Shanghai
ENV TZ=Asia/Shanghai ENV TZ=${TIME_ZONE}
COPY ${JAR_FILE} halo.jar COPY ${JAR_FILE} halo.jar

12
hooks/pre_build Normal file
View File

@ -0,0 +1,12 @@
#!/bin/bash
./gradlew clean build -x test
echo "=> Building the binary"
docker run \
-v $(pwd):/src \
-v /var/run/docker.sock:/var/run/docker.sock \
-w="/src" \
openjdk:8-jdk-alpine \
./gradlew clean build -x test
echo "=> Built the binary successfully"