Skip to content
Permalink
Browse files
Merge branch 'develop' into FINCN-121
  • Loading branch information
Izakey committed Sep 1, 2019
2 parents 119b9b2 + d8f36aa commit 43057803e492832890cba430c165ef57c475f5e1
Showing 13 changed files with 191 additions and 7 deletions.
@@ -0,0 +1,7 @@
LICENSE
README.md
docs/
HEADER
NOTICE.txt
.git/
.gitignore
@@ -18,3 +18,5 @@ gradle-app.setting
*.log

*.toDelete

*.jar
@@ -0,0 +1,33 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
language: java
sudo: false
jdk:
- openjdk8
install: true
script: "./travis.sh"
env:
global:
- BUILD_SNAPSHOTS_BRANCH=develop
- ARTIFACTORY_URL=https://mifos.jfrog.io/mifos
- ARTIFACTORY_USER=travis-ci
- secure: "O51+259R9kiD11VTr2GKR9TOnjuP2lQTVZ02MyyJ3cU4DgaA+Q16nqhlXM5pFuh4IzHwGyhzTrEl95bslLqmUiiQOv+bhiPf0e7uqhJEDZYlOzgRGfIGWtVjqMa1WCOnOO0vzTcpwHRgd4YtwOy3knsR950KJfSg9w0iZzRQT1iTIAJcJ/p19ozUtWm1OImV3aukSmiXry7k3uLZBt7PTXf2/bvRqEQA0y71tYmUWZDV5QrfnFyApBUuoSVGaOyDlLf8YyxWrU2donb4PXvLje3zyrNYoJ7hg2gc1Qtg3NPscWxKebDds4rFcE/Zf6Z96Ctc9i2J/CfRlYT+BmkmqY3nbWU88Z6xWjvhAldj+WYxCt6UfZcuGJHnh+kNY7toQEq7cRlugrMASQZE911DuaphXlBI3zu1bBw0ypBDgLc9NT9+0WBlVEKu8OfoLb+XG9wHM6Z68w7jcbUi5ykOvZBNCEVZoNJH81HEKRB4a5EbTWYyyPINT7pTFgfcoJ9FLXcoeaTKcE0nFnMwp4FFQ6ripBNzr0TWMc7yZh6NVji/bRly3mndI5IiP3p/o9EooFDverW1jvAZmEgvocKQn7UeKXzVn40aac9S/vl43JlWPgH8oRCgYIQaiDHV6yfoqAY0eVvKfdyoLlWWAuUR1EJurxXmqEVRdnqT9lwLkws="
after_failure:
- ./gradlew rat
- cat api/build/reports/rat/rat-report.txt
@@ -0,0 +1,37 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
FROM openjdk:8-jdk-alpine AS builder
RUN mkdir builddir
COPY . builddir
WORKDIR builddir
RUN ./gradlew publishToMavenLocal


FROM openjdk:8-jdk-alpine AS runner

ARG accounting_port=2025

ENV server.max-http-header-size=16384 \
cassandra.clusterName="Test Cluster" \
server.port=$accounting_port

WORKDIR /tmp
COPY --from=builder /builddir/service/build/libs/service-0.1.0-BUILD-SNAPSHOT-boot.jar ./accounting-service-boot.jar

CMD ["java", "-jar", "accounting-service-boot.jar"]
@@ -1,4 +1,4 @@
# Apache Fineract CN Accounting
# Apache Fineract CN Accounting [![Build Status](https://api.travis-ci.com/apache/fineract-cn-accounting.svg?branch=develop)](https://travis-ci.com/apache/fineract-cn-accounting)

The accounting service tracks journal entries in accounts, and accounts in ledgers.

@@ -28,6 +28,7 @@ buildscript {
plugins {
id 'com.github.hierynomus.license' version '0.13.1'
id("org.nosphere.apache.rat") version "0.3.1"
id "com.jfrog.artifactory" version "4.9.5"
}

apply from: '../shared.gradle'
@@ -50,7 +51,7 @@ publishing {
from components.java
groupId project.group
artifactId project.name
version project.version
version project.findProperty('externalVersion') ?: project.version
}
}
}
@@ -46,6 +46,15 @@ task publishToMavenLocal {
dependsOn publishComponentTestToMavenLocal
}

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

