MIFOSX-1758 Make the dist ZIP include the community-app in apps/ via Git submodule
Root build.sh, for both back-end and front-end Added -Penv=dev to incl. MariaDBj4 Include apps/**/* in ZIP, fixed UI URL in launcher, some doc Set submodule Git rev to one that actually exists on remote Don't use 'git submodule update --remote' but foreach .. build-cloudbees.sh makes npm available Better logging, and trying dev and prod dist UI
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
[submodule "apps/community-app"]
|
||||||
|
path = apps/community-app
|
||||||
|
url = https://github.com/openMF/community-app.git
|
||||||
|
branch = develop
|
||||||
@@ -3,6 +3,20 @@ Mifos Platform Apps
|
|||||||
|
|
||||||
Community created apps built on top of mifosplatform are stored in source control repository @ https://github.com/openMF/
|
Community created apps built on top of mifosplatform are stored in source control repository @ https://github.com/openMF/
|
||||||
|
|
||||||
|
To get the Git sub modules from here, use "--recursive" in your original git clone, or, if already cloned, do:
|
||||||
|
|
||||||
|
git submodule update --init --recursive; git submodule status
|
||||||
|
|
||||||
|
Later to update both this main repo but also get the latest from the submodule(s), do:
|
||||||
|
|
||||||
|
git pull; git submodule update --remote
|
||||||
|
|
||||||
|
Here is how a new Git submodule can (was originally) added here:
|
||||||
|
|
||||||
|
git submodule add -b develop https://github.com/openMF/community-app.git
|
||||||
|
git submodule init
|
||||||
|
|
||||||
|
|
||||||
The Community App (AngularJS-based)
|
The Community App (AngularJS-based)
|
||||||
===============
|
===============
|
||||||
https://github.com/openMF/community-app
|
https://github.com/openMF/community-app
|
||||||
|
|||||||
Submodule
+1
Submodule apps/community-app added at e4cf52eb74
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# https://developer.cloudbees.com/bin/view/DEV/Node+Builds
|
||||||
|
curl -s -o use-node https://repository-cloudbees.forge.cloudbees.com/distributions/ci-addons/node/use-node
|
||||||
|
NODE_VERSION=0.11.12 . ./use-node
|
||||||
|
|
||||||
|
./build.sh
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exit the script if any command returns a non-true return value (http://www.davidpashley.com/articles/writing-robust-shell-scripts/)
|
||||||
|
set -e
|
||||||
|
|
||||||
|
git --version
|
||||||
|
# TODO UNCOMMENT THIS once https://github.com/openMF/mifosx/pull/1291 is merged!
|
||||||
|
# git pull
|
||||||
|
# This does NOT get the most recent revision from the submodule repository.
|
||||||
|
# Instead, it only gets the revision of the submodule that is recorded in the revision of the main repository.
|
||||||
|
## NOT git submodule update --remote
|
||||||
|
# The following is very important, because even if the main (API) repo is latest,
|
||||||
|
# the sub-module initially will be a fixed old rev. and only this grabs real latest:
|
||||||
|
git submodule foreach 'git checkout develop && git pull --ff-only origin develop'
|
||||||
|
|
||||||
|
cd apps/community-app
|
||||||
|
./build.sh
|
||||||
|
cd ../../mifosng-provider/
|
||||||
|
./gradlew -Penv=dev clean dist
|
||||||
@@ -78,7 +78,7 @@ task dist(type:Zip){
|
|||||||
}
|
}
|
||||||
from('../apps') {
|
from('../apps') {
|
||||||
fileMode = 0755
|
fileMode = 0755
|
||||||
include '*.md'
|
include '**/*'
|
||||||
into('apps')
|
into('apps')
|
||||||
}
|
}
|
||||||
from('src/main/pentahoReports/') {
|
from('src/main/pentahoReports/') {
|
||||||
|
|||||||
+8
-1
@@ -11,7 +11,7 @@ along with all the other source files inside a (sub-folder of) the "apps" folder
|
|||||||
directory from where runmifosx.bat/.sh is launched. The web UI front-end is then accessible
|
directory from where runmifosx.bat/.sh is launched. The web UI front-end is then accessible
|
||||||
under mifosng-provider/apps - for example:
|
under mifosng-provider/apps - for example:
|
||||||
|
|
||||||
https://localhost:8443/mifosng-provider/apps/community-app/index.html
|
https://localhost:8443/mifosng-provider/apps/community-app/dist/community-app/index.html?baseApiUrl=https://localhost:8443&tenantIdentifier=default#/home
|
||||||
|
|
||||||
We hope you'll have an amazing experience working with MifosX!
|
We hope you'll have an amazing experience working with MifosX!
|
||||||
|
|
||||||
@@ -21,3 +21,10 @@ the Mifos X distribution ZIP package will (currently) have to be built using
|
|||||||
the Gradle 'dev' environment profile - e.g. using this command:
|
the Gradle 'dev' environment profile - e.g. using this command:
|
||||||
|
|
||||||
./gradlew -Penv=dev clean war dist
|
./gradlew -Penv=dev clean war dist
|
||||||
|
|
||||||
|
We now also have a script which convenently prepares both the
|
||||||
|
UI front-end and the API back-end together into a ZIP:
|
||||||
|
|
||||||
|
git clone --recursive https://github.com/openMF/mifosx/
|
||||||
|
git submodule update --init --recursive; git submodule status
|
||||||
|
./build.sh
|
||||||
|
|||||||
+47
-12
@@ -5,19 +5,21 @@
|
|||||||
*/
|
*/
|
||||||
package org.mifosplatform;
|
package org.mifosplatform;
|
||||||
|
|
||||||
|
import java.awt.Desktop;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URI;
|
||||||
|
|
||||||
import org.mifosplatform.infrastructure.core.boot.AbstractApplicationConfiguration;
|
import org.mifosplatform.infrastructure.core.boot.AbstractApplicationConfiguration;
|
||||||
import org.mifosplatform.infrastructure.core.boot.ApplicationExitUtil;
|
import org.mifosplatform.infrastructure.core.boot.ApplicationExitUtil;
|
||||||
import org.mifosplatform.infrastructure.core.boot.EmbeddedTomcatWithSSLConfiguration;
|
import org.mifosplatform.infrastructure.core.boot.EmbeddedTomcatWithSSLConfiguration;
|
||||||
import org.mifosplatform.infrastructure.core.boot.db.MariaDB4jDataSourceConfiguration;
|
import org.mifosplatform.infrastructure.core.boot.db.MariaDB4jDataSourceConfiguration;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.context.ConfigurableApplicationContext;
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
|
|
||||||
import java.awt.Desktop;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.URI;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mifos main() application which launches Mifos X in an embedded Tomcat HTTP
|
* Mifos main() application which launches Mifos X in an embedded Tomcat HTTP
|
||||||
* server (using Spring Boot), as well as an embedded database (using
|
* server (using Spring Boot), as well as an embedded database (using
|
||||||
@@ -32,26 +34,59 @@ import java.net.URI;
|
|||||||
* @see ServerApplication for the same without the embedded MariaDB4j database
|
* @see ServerApplication for the same without the embedded MariaDB4j database
|
||||||
*/
|
*/
|
||||||
public class ServerWithMariaDB4jApplication {
|
public class ServerWithMariaDB4jApplication {
|
||||||
|
private final static Logger logger = LoggerFactory.getLogger(ServerWithMariaDB4jApplication.class);
|
||||||
|
|
||||||
@Import({ MariaDB4jDataSourceConfiguration.class, EmbeddedTomcatWithSSLConfiguration.class })
|
@Import({ MariaDB4jDataSourceConfiguration.class, EmbeddedTomcatWithSSLConfiguration.class })
|
||||||
public static class Configuration extends AbstractApplicationConfiguration { }
|
public static class Configuration extends AbstractApplicationConfiguration { }
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
ConfigurableApplicationContext ctx = SpringApplication.run(Configuration.class, args);
|
ConfigurableApplicationContext ctx = SpringApplication.run(Configuration.class, args);
|
||||||
if (Desktop.isDesktopSupported()) {
|
if (!Desktop.isDesktopSupported()) {
|
||||||
Resource resource = ctx.getResource("file:" + System.getProperty("user.dir") +
|
logger.info("Not going to open UI homepage in local web browser, because !Desktop.isDesktopSupported()");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// apps/community-app/dist/community-app/index.html
|
||||||
|
Resource distResource = ctx.getResource("file:" + System.getProperty("user.dir") +
|
||||||
System.getProperty("file.separator") + "apps" +
|
System.getProperty("file.separator") + "apps" +
|
||||||
System.getProperty("file.separator") + "community-app" +
|
System.getProperty("file.separator") + "community-app" +
|
||||||
|
System.getProperty("file.separator") + "dist" +
|
||||||
|
System.getProperty("file.separator") + "community-app" +
|
||||||
System.getProperty("file.separator") + "index.html");
|
System.getProperty("file.separator") + "index.html");
|
||||||
if (resource.exists()) {
|
URI distURI = URI.create("https://localhost:8443/mifosng-provider" +
|
||||||
try {
|
"/apps/community-app/dist/community-app/index.html?baseApiUrl=https://localhost:8443" +
|
||||||
Desktop.getDesktop().browse(URI.create("https://localhost:8443/mifosng-provider" +
|
"&tenantIdentifier=default#/");
|
||||||
"/apps/community-app/index.html?baseApiUrl=https://localhost:8443" +
|
|
||||||
"&tenantIdentifier=default#/"));
|
// apps/community-app/app/index.html
|
||||||
} catch (IOException e) {}
|
Resource devResource = ctx.getResource("file:" + System.getProperty("user.dir") +
|
||||||
|
System.getProperty("file.separator") + "apps" +
|
||||||
|
System.getProperty("file.separator") + "community-app" +
|
||||||
|
System.getProperty("file.separator") + "app" +
|
||||||
|
System.getProperty("file.separator") + "index.html");
|
||||||
|
URI devURI = URI.create("https://localhost:8443/mifosng-provider" +
|
||||||
|
"/apps/community-app/app/index.html?baseApiUrl=https://localhost:8443" +
|
||||||
|
"&tenantIdentifier=default#/");
|
||||||
|
|
||||||
|
if (distResource.exists()) {
|
||||||
|
openWebBrowser(distURI);
|
||||||
|
} else if (devResource.exists()) {
|
||||||
|
openWebBrowser(devURI);
|
||||||
|
} else {
|
||||||
|
logger.error("Cannot open Mifos X UI in browser; not found: " + distResource.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO Tray Icon stuff; dig out my very own old @see https://github.com/mifos/head/tree/hudsonBuild-MIFOS-5157_Launch4j-EXE_NewDist-squash1/server-jetty/src/main/java/org/mifos/server/tray
|
||||||
|
|
||||||
ApplicationExitUtil.waitForKeyPressToCleanlyExit(ctx);
|
ApplicationExitUtil.waitForKeyPressToCleanlyExit(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void openWebBrowser(URI uri) {
|
||||||
|
try {
|
||||||
|
logger.info("Opening Mifos X UI in browser: " + uri.toString());
|
||||||
|
Desktop.getDesktop().browse(uri);
|
||||||
|
} catch (IOException e) {
|
||||||
|
logger.error("IOException when opening Mifos X UI in browser: " + uri.toString(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user