Sample app to demonstrate some integration based on Java 8, MongoDB and Spring Boot.
Prerequisites: The application needs to be built with Maven 3.0.4++, Java 8, MongoDB and uses Lombok to generate setter/getters etc. Please have a look on https://projectlombok.org/ to see how is your IDE supported.
To build:
$ mvn clean package
Building the Docker image
cd app
docker build -t <your repo>/imaginarium .
The maven packaged app jar could be started directly, but also available as Docker image to run it without any preparation
Java app is available on localhost:8080 and the passed java.security.egd settings are mandatory for some virtualized environment (e.g. Digital Ocean), otherwise the startup takes 30 mins o.O.
To run the app you could configure your MongoDB access or use the following I generated for reviewers (that differs from my dev instance):
mongodb://appdirect:Test-2015@ds027698.mongolab.com:27698/imaginarium-dev
The consumer key and secret is already provided in /app/src/main/resources/application.yml
The app has a fully automated build pipeline on: /not available anymore/
Pipeline screenshot:
java -DMONGO_URI=<mongodb connection string> -Djava.security.egd=file:/dev/urandom -jar imaginarium.jar
Docker image exposes the app port 8080 internally and you just need to pull it from the public hub and assign port 80 to the exposed one:
docker pull lexandro/imaginarium // optional
docker run -dt --name 'imaginarium' -e MONGO_URI=<mongodb connection string> -p 80:8080 lexandro/imaginarium java -Djava.security.egd=file:/dev/urandom -jar imaginarium.jar
Here's the app's screenshot
At the moment the sonar step is demonstrational to show how the automated code quality check could be integrated into the process. The pipeline is autogenerated from DSL script as a bootstrap job and depending only on some settings, but not a dedicated jenkins server. The pipeline source code could be found here:
https://github.com/lexandro/integration-bootstrap
Subscription:
- Create: http://imaginarium.lexandro.com/subscriptions/v1/create/?url={eventUrl}&token={token}
- Change: http://imaginarium.lexandro.com/subscriptions/v1/change/?url={eventUrl}&token={token}
- Cancel: http://imaginarium.lexandro.com/subscriptions/v1/cancel/?url={eventUrl}&token={token}
- Notice: http://imaginarium.lexandro.com/subscriptions/v1/notice/?url={eventUrl}&token={token}
User management: