Skip to content

Commit

Permalink
removing javarepl env variables and making build more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
albertlatacz committed Dec 2, 2016
1 parent d38f728 commit 3b52105
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ jdk:
- oraclejdk8
env:
global:
- JAVAREPL_BUILD_NUMBER=$TRAVIS_BUILD_NUMBER
- JAVAREPL_REPOSITORY="albertlatacz/java-repl"
- PROJECT_REPOSITORY="albertlatacz/java-repl"
- PROJECT_VERSION=$TRAVIS_BUILD_NUMBER
- secure: "bIFU+VgbcIJ5DmsXkoxTaLGI40uIyWdTFnco7FaJLoJLwLJSake4jemFv5SI\nJaSFVINBXA+Xn/qqHmFfWVr2fKsAevwRfkkIuTM1QMlN2TOMkCwOrz6mYA3f\nxjh+oKXUzNutZTHSyoCyZ72uHSJ33TlPWHU+OToS4AYxf8LrTYI="
- secure: "O0xTkW+WBNWT0a44u7XRpm0vp0q04ZFv/ovmPX6nm3fRokuiHMoRaL1l7r1K\nLF9ow3n+Ncsl64XRJNv2rjKVrxb19GtZQjxnHqi6bW2FSnoTEJsfvIjgMOwh\nrOHL9MUP61idRqN15ki0qYsmZ8t3xN9rw04fJLGZn73Oy0uRSGI="
- secure: "C5j0sZWXhfOoaVYyylyM7aJsjUSBbiIkW2GpAhODIrp/E5l297TymomFOCOTZSL1xF5V4RYt6jc7db+Qri5ryeHd0IIYMNWqcmni4rChtKp4b2F4qh+eqwre8RW5hONOcByZTQDvo+m3SCTuoTWcIM/UIhQIGovSPtYmqjQlSwI="
Expand All @@ -30,7 +30,7 @@ install:
- export PATH=$PATH:$HOME/.local/bin

script:
- gradle -Pversion=$JAVAREPL_BUILD_NUMBER clean check shadowJar bintrayUpload
- gradle clean check shadowJar bintrayUpload

deploy:
provider: releases
Expand All @@ -41,11 +41,11 @@ deploy:
skip_cleanup: true
on:
branch: master
repo: $JAVAREPL_REPOSITORY
repo: $PROJECT_REPOSITORY


after_deploy:
- sh bin/push-to-docker-hub.sh $DOCKER_HUB_USERNAME $DOCKER_HUB_PASSWORD $JAVAREPL_REPOSITORY $JAVAREPL_BUILD_NUMBER
- sh bin/push-to-docker-hub.sh

after_success:
- sh bin/set-tags.sh
Expand Down
9 changes: 2 additions & 7 deletions bin/push-to-docker-hub.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#!/usr/bin/env bash

DOCKER_HUB_USERNAME=$1
DOCKER_HUB_PASSWORD=$2
DOCKER_HUB_REPOSITORY=$3
PACKAGE_VERSION=$4

docker build -t ${DOCKER_HUB_REPOSITORY}:${PACKAGE_VERSION} -t ${DOCKER_HUB_REPOSITORY} --build-arg JAVA_REPL_VERSION=${PACKAGE_VERSION} .
docker build -t ${PROJECT_REPOSITORY}:${PROJECT_VERSION} -t ${PROJECT_REPOSITORY} --build-arg JAVA_REPL_VERSION=${PROJECT_VERSION} .
docker login -u=${DOCKER_HUB_USERNAME} -p=${DOCKER_HUB_PASSWORD};
docker push ${DOCKER_HUB_REPOSITORY}
docker push ${PROJECT_REPOSITORY}
4 changes: 1 addition & 3 deletions bin/set-tags.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env bash

BRANCH="master"

# Are we on the right branch?
if [ "$TRAVIS_BRANCH" = "$BRANCH" ]; then
if [ "$TRAVIS_BRANCH" = "master" ]; then

# Is this not a Pull Request?
if [ "$TRAVIS_PULL_REQUEST" = false ]; then
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
apply plugin: 'java'
apply plugin: 'maven-publish'

def projectVersion = System.getenv('JAVAREPL_BUILD_NUMBER') != null ? System.getenv('JAVAREPL_BUILD_NUMBER') : 'dev'
def projectVersion = System.getenv('PROJECT_VERSION') != null ? System.getenv('PROJECT_VERSION') : 'dev'

repositories {
mavenCentral()
Expand Down

0 comments on commit 3b52105

Please sign in to comment.