diff --git a/.travis.yml b/.travis.yml index ee0bf3765..8b44799bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,20 @@ language: java jdk: - oraclejdk8 +before_cache: + - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock + - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ cache: directories: - - .autoconf - - $HOME/.m2 + - $HOME/.gradle/caches/ + - $HOME/.gradle/wrapper/ script: - - mvn clean package -Pci + - ./gradlew check + - ./gradlew clean build -x test branches: only: - master + - dev notifications: webhooks: - https://fathomless-fjord-24024.herokuapp.com/notify diff --git a/Dockerfile b/Dockerfile index a482db726..6414d62ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,11 @@ FROM openjdk:8-jdk-alpine 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 TIME_ZONE=Asia/Shanghai -ENV TZ=Asia/Shanghai +ENV TZ=${TIME_ZONE} COPY ${JAR_FILE} halo.jar diff --git a/hooks/pre_build b/hooks/pre_build new file mode 100644 index 000000000..2e39a914b --- /dev/null +++ b/hooks/pre_build @@ -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" \ No newline at end of file