Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove startContainers.sh in favor of Docker Compose #31

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ build
.project
*.iml
.idea
out/
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,21 @@ Usage
Requires
--------

- Java 7 (8+ does not work)
- Java 7 or 8 (Java>8 does not work)
- MySQL Client + Server
- RabbitMQ

Setup (with Docker)
-------------------
Setup (with Docker Compose)
---------------------------

To make it easy to run the tests and it requirements,
the `startContainers.sh` script is provided. Which
will start a:
the `docker-compose.yml` Docker Compose configuration
file is provided. Which will start a:
- MySQL Server container
- RabbitMQ Server container
- RabbitMQ Management container

If the `mysql` command is available, which is the mysql client,
also the required SQL scripts will be imported into the MySQL
Server.

If you use the `startContainers.sh` script, you don't need
If you use Docker Compose, you don't need
MySQL Server and RabbitMQ installed locally. Instead,
Docker needs to be installed as the script will start
MySQL and RabbitMQ in Docker containers.
Expand Down
25 changes: 23 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.avast.gradle:gradle-docker-compose-plugin:0.8.12'
}
}

allprojects {
apply plugin: 'java'

apply plugin: 'com.avast.gradle.docker-compose'
}

subprojects {
Expand All @@ -25,7 +35,10 @@ project(':iddd_common') {
compile group: 'com.google.code.gson', name: 'gson', version: '2.1'
compile group: 'com.rabbitmq', name: 'amqp-client', version: '3.0.4'
compile group: 'org.hibernate', name: 'hibernate', version: '3.2.7.ga'
compile group: 'org.springframework', name: 'spring', version: '2.5.6'
compile group: 'org.springframework', name: 'spring-core', version: '3.2.18.RELEASE'
compile group: 'org.springframework', name: 'spring-context', version: '3.2.18.RELEASE'
compile group: 'org.springframework', name: 'spring-tx', version: '3.2.18.RELEASE'
compile group: 'org.springframework', name: 'spring-hibernate3', version: '2.0.8'
compile group: 'org.iq80.leveldb', name: 'leveldb', version: '0.5'
compile group: 'org.aspectj', name: 'aspectjweaver', version: '1.7.2'
compile group: 'javassist', name: 'javassist', version: '3.8.0.GA'
Expand All @@ -40,7 +53,10 @@ project(':iddd_common') {
project(':iddd_identityaccess') {
dependencies {
compile project(':iddd_common')
compile group: 'org.springframework', name: 'spring', version: '2.5.6'
compile group: 'org.springframework', name: 'spring-core', version: '3.2.18.RELEASE'
compile group: 'org.springframework', name: 'spring-context', version: '3.2.18.RELEASE'
compile group: 'org.springframework', name: 'spring-tx', version: '3.2.18.RELEASE'
compile group: 'org.springframework', name: 'spring-hibernate3', version: '2.0.8'
compile group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2.0-rc1'
compile group: 'org.jboss.resteasy', name: 'resteasy-cache-core', version: '2.0.1.GA'

Expand Down Expand Up @@ -71,4 +87,9 @@ project(':iddd_agilepm') {

testCompile files(this.project(':iddd_common').sourceSets.test.output)
}
}

subprojects*.tasks*.withType(Test) {
dependsOn composeUp
finalizedBy composeDown
}
23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '3.1'

services:
iddd-mysql:
restart: always
image: mysql:5
ports:
- "3306:3306"
volumes:
- ./iddd_common/src/main/mysql/test_common.sql:/docker-entrypoint-initdb.d/01_test_common.sql
- ./iddd_common/src/main/mysql/common.sql:/docker-entrypoint-initdb.d/02_common.sql
- ./iddd_identityaccess/src/main/mysql/iam.sql:/docker-entrypoint-initdb.d/03_iam.sql
- ./iddd_collaboration/src/main/mysql/collaboration.sql:/docker-entrypoint-initdb.d/04_collaboration.sql
environment:
MYSQL_ROOT_PASSWORD: root
rabbitmq:
restart: always
image: rabbitmq:3-management
ports:
- "5672:5672"
- "8080::15672"
environment:
RABBITMQ_NODENAME: iddd-rabbitmq-node
4 changes: 2 additions & 2 deletions iddd_collaboration/src/main/mysql/collaboration.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CREATE TABLE `tbl_dispatcher_last_event` (

CREATE TABLE `tbl_es_event_store` (
`event_id` bigint(20) NOT NULL auto_increment,
`event_body` varchar(65000) NOT NULL,
`event_body` text NOT NULL,
`event_type` varchar(250) NOT NULL,
`stream_name` varchar(250) NOT NULL,
`stream_version` int(11) NOT NULL,
Expand Down Expand Up @@ -123,7 +123,7 @@ CREATE TABLE `tbl_vw_post` (
`author_email_address` varchar(100) NOT NULL,
`author_identity` varchar(50) NOT NULL,
`author_name` varchar(200) NOT NULL,
`body_text` varchar(64000) NOT NULL,
`body_text` text NOT NULL,
`changed_on` datetime NOT NULL,
`created_on` datetime NOT NULL,
`discussion_id` varchar(36) NOT NULL,
Expand Down
119 changes: 0 additions & 119 deletions startContainers.sh

This file was deleted.