NB! This is still draft with work in progress!
Fineract-CN projects depend on each other. The simplest option is to build them all locally so artifacts are published to local maven repository.
Sometomes still there is need to only work with a single project and resolve the artifacts from public repository. Also in order for travis-ci to build some specific project it needs all the dependencies to be available. For this a JFrog Artifactory has been set up to host these artifacts.
In this artifacotry there are two repositories:
In order to use snapshot builds one needs to have following line in repositories list:
repositories {
jcenter()
mavenLocal()
maven {
url 'https://mifos.jfrog.io/mifos/libs-snapshot/'
}
} |
All apache/fineract-cn-* repositories are configured to be built with Travis-CI. Whenever something is pushed to a repository travis tries to run gradle build on it. Travis also detects the current branch that the changes were pushed to.
If travis detects that the changes were pushed to "develop" branch and build doesn't fail then it uploads the new snapshot artifacts to the public repository.
Then the build script sets version name of your artifact to "branchname-". So if normally you would refer to lang like this:
dependencies {
compile(
[group: 'org.apache.fineract.cn', name: 'lang', version: '0.1.0-BUILD-SNAPSHOT']
)
)To refer to the artifact built from branch "myfeature" you would have to use something like this:
dependencies {
compile(
[group: 'org.apache.fineract.cn', name: 'lang', version: 'myfeature-0.1.0-BUILD-SNAPSHOT']
)
)
How releases work
This is needed if you want to set up a new project or change existing setup.
repositories {
jcenter()
mavenLocal()
maven {
url 'https://mifos.jfrog.io/mifos/libs-snapshot/'
}
}
id "com.jfrog.artifactory" version "4.9.5"
version project.version
with: version findProperty('releaseTag') ?: findProperty('versionPrefix') + project.version
artifactory {
contextUrl = System.getenv("ARTIFACTORY_URL")
publish {
repository {
repoKey = (findProperty('releaseTag') ? 'libs-release-local' : 'libs-snapshot-local')
username = System.getenv("ARTIFACTORY_USER")
password = System.getenv("ARTIFACTORY_PASSWORD")
}
defaults {
publications ('langPublication')
}
}
}
artifactoryPublish.dependsOn('clean','publishToMavenLocal')
[](https://travis-ci.com/apache/fineract-cn-reponame)
language: java
sudo: false
jdk:
- openjdk8
install: true
script: "./travis.sh"
env:
global:
- BUILD_SNAPSHOTS_BRANCH=travis
- ARTIFACTORY_URL=https://mifos.jfrog.io/mifos
- ARTIFACTORY_USER=travis-ci1
- secure: "see below chapter Encrypt Artifactory password"
You need command line travis client.
travis encrypt --com -r apache/fineract-cn-reponame ARTIFACTORY_PASSWORD=enter-password-here
copy the encrypted secure value to .travis.yml