-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
35 lines (35 loc) · 1.21 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
language: java
dist: bionic
jdk:
- "openjdk11"
node_js:
- "12.13.0"
cache:
directories:
- "/home/travis/build/nkonev/mongodumper/frontend/node_modules"
- "/home/travis/.gradle"
before_install:
- "nvm install 12.13.0"
- "nvm use 12.13.0"
install:
- "node --version"
- (cd frontend; npm install;)
- echo 'org.gradle.daemon=false' > ~/.gradle/gradle.properties
script:
- "pwd"
- (cd frontend; npm run build;)
- DATE_VERSION=`date +%Y%m%d.%H.%M`;
- ./gradlew clean build --info --stacktrace -DdatedVersion=$DATE_VERSION
- ls -lah
- rm -rf /home/travis/build/nkonev/mongodumper/frontend/node_modules/.cache
- BUILDDIR=./docker-build;
JAR=./build/libs/mongodumper-*.jar;
JAR_FINAL=mongodumper.jar;
IMAGE_LATEST=nkonev/mongodumper:latest;
IMAGE_VERSIONED=nkonev/mongodumper:$DATE_VERSION;
if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_TEST_RESULT" == "0" && "$TRAVIS_EVENT_TYPE" != "cron" ]]; then (
mkdir $BUILDDIR && cp $JAR $BUILDDIR/$JAR_FINAL && cp ./docker/* $BUILDDIR &&
docker build -t $IMAGE_LATEST -t $IMAGE_VERSIONED $BUILDDIR &&
docker login -u="$DOCKER_LOGIN" -p="$DOCKER_PASSWORD" &&
docker push $IMAGE_LATEST && docker push $IMAGE_VERSIONED
) fi