Skip to content

Instantly share code, notes, and snippets.

jar {
baseName = 'frontend'
version = '0.0.1-SNAPSHOT'
}
distDocker {
exposePort 80
setEnvironment 'JAVA_OPTS', '-Dspring.profiles.active=docker'
}
docker {
baseImage = 'develar/java:8u45-dcevm'
backendServiceUrl = environment.getProperty("DOCKER_HOST", "tcp://localhost:2376").replace("tcp", "http");
backendServiceUrl = backendServiceUrl.substring(0, backendServiceUrl.lastIndexOf(":"));
backendServiceUrl += ":8585";
when(restUtils.getServiceUrl("backend")).thenReturn(URI.create(this.getBackendServiceUrl()));
apply plugin: 'application'
apply plugin: 'docker'
import org.apache.tools.ant.taskdefs.condition.Os
def DOCKER_REPO = "klhauser"
task buildDockerImage(type: Docker) {
tagVersion = 'latest'
tag = DOCKER_REPO + "/lessoria-" + jar.baseName
push = project.hasProperty('push')
buildscript {
ext {
springBootVersion = "1.4.0.M2"
}
repositories {
mavenCentral()
maven { url "https://repo.spring.io/milestone" }
maven { url "https://repo.spring.io/snapshot" }
}
dependencies {
machine:
java:
version: oraclejdk8
environment:
SECRET_KEY: CI
dependencies:
override:
- export TERM="dumb"; ./gradlew compileTestJava
cache_directories:
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'jacoco'
repositories {
mavenCentral()
}
// Only report code coverage for projects that are distributed
def publishedProjects = subprojects.findAll { it.path != ':simulator' }
subprojects {
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'maven'
springBoot {
requiresUnpack = ['com.netflix.eureka:eureka-core','com.netflix.eureka:eureka-client']
}
apply plugin: 'jacoco'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:all'
}
jacocoTestReport {
group = 'Coverage reports'
description = 'Generates a test coverage report for a project'
buildscript {
ext {
springBootVersion = "1.3.3.RELEASE"
}
repositories {
mavenCentral()
maven { url "https://repo.spring.io/milestone" }
maven { url "https://repo.spring.io/snapshot" }
}
dependencies {