Skip to content

Just a lab app using CI/CD over CircleCI, AWS Elastic Beanstalk and Docker.

Notifications You must be signed in to change notification settings

matake01/foo-bar-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

foo-bar-app

Prerequisites

Techniques used

Build and run

Clean and build:

mvn clean install

Skip integration tests:

mvn package -DskipITs

Skip all tests:

mvn package -DskipTests

Run tests:

mvn verify

System Properties

Base

  • spring.profiles.active - Set to either 'development' or 'production'. See section Spring Profiles for more details.
  • log.dir - The path to store log files

Persistence

  • spring.datasource.jdbc.driver - The JDBC Driver
  • spring.datasource.jdbc.url - The DB URL
  • spring.datasource.jdbc.username - The DB username
  • spring.datasource.jdbc.password - The DB password
  • spring.jpa.hibernate.dialect - The dialect type of the ORM. E.g. org.hibernate.dialect.MySQLDialect
  • spring.jpa.hibernate.hbm2ddl.auto - Defines how the database schema should be populated: 'create', 'create-drop', 'validate' or 'none'.

Tests

  • test.app.domain - Used for integration tests. Defines the HTTP root endpoint where the application runs (E.g. http://example.com/app)
  • test.user.agentid - The AgentId of the superuser context during integration testing
  • test.webdriver.chrome.driver - Used by Selenium. Should be the full path to the ChromeDriver in your local environment.

Spring Profiles

Development

spring.profiles.active="dev"

Production

spring.profiles.active="production"

Maven Profiles

Test

A pre-defined profile is configured in the pom.xml. The profile is mainly for usage within Autonuomous Testing/Continuous Integration pipelines.

spring.profiles.active="dev"
spring.datasource.jdbc.driver="org.hsqldb.jdbcDriver"
spring.datasource.jdbc.url="jdbc:hsqldb:hsql://localhost/xdb"
spring.datasource.jdbc.username="sa"
spring.datasource.jdbc.password=""
spring.jpa.hibernate.dialect="org.hibernate.dialect.HSQLDialect"
spring.jpa.hibernate.hbm2ddl.auto="create-drop"
test.app.domain="http://localhost:9090/app"
test.user.agentid="${env.TEST_USER_AGENTID}"
test.webdriver.chrome.driver="${env.TEST_WEBDRIVER_CHROME_DRIVER}"
log.dir="${project.basedir}/log"

Eclipse IDE Support

Adds Eclipse Dynamic Web support to the project:

mvn eclipse:eclipse

Build and run with Docker

Build Java binary:

docker run -it --rm -v "$PWD":/app -w /app maven:3.3-jdk-8 mvn clean package

Build your image:

docker build --rm=false -t app .

Run built image:

docker run --rm -p 8080:8080 app

Now available under:

http://localhost:8080/app

About

Just a lab app using CI/CD over CircleCI, AWS Elastic Beanstalk and Docker.

Resources

Stars

Watchers

Forks

Packages

No packages published