Git Product home page Git Product logo

hippo-on-spring-boot's Introduction

hippo-on-spring-boot

hippo-on-spring-boot, a demo project to wrap a Hippo project into single JAR executable Spring Boot application.

This project uses hipshoot Spring Boot Support library to wrap a Hippo project into a Spring Boot application package.

In summary,

Build

$ mvn clean package

Run

$ cd spring-boot-deploy
$ rm -rf ./repository/
$ ./test.sh

You can also pass environment-specific profile ('prod', 'acct', 'test', etc.):

$ cd spring-boot-deploy
$ rm -rf ./repository/
$ ./test.sh --spring.profiles.active=prod

For environment specific profiles, please see application.yml. Also, please look up Spring Boot Reference documentation about how to configure/use multiple profiles in application.yml file.

The last command (./test.sh --spring.profiles.active=prod) can be replaced with this (by setting environment variable for environment profile instead):

$ export SPRING_PROFILES_ACTIVE=prod
$ ./test.sh

Or, you can update test.sh to pass a system property instead (e.g, -Dspring.profiles.active=prod) instead, too.

Note: you can skip removing ./repository/ directory if you want to keep the existing Hippo repository storage directory.

Or, on Windows,

> cd spring-boot-deploy
> test.bat

See test.sh or test.bat. It's just a simple java command line.

You can simply type Ctrl-C to stop it.

Test

Visit http://localhost:8080/site/ and http://localhost:8080/cms/.

Application Configuration

See application.yml.

Deploying to the cloud (e.g, Cloud Foundry, Heroku, etc.)

See Deploying to the cloud in Spring Boot documentation for detail.

You can use very simple commands like the following example when deploying onto Cloud Foundry:

$ cd spring-boot-deploy
$ cf login -a https://api.run.pivotal.io
$ cf push hippo-on-spring-boot \
    -f manifest.yml \
    -p target/hippo-on-spring-boot-spring-boot-deploy-0.1.0-SNAPSHOT.jar \
    -t 180

To stop the application: cf stop spring-boot-deploy

To delete the application: cf delete spring-boot-deploy

You can also monitor the application through PCF Console (e.g, https://console.run.pivotal.io/).

After deployment, for example, you can visit:

Note: Please also take a look at manifest.yml which defines various environment settings. Especially, JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: '[enabled: false]' must be set in order to disable PCF Auto-Reconfiguration feature. Otherwise, the JNDI resources such as DataSources would cause problems in this kind of multi-wars based deployment scenarios.

Option for Deferred Initialization of RepositoryServlet

Sometimes, you might want to start up the servlet container fast enough without waiting for the Hippo RepositoryServlet to complete its long initialization steps (such as storage and lucene index recreation). If its initialization time is more than some threshold (e.g, 60 seconds by default in CloudFoundry), it could cause failing of the push.

So, in this demo project, the Repository servlet in cms/src/main/webapp/WEB-INF/web.xml was replaced by DeferredInitDelegatingServlet for deferred asynchronous initialization. This way, you can start up the servlet container fast enough without having to wait for the RepositoryServlet to initialize synchronously. This optional feature can be very helpful when deploying onto cloud based platform such as CloudFoundry.

hippo-on-spring-boot's People

Contributors

woonsanko avatar

Watchers

James Cloos avatar fengchang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.