Skip to content
Permalink
Browse files
Merge pull request #11 from aasaru/gradle_4.10.3
FINCN-179 gradle to 4.10.3, FINCN-178 make Travis build forks, ...
  • Loading branch information
aasaru committed Oct 9, 2019
2 parents 4327ce0 + 6d2695f commit 14f1da93e9d249afa55e5db619a32f368b959361
Showing 14 changed files with 76 additions and 46 deletions.
@@ -1,6 +1,8 @@
# Apache Fineract CN Provisioner [![Build Status](https://api.travis-ci.com/apache/fineract-cn-provisioner.svg?branch=develop)](https://travis-ci.com/apache/fineract-cn-provisioner)
# Apache Fineract CN Provisioner [![Build Status](https://api.travis-ci.com/apache/fineract-cn-provisioner.svg?branch=develop)](https://travis-ci.com/apache/fineract-cn-provisioner) [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/apache/fineract-cn-provisioner)](https://hub.docker.com/r/apache/fineract-cn-provisioner/builds)


This service provisions services for tenants of an Apache Fineract CN installation.
[Read more](https://cwiki.apache.org/confluence/display/FINERACT/Fineract+CN+Project+Structure#FineractCNProjectStructure-provisioner).

## Abstract
Apache Fineract CN is an application framework for digital financial services, a system to support nationwide and cross-national financial transactions and help to level and speed the creation of an inclusive, interconnected digital economy for every nation in the world.
@@ -20,15 +20,15 @@ buildscript {
jcenter()
}

dependencies {
classpath 'io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE'
}
}

plugins {
id 'com.github.hierynomus.license' version '0.13.1'
id("org.nosphere.apache.rat") version "0.3.1"
id("org.nosphere.apache.rat") version "0.5.2"
id "com.jfrog.artifactory" version "4.9.5"
id "io.spring.dependency-management" version "1.0.8.RELEASE"
id 'maven-publish'
id 'java'
}

apply from: '../shared.gradle'
@@ -45,7 +45,13 @@ task artifactoryPublish {
dependsOn gradle.includedBuild('api').task(':artifactoryPublish')
dependsOn gradle.includedBuild('service').task(':artifactoryPublish')
dependsOn gradle.includedBuild('component-test').task(':artifactoryPublish')
}

task clean {
group 'all'
dependsOn gradle.includedBuild('api').task(':clean')
dependsOn gradle.includedBuild('service').task(':clean')
dependsOn gradle.includedBuild('component-test').task(':clean')
}

task prepareForTest {
@@ -25,20 +25,26 @@ buildscript {
}

dependencies {
classpath ("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.3")
}
}

plugins {
id 'com.github.hierynomus.license' version '0.13.1'
id("org.nosphere.apache.rat") version "0.3.1"
id("org.nosphere.apache.rat") version "0.5.2"
id "com.jfrog.artifactory" version "4.9.5"
id "org.springframework.boot" version "1.4.3.RELEASE"
id 'maven-publish'
id 'java'
}

apply from: '../shared.gradle'
apply plugin: 'org.asciidoctor.convert'

bootRepackage {
enabled = false
}

