Commit 4cd9d0b5 authored by Gerrit Hübbers's avatar Gerrit Hübbers 🃏
Browse files

Set up staging profile

parent 1ebb59ce
......@@ -26,6 +26,18 @@ Bower is used to manage CSS and JavaScript dependencies used in this application
specifying a newer version in `bower.json`. You can also run `bower update` and `bower install` to manage dependencies.
Add the `-h` flag on any command to see how you can use it. For example, `bower update -h`.
## Staging
### Initial setup
The staging environment shall be as close as possible to the production environment. DDA uses MySQL in its staging environment. Assuming a MySQL server is running, and the `mysql` client tool exists, run the following commands in order to set up the DDA MySQL database in a state as expected by DDA's `staging` profile:
mysql --user=root --password --host=localhost --port=3306 --protocol=TCP --verbose --execute="create database if not exists dda character set utf8 collate utf8_general_ci;"
mysql --user=root --password --host=localhost --port=3306 --protocol=TCP --verbose --execute="create user 'dda'@'localhost' identified by 'dda';"
mysql --user=root --password --host=localhost --port=3306 --protocol=TCP --verbose --execute="grant all privileges on dda.* to 'dda'@'localhost'; flush privileges;"
### Running DDA with the `staging` profile on a development machine
To build a staging version on your development machine, run `mvn package -Pstaging -DskipTests=true`. To run this staging version on your development machine, run `java -jar target/dda-wizard.war`.
# Building for production
To optimize the DDA client for production, run:
......@@ -41,15 +53,15 @@ To ensure everything worked, run:
Then navigate to [http://localhost:8080](http://localhost:8080) in your browser.
# Testing
## Testing
Unit tests are run by [Karma][] and written with [Jasmine][]. They're located in `src/test/javascript` and can be run with:
grunt test
# Development
## Development methodology
#### Fixing bugs and building features on dedicated branches
## Development
### Development methodology
##### Fixing bugs and building features on dedicated branches
It is a best practice to fix a bug and develop a new feature on a dedicated git branch, then, after finishing that task, merging the made changes back into the *master* branch.
* For the whole development group, this helps in maintaining a working DDA Wizard version in the *master* branch - it will never contain a half-baked version.
* For the individual developer(s) working on the branch, it helps to develop on their task with a known DDA Wizard git project state, and changes on the *master* made concurrently by others won't interfere with their work.
......@@ -107,13 +119,13 @@ git push
# make a final quality assurance test on svko-dda-test, and make sure that both your new changes and all previously developed features and bugfixes work smoothly together...
## In-memory database
### In-memory database
You can interact with the h2 in-memory database by visiting its web interface at [http://localhost:8080/h2-console](http://localhost:8080/h2-console). As *JDBC URL*, provide `jdbc:h2:mem:dda`. As *User Name*, provide DDA. Keep *Password* empty.
## Debugging
### Debugging
The `dev` profile activates Java debugging capability. You can connect a client debugger by pointing it to `localhost:5005`.
## Project source filesystem layout
### Project source filesystem layout
/ <--- development- and build- relevant files, including this README.MD, pom.xml, package.json, Gruntfile.js ... not part of the final build artifact
|- src/
|- main/
......@@ -122,23 +134,6 @@ The `dev` profile activates Java debugging capability. You can connect a client
|- scss/ <--- Gruntfile.js configures the grunt-sass task to process SASS stylesheets in this directory
|- webapp/ <--- in the final build artifact, its content will land in /. This content will be served out as files via HTTP!
# Continuous Integration
To setup this project in Jenkins, use the following configuration:
* Project name: `DDA`
* Source Code Management
* Git Repository: ``
* Branches to build: `*/master`
* Additional Behaviours: `Wipe out repository & force clone`
* Build Triggers
* Poll SCM / Schedule: `H/5 * * * *`
* Build
* Invoke Maven / Tasks: `-Pprod clean package`
* Post-build Actions
* Publish JUnit test result report / Test Report XMLs: `build/test-results/*.xml`
# this file is used for configuring dda-wizard for startup with SysV init.d.
# See
......@@ -789,6 +789,72 @@
<goal>build</goal> <!-- here, "build" as in "bind yeoman-maven-plugin's 'build' goal to the 'generate-resources' phase -->
<buildArgs>build --no-color</buildArgs> <!-- calls the grunt "build" task -->
<!-- log configuration -->
# ===================================================================
# Spring Boot configuration for the "dev" profile.
# Spring Boot configuration for the "prod" profile.
# This configuration overrides the application.yml file.
# ===================================================================
# ===================================================================
# Spring Boot configuration for the "staging" profile.
# This configuration overrides the application.yml file.
# ===================================================================
# ===================================================================
# Standard Spring Boot properties.
# Full reference is available at:
# ===================================================================
active: prod
enabled: false
enabled: false
driver-class-name: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
url: jdbc:mysql://localhost/dda
username: dda
password: dda
enabled: false
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
show_sql: true
hibernate.cache.use_second_level_cache: true
hibernate.cache.use_query_cache: false
hibernate.generate_statistics: true
hibernate.cache.region.factory_class: org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
host: localhost
port: 25
cache-seconds: 1
cache: false
contexts: prod
port: 8085
enabled: true
mime-types: text/html,text/xml,text/plain,text/css, application/javascript, application/json
# ===================================================================
# JHipster specific properties
# ===================================================================
cache: # Used by the CachingHttpHeadersFilter
timeToLiveInDays: 31
cache: # Hibernate 2nd level cache, used by CacheConfiguration
timeToLiveSeconds: 3600
maxBytesLocalHeap: 256M
mail: # specific JHipster mail property, for standard properties see MailProperties
from: DDA@localhost
metrics: # DropWizard Metrics configuration, used by MetricsConfiguration
jmx.enabled: true
enabled: false
host: localhost
port: 9999
enabled: false
host: localhost
port: 2003
prefix: DDA
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment