Skip to content

Commit

Permalink
- fix logback configuration
Browse files Browse the repository at this point in the history
- add semantic versioning - provide PATCH number to version
- remove jar version to reuse standard version
- make both Procfile and run.sh to run jar with * - version agnostic
- add app.json data
  • Loading branch information
spolnik committed Dec 31, 2016
1 parent c4c4672 commit ec27a36
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 15 deletions.
11 changes: 8 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
before_deploy:
- ./gradlew releaseZip
deploy:
provider: heroku
provider: releases
api_key:
secure: sOaVuEhb9oQPKcodgASSiw6eqKJEnl7RLnRL/kLORJ2AHx6HxJy5Bvl0jPejMicJcb7Qo33EiGOCL9zn1nqFz6thQstQvrEPgRWV/6F8rrUzlh4L6AbXQXGoFhHE4V4rTKFTnIZbQRCID8yf6apvg8S+X9jHFTAHesaHeB9Gg+yQvY8kkyL9Ny7pYoaHEFvqfWKyW4ub34L6veteeYgPUD2BA5yLbILUKvSRLyv59ao45ZkkzYLxoP6TcG/Oz+9I1+uzl68O9qkRPGJvXPGhBZLI4xmD/doYG95H0W/3IFATKlqAyCFkhQunTq81kMh1qlMRqu+nrAd8LBilSD1NOGOdRsU6cFXZivYe7Zn3XBoaIoYCDE0EW/4Fu2Wl1uyhUtTfA6GiuzzcrAqFf5S2rqO/n/iB2XEnQDu03ESZumSbRGbvDlSHJcETQPTHc4O/V6552QEPtwEBbjEo9BesLV4fhpKubj8Jy1qY5bbIhFS3QpnU6kwPUV52x8uP9TshXsVA3pxPsOdm/f0naZ1xgVGF2nTw3IoI46T8py6VtTYWSDcw6SHc5z1/KIQ8juLymwl7pHqA+jRRkPDmLcUsCAk3rpg9xG9wGhtg0QnSbh9lWJ/+ggd8j4BHlogxQjy83uWVlOGeSEQsgvwmjjB+lzEs6m3HRx/7G6BwTwQUlzo=
app: jalgoarena-auth
secure: S0a3BsUrmCzssu+aPqKpkzqGvfCQDiSHevlYiW+jjLH/lOihYR6gPTEfiON4Xf0P/SMHuuAw2vCuC5Wc43wCME+rUeZ40nEhqTacFi4tulvEXATs4gZHX39wipih4TOqyG4EQSASILevAX2EZWTnVt0F9CuIQ8tJW0dNaw2LfBFuW/+KnlZQcyTrb72PLJng/FTHvx+cZl66EIr3QpZ7eWttUhDA7mvRhabOEl7UQwPqFErFmYvBRq6OydvbSrTne0ITFyYwNt0kz9mQtArhlEP8RbYmYX/Vh+1yW5dA7tU4ta5765Z3KGc9LeoEv60OKntmUbkqISOyb/TSqBvRzYWzLBDunBRA8ejbz0Xtoa8VnzhY/oU5fWaIINZ6Wiuq4aryfNgHPX1xIDIQehNmSe7CZxn5pd1jm/rHN3dE3C3iRdorOvdqnw+GSmvp30KqXXcnQlRHfZDihrI6sZ3ff92VlLsnVxjwXvtip2jKjeWupq3Uazz4s/RkyflvqIpvpoylwCxq1YX0F5NdUThyR0BHQvULjpwlnJZi6S/GynF+uEA6h+Wur2oUKDDjMEsjMxi3poBDuV9pTaXChrCC0d36/IlqDhbbUOrFXttq1fRApPN1lGQ+7OJ0gLa38tL5Vzm3PGhv58ldyBwdtIap4/d4wzgd84ooBY9LO7RMc0g=
file_glob: true
file: "./build/libs/JAlgoArena-Auth-*.zip"
skip_cleanup: true
on:
repo: spolnik/JAlgoArena-Auth
tags: true
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: java $JAVA_OPTS -jar build/libs/jalgoarena-auth-1.0.jar --spring.profiles.active=heroku
web: java -jar build/libs/jalgoarena-auth-*.jar --spring.profiles.active=heroku
6 changes: 6 additions & 0 deletions api.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "JAlgoArena Auth Service",
"description": "JAlgoArena AuthService",
"website": "https://github.com/spolnik/jalgoarena-auth",
"success_url": "/health"
}
16 changes: 14 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.0.5-2'
ext.kotlin_version = '1.0.6'
ext.spring_version = '1.4.0.RELEASE'

repositories {
Expand Down Expand Up @@ -30,7 +30,6 @@ repositories {

jar {
baseName = 'jalgoarena-auth'
version = '1.0'
}

dependencies {
Expand Down Expand Up @@ -77,3 +76,16 @@ dependencyManagement {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Camden.SR3"
}
}

task releaseZip(type: Zip, dependsOn: 'bootRepackage') {
from('build/libs/') {
include('*.jar')
}
from 'run.sh'
from('UserDetailsStore') {
into('UserDetailsStore')
exclude('*.lck')
}
archiveName "JAlgoArena-Auth-${version}.zip"
destinationDir(file('build/libs'))
}
15 changes: 6 additions & 9 deletions gradle/versioning.gradle
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
//noinspection GroovyAssignabilityCheck
version = new ProjectVersion(
'1', '0', System.env.TRAVIS_BUILD_NUMBER
'1', '0', '2', System.env.TRAVIS_BUILD_NUMBER
)

println "Version number: " + version

/**
* Define the version (depends on branch and build number)
*/
class ProjectVersion {
String major
String minor
String patch
String build

ProjectVersion(String major, String minor, String build) {
ProjectVersion(String major, String minor, String patch, String build) {
this.major = major
this.minor = minor
this.patch = patch
this.build = build
}

@Override
String toString() {
String fullVersion = "$major.$minor"
String fullVersion = "$major.$minor.$patch"

if (build) {
fullVersion += ".$build"
} else {
fullVersion += "-SNAPSHOT"
}

fullVersion
}
}
}
3 changes: 3 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
EUREKA_URL=http://localhost:5000/eureka/
java -Dserver.port=9999 -jar jalgoarena-auth-*.jar
1 change: 1 addition & 0 deletions src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<property name="LOG_FILE" value="./logs/spring-boot.log}"/>
<include resource="org/springframework/boot/logging/logback/file-appender.xml" />
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />
<root level="INFO">
Expand Down

0 comments on commit ec27a36

Please sign in to comment.