dependencies {
compile(
[group: 'org.apache.fineract.cn.provisioner', name: 'api', version: project.version],
BIN +1.92 KB (100%) gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
@@ -1,6 +1,5 @@
#Fri Apr 13 14:41:57 CEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
@@ -155,7 +155,7 @@ if $cygwin ; then
fi

# Escape application args
save ( ) {
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
@@ -23,25 +23,23 @@ buildscript {
repositories {
jcenter()
}

dependencies {
classpath ("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}


plugins {
id 'com.github.hierynomus.license' version '0.13.1'
id("org.nosphere.apache.rat") version "0.3.1"
id("org.nosphere.apache.rat") version "0.5.2"
id "com.jfrog.artifactory" version "4.9.5"
id "org.springframework.boot" version "1.4.3.RELEASE"
id 'maven'
id 'maven-publish'
id 'java'
id 'idea'
}

apply from: '../shared.gradle'

apply plugin: 'spring-boot'

springBoot {
executable = true
bootRepackage {
enabled = true
classifier = 'boot'
}

@@ -65,14 +63,18 @@ dependencies {
[group: 'org.apache.fineract.cn', name: 'cassandra', version: versions.frameworkcassandra],
[group: 'org.hibernate', name: 'hibernate-validator', version: versions.validator],
[group: 'org.apache.fineract.cn', name: 'crypto', version: versions.frameworkcrypto],
[group: 'io.netty', name: 'netty-all', version: '4.1.39.Final'],
[group: 'io.netty', name: 'netty-transport-native-epoll', version: '4.1.39.Final']
)

testCompile(
[group: 'org.apache.fineract.cn', name: 'test', version: versions.frameworktest],
)
}

publishToMavenLocal.dependsOn bootRepackage
tasks.withType(PublishToMavenLocal) { task ->
task.dependsOn 'bootRepackage'
}

publishing {
publications {
@@ -84,7 +86,7 @@ publishing {
}
bootService(MavenPublication) {
// "boot" jar
artifact ("$buildDir/libs/$project.name-$version-boot.jar")
artifact(file("$buildDir/libs/$project.name-$project.version-${bootRepackage.classifier}.jar"))
groupId project.group
artifactId ("$project.name-boot")
version project.findProperty('externalVersion') ?: project.version
@@ -144,7 +144,7 @@ private void initializeSecurity(final TenantEntity tenantEntity,

//InitializeResources on the service being added should occur last, for two reasons:
// 1.) When the initialization event is put on the queue for this app/tenant combo, the app is fully ready for business.
// 2.) If the app depeneds on the provisioning of identitypermissions in its initialization, those resources will be there.
// 2.) If the app depends on the provisioning of identitypermissions in its initialization, those resources will be there.
anubisInitializer.initializeResources(tenantIdentifier, x.name, x.uri);
});
}
@@ -23,7 +23,7 @@ eureka:
defaultZone: http://localhost:8761/eureka/

server:
port: 9090
port: 2020
contextPath: /provisioner/v1/*

flyway:
@@ -50,4 +50,4 @@ spring:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/seshat
username: postgres
password: postgres
password: postgres
@@ -0,0 +1,10 @@
_____ _ _ ____ _ _
| ___(_)_ __ ___ _ __ __ _ ___| |_ / ___| \ | |
| |_ | | '_ \ / _ \ '__/ _` |/ __| __|____| | | \| |
| _| | | | | | __/ | | (_| | (__| ||_____| |___| |\ |
|_| |_|_| |_|\___|_| \__,_|\___|\__| \____|_| \_|
____ _ _
| _ \ _ __ _____ _(_)___(_) ___ _ __ ___ _ __
| |_) | '__/ _ \ \ / / / __| |/ _ \| '_ \ / _ \ '__|
| __/| | | (_) \ V /| \__ \ | (_) | | | | __/ |
|_| |_| \___/ \_/ |_|___/_|\___/|_| |_|\___|_|
@@ -23,21 +23,21 @@

public class JdbcUrlBuilderTest {

private final static String MARAIDB_JDBC_URL = "jdbc:mariadb://localhost:3306/comp_test";
private final static String POSTGRES_DB_JDBC_URL = "jdbc:postgresql:localhost:5432/comp_test";

public JdbcUrlBuilderTest() {
super();
}

@Test
public void shouldCreateMysqlUrl() {
final String mariaDbJdbcUrl = JdbcUrlBuilder
.create(JdbcUrlBuilder.DatabaseType.MARIADB)
public void shouldCreatePostgresUrl() {
final String postgresDbUrl = JdbcUrlBuilder
.create(JdbcUrlBuilder.DatabaseType.POSTGRESQL)
.host("localhost")
.port("3306")
.port("5432")
.instanceName("comp_test")
.build();

Assert.assertEquals(MARAIDB_JDBC_URL, mariaDbJdbcUrl);
Assert.assertEquals(POSTGRES_DB_JDBC_URL, postgresDbUrl);
}
}
@@ -34,12 +34,6 @@ ext.versions = [
validator : '5.3.0.Final'
]


apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'io.spring.dependency-management'

tasks.withType(JavaCompile) {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
@@ -77,7 +71,7 @@ dependencies {
}

jar {
from sourceSets.main.allSource
from sourceSets.main.java
}

artifactory {
@@ -110,14 +104,17 @@ license {
rat {
// List of exclude directives, defaults to ['**/.gradle/**']
excludes = [
"**/*.log",
"**/banner.txt",
"**/.idea/**",
"**/.gradle/**",
"**/gradle/**",
"**/build/**",
"gradlew",
"gradlew.bat",
"README.md",
"**/.dockerignore/**"
"**/.dockerignore/**",
"**/logs/**/*.log",
"**/banner.txt"
]
plainOutput = true
}
@@ -36,6 +36,12 @@ function build_pullrequest() {
./gradlew publishToMavenLocal rat || EXIT_STATUS=$?
}

# Builds Forked (non-apache) Repository
function build_fork() {
echo -e "Building branch $TRAVIS_BRANCH of fork $TRAVIS_REPO_SLUG. Won't publish anything to Artifactory."
./gradlew publishToMavenLocal rat || EXIT_STATUS=$?
}

# For other branches we need to add branch name as prefix
function build_otherbranch() {
echo -e "Building a snapshot out of branch [$TRAVIS_BRANCH] and publishing it with prefix '${TRAVIS_BRANCH}-SNAPSHOT'"
@@ -49,17 +55,19 @@ function build_tag() {

}

echo -e "TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG"
echo -e "TRAVIS_BRANCH=$TRAVIS_BRANCH"
echo -e "TRAVIS_TAG=$TRAVIS_TAG"
echo -e "TRAVIS_COMMIT=${TRAVIS_COMMIT::7}"
echo -e "TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST"

# Build Logic
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
if [[ $TRAVIS_REPO_SLUG != apache* ]]; then
build_fork
elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
build_pullrequest
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" != "$BUILD_SNAPSHOTS_BRANCH" ] && [ "$TRAVIS_TAG" == "" ] ; then
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" != "$BUILD_SNAPSHOTS_BRANCH" ] && [ "$TRAVIS_TAG" == "" ]; then
build_otherbranch
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "$BUILD_SNAPSHOTS_BRANCH" ] && [ "$TRAVIS_TAG" == "" ] ; then
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "$BUILD_SNAPSHOTS_BRANCH" ] && [ "$TRAVIS_TAG" == "" ]; then
build_snapshot
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
build_tag

0 comments on commit 14f1da9

Please sign in to comment.