Skip to content

Commit

Permalink
enable pushing out latest docker image to docker hub after CI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
AO-StreetArt committed Sep 25, 2018
1 parent 64b5f54 commit c01291f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@ script:
- sleep 45
- curl http://localhost:5635/health
- cd $TRAVIS_BUILD_DIR/src/test/resources && newman run AssetAPI.postman_collection.json -e AeselTest.postman_environment.json
after_success:
- docker build -t aostreetart/kelona:latest
- scripts/linux/push_docker.sh $DOCKER_MAIL $DOCKER_UN $DOCKER_PW $TRAVIS_BRANCH
after_failure:
- cd $TRAVIS_BUILD_DIR && cat logs/avc.log | grep ERROR
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
################################################################

# Dockerfile to build Kelona Container Images

################################################################


FROM openjdk:8-jdk-alpine
MAINTAINER Alex Barry
VOLUME /tmp
ADD build/libs/kelona-0.0.1.jar app.jar
ENV JAVA_OPTS=""
ENTRYPOINT exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ apply plugin: "io.spring.dependency-management"
apply plugin: 'checkstyle'

group = 'com.ao'
version = '0.0.1-SNAPSHOT'
version = '0.0.1'
sourceCompatibility = 1.8

checkstyle {
toolVersion = "8.2"
}

jar {
baseName = 'avc'
baseName = 'kelona'
version = '0.0.1'
}

Expand Down
11 changes: 11 additions & 0 deletions scripts/linux/push_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

DOCKER_EMAIL=$1
DOCKER_USER=$2
DOCKER_PASS=$3
BRANCH_NAME=$4

if [ "$BRANCH_NAME" == "v2" ]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker push aostreetart/kelona:latest
fi

0 comments on commit c01291f

Please sign in to comment.