-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
192 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,65 @@ | ||
= CDC Workshop Repository | ||
|
||
image:https://badges.gitter.im/cdc-workshop/Lobby.svg[link="https://gitter.im/cdc-workshop/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"] | ||
image:https://badges.gitter.im/cdc-workshop/Lobby.svg[link="https://gitter.im/cdc-workshop/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"] | ||
|
||
== Idea | ||
|
||
There is an address service which delivers addresses. This is the producer. | ||
At the moment there is one Consumer which is an invoice service which can | ||
produce invoices. | ||
|
||
== Working with the code | ||
|
||
To develop, run and build a JDK 8 is required. The build system is | ||
https://gradle.org/[gradle]. | ||
The services are implemented with https://projects.spring.io/spring-boot/[spring boot]. | ||
|
||
=== Test the code | ||
|
||
_cd_ into the directory of your checkout. | ||
|
||
To test all services: | ||
|
||
[listing] | ||
---- | ||
$ ./gradlew test # for linux | ||
---- | ||
|
||
[listing] | ||
---- | ||
$ ./gradlew.bat test # for windows | ||
---- | ||
|
||
=== Run address-service | ||
|
||
[listing] | ||
---- | ||
$ ./gradlew :address-service:bootRun | ||
---- | ||
|
||
TIP: `ctrl^c` ends the running spring boot server | ||
|
||
|
||
=== Run invoice-service | ||
|
||
[listing] | ||
---- | ||
$ ./gradlew :invoice-service:bootRun | ||
---- | ||
|
||
== Working with the presentation | ||
|
||
To generate the presentation: | ||
|
||
[listing] | ||
---- | ||
$ ./gradlew asciidoctor | ||
---- | ||
|
||
afterwards you can present with a browser (here we are using firefox): | ||
|
||
[listing] | ||
---- | ||
$ firefox ./presentation/build/asciidoc/html5/presentation.html & | ||
---- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
buildscript { | ||
dependencies { | ||
classpath 'org.ysb33r.gradle:vfs-gradle-plugin:1.0-beta1' | ||
classpath 'commons-httpclient:commons-httpclient:3.1' | ||
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.11' | ||
} | ||
} | ||
|
||
plugins { | ||
id 'org.asciidoctor.convert' version '1.5.3' | ||
id 'com.github.jruby-gradle.base' version '1.2.1' | ||
} | ||
|
||
apply plugin: 'com.github.jruby-gradle.base' | ||
apply plugin: 'org.ysb33r.vfs' | ||
apply plugin: 'java' | ||
apply plugin: 'org.asciidoctor.convert' | ||
|
||
version = '2.0' | ||
|
||
ext { | ||
deckjsVersion = 'master' | ||
asciidoctorBackendVersion = 'master' | ||
downloadDir = new File(buildDir,'download') | ||
templateDir = new File(downloadDir,'templates') | ||
deckjsDir = new File(downloadDir,'deck.js') | ||
} | ||
|
||
repositories { | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
gems 'rubygems:haml:4.0.6' | ||
} | ||
|
||
task download { | ||
doLast { | ||
mkdir downloadDir | ||
vfs { | ||
cp "zip:https://github.com/asciidoctor/asciidoctor-deck.js/archive/${asciidoctorBackendVersion}.zip!asciidoctor-deck.js-${asciidoctorBackendVersion}/templates", | ||
templateDir, recursive: true, overwrite: true | ||
cp "zip:https://github.com/imakewebthings/deck.js/archive/${deckjsVersion}.zip!deck.js-${deckjsVersion}", | ||
deckjsDir, recursive: true, overwrite: true | ||
} | ||
} | ||
} | ||
|
||
download { | ||
description "Download extra deckjs resources" | ||
outputs.dir templateDir | ||
outputs.dir deckjsDir | ||
} | ||
|
||
asciidoctorj { | ||
version = '1.5.4' | ||
} | ||
|
||
asciidoctor { | ||
dependsOn jrubyPrepare | ||
|
||
sources { | ||
include 'presentation.adoc' | ||
} | ||
|
||
resources { | ||
from (sourceDir) { | ||
include 'images/**' | ||
} | ||
from (downloadDir) { | ||
include 'deck.js/**' | ||
} | ||
} | ||
|
||
backends 'html5', 'pdf' | ||
|
||
attributes \ | ||
'build-gradle': file('build.gradle'), | ||
'encoding': 'utf-8', | ||
'sourcedir': project.sourceSets.main.java.srcDirs[0], | ||
'endpoint-url': '', | ||
'source-highlighter': 'coderay', | ||
'imagesdir': './images', | ||
'toc': 'left', | ||
'icons': 'font', | ||
'setanchors': '', | ||
'idprefix': '', | ||
'idseparator': '-', | ||
'docinfo1': '', | ||
'deckjs_theme': 'neon', | ||
'deckjs_transition': 'fade' | ||
|
||
|
||
|
||
options template_dirs : [new File(templateDir,'haml').absolutePath ] | ||
|
||
dependsOn download | ||
} | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
= Consumer Driven Contracts - a workshop | ||
dada <dada@dada.com> | ||
2017 | ||
:author: dada | ||
ifndef::imagesdir[:imagesdir: images] | ||
:menu: | ||
:goto: | ||
:scale: | ||
:help: | ||
:toc: | ||
:status: | ||
:blank: | ||
:figure-caption!: | ||
|
||
== Introduction | ||
|
||
Important: | ||
|
||
* consumer | ||
* code first | ||
* ... | ||
|
||
image::question_mark.jpg[question mark,,,, link="https://martinfowler.com/articles/consumerDrivenContracts.html"] | ||
|
||
So, let's start. | ||
|
||
== The end | ||
|
||
dada |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ rootProject.name = 'cdc-workshop' | |
|
||
include("address-service") | ||
include("invoice-service") | ||
include("presentation") |