task prepareForTest {
group 'all'
dependsOn publishToMavenLocal
@@ -33,6 +33,7 @@ buildscript {
plugins {
id 'com.github.hierynomus.license' version '0.13.1'
id("org.nosphere.apache.rat") version "0.3.1"
id "com.jfrog.artifactory" version "4.9.5"
}

apply from: '../shared.gradle'
@@ -63,8 +64,9 @@ asciidoctor {

publishing {
publications {
mavenJava(MavenPublication) {
componentTest(MavenPublication) {
from components.java
version project.findProperty('externalVersion') ?: project.version
}
}
}
@@ -99,7 +99,7 @@ public void testAccountFromARealCase() throws IOException, InterruptedException
ledger1100.setName("Income from Loans");
ledger1100.setParentLedgerIdentifier("1000");
ledger1100.setShowAccountsInChart(true);

testSubject.addSubLedger(ledger1100.getParentLedgerIdentifier(),ledger1100);
Assert.assertTrue(eventRecorder.wait(EventConstants.POST_LEDGER, ledger1100.getIdentifier()));

@@ -32,6 +32,7 @@ buildscript {
plugins {
id 'com.github.hierynomus.license' version '0.13.1'
id("org.nosphere.apache.rat") version "0.3.1"
id "com.jfrog.artifactory" version "4.9.5"
}

apply from: '../shared.gradle'
@@ -45,8 +46,9 @@ dependencies {

publishing {
publications {
mavenJava(MavenPublication) {
importer(MavenPublication) {
from components.java
version project.findProperty('externalVersion') ?: project.version
}
}
}
@@ -32,6 +32,7 @@ buildscript {
plugins {
id 'com.github.hierynomus.license' version '0.13.1'
id("org.nosphere.apache.rat") version "0.3.1"
id "com.jfrog.artifactory" version "4.9.5"
}

apply from: '../shared.gradle'
@@ -69,14 +70,14 @@ publishing {
from components.java
groupId project.group
artifactId project.name
version project.version
version project.findProperty('externalVersion') ?: project.version
}
bootService(MavenPublication) {
// "boot" jar
artifact ("$buildDir/libs/$project.name-$version-boot.jar")
groupId project.group
artifactId ("$project.name-boot")
version project.version
version project.findProperty('externalVersion') ?: project.version
}
}
}
@@ -45,6 +45,7 @@ tasks.withType(JavaCompile) {
repositories {
jcenter()
mavenLocal()
maven { url 'https://mifos.jfrog.io/mifos/libs-snapshot/' }
}

dependencyManagement {
@@ -76,6 +77,22 @@ jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

artifactory {
contextUrl = System.getenv("ARTIFACTORY_URL")
publish {
repository {
repoKey = project.findProperty('artifactoryRepoKey')
username = System.getenv("ARTIFACTORY_USER")
password = System.getenv("ARTIFACTORY_PASSWORD")
}

defaults {
publications ('api', 'service', 'bootService', 'componentTest', 'importer')
}
}
}
artifactoryPublish.dependsOn('clean','publishToMavenLocal')

license {
header rootProject.file('../HEADER')
strictCheck true
@@ -90,6 +107,7 @@ license {
rat {
// List of exclude directives, defaults to ['**/.gradle/**']
excludes = [
"**/.dockerignore/**",
"**/.idea/**",
"**/.gradle/**",
"**/gradle/**",
@@ -99,4 +117,5 @@ rat {
"gradlew.bat",
"README.md"
]
plainOutput = true
}
@@ -0,0 +1,71 @@
#!/usr/bin/env bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

# Documentation: https://cwiki.apache.org/confluence/display/FINERACT/Fineract-CN+Artifactory

#Exit immediately if a command exits with a non-zero status.
set -e
EXIT_STATUS=0

# Builds and Publishes a SNAPSHOT
function build_snapshot() {
echo -e "Building and publishing a snapshot out of branch [$TRAVIS_BRANCH]"
./gradlew -PartifactoryRepoKey=libs-snapshot-local -DbuildInfo.build.number=${TRAVIS_COMMIT::7} artifactoryPublish --stacktrace || EXIT_STATUS=$?
}

# Builds a Pull Request
function build_pullrequest() {
echo -e "Building pull request #$TRAVIS_PULL_REQUEST of branch [$TRAVIS_BRANCH]. 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'"
./gradlew -PartifactoryRepoKey=libs-snapshot-local -DbuildInfo.build.number=${TRAVIS_COMMIT::7} -PexternalVersion=${TRAVIS_BRANCH}-SNAPSHOT artifactoryPublish --stacktrace || EXIT_STATUS=$?
}

# Builds and Publishes a Tag
function build_tag() {
echo -e "Building tag [$TRAVIS_TAG] and publishing it as a release"
./gradlew -PartifactoryRepoKey=libs-release-local -PexternalVersion=$TRAVIS_TAG artifactoryPublish --stacktrace || EXIT_STATUS=$?

}

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
build_pullrequest
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
build_snapshot
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
build_tag
else
echo -e "WARN: Unexpected env variable values => Branch [$TRAVIS_BRANCH], Tag [$TRAVIS_TAG], Pull Request [#$TRAVIS_PULL_REQUEST]"
./gradlew clean build
fi

exit ${EXIT_STATUS}

0 comments on commit 4305780

Please sign in to comment.