├── kata-spring-restdocs
└── solution
│ └── mysvc
│ ├── src
│ └── main
│ │ ├── resources
│ │ └── application.properties
│ │ └── java
│ │ └── msvcdojo
│ │ ├── ContactController.java
│ │ ├── MysvcApplication.java
│ │ ├── Contact.java
│ │ ├── NestedContentResource.java
│ │ ├── IndexController.java
│ │ ├── Account.java
│ │ ├── AccountResourceAssembler.java
│ │ ├── ContactResourceAssembler.java
│ │ └── AccountController.java
│ ├── build
│ └── generated-snippets
│ │ ├── get-index-example
│ │ ├── curl-request.adoc
│ │ ├── http-request.adoc
│ │ ├── response-fields.adoc
│ │ ├── links.adoc
│ │ └── http-response.adoc
│ │ ├── get-account-example
│ │ ├── curl-request.adoc
│ │ ├── http-request.adoc
│ │ ├── response-fields.adoc
│ │ └── http-response.adoc
│ │ ├── get-accounts-example
│ │ ├── curl-request.adoc
│ │ ├── http-request.adoc
│ │ ├── response-fields.adoc
│ │ └── http-response.adoc
│ │ ├── get-accounts-simple-doc
│ │ ├── curl-request.adoc
│ │ ├── http-request.adoc
│ │ └── http-response.adoc
│ │ └── get-contact-example
│ │ ├── curl-request.adoc
│ │ ├── http-request.adoc
│ │ ├── response-fields.adoc
│ │ └── http-response.adoc
│ ├── docker
│ └── Dockerfile.template
│ └── build.gradle
├── dev-environment
├── Gemfile
├── container_templates
│ ├── mongo.erb.yml
│ ├── config-service.erb.yml
│ ├── mysql.yml
│ ├── eureka-service.erb.yml
│ ├── gateway-service.erb.yml
│ ├── hystrix-service.erb.yml
│ ├── profiles-service.erb.yml
│ ├── accounts-service.erb.yml
│ └── scripts
│ │ └── environment.rake
└── Gemfile.lock
├── kata-web-client
├── solution
│ └── angular2-quickstart
│ │ ├── app
│ │ ├── home
│ │ │ ├── home.html
│ │ │ └── home.ts
│ │ ├── page2
│ │ │ ├── page2.component.css
│ │ │ ├── page2.component.html
│ │ │ └── page2.component.ts
│ │ ├── boot.ts
│ │ ├── page1
│ │ │ └── page1.component.ts
│ │ ├── services
│ │ │ └── data.service.ts
│ │ └── app.component.ts
│ │ ├── README.md
│ │ ├── tsconfig.json
│ │ ├── package.json
│ │ ├── characters.json
│ │ └── index.html
└── start
│ └── angular2-quickstart
│ ├── app
│ ├── home
│ │ ├── home.html
│ │ └── home.ts
│ ├── page2
│ │ ├── page2.component.css
│ │ ├── page2.component.html
│ │ └── page2.component.ts
│ ├── boot.ts
│ ├── page1
│ │ └── page1.component.ts
│ ├── services
│ │ └── data.service.ts
│ └── app.component.ts
│ ├── README.md
│ ├── tsconfig.json
│ ├── package.json
│ ├── characters.json
│ └── index.html
├── kata3
├── start
│ └── accounts-service
│ │ ├── settings.gradle
│ │ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ ├── bootstrap.yml
│ │ │ └── application.yml
│ │ │ └── java
│ │ │ └── msvcdojo
│ │ │ └── AccountsServiceApplication.java
│ │ ├── docker
│ │ └── Dockerfile.template
│ │ ├── build.gradle
│ │ └── gradlew.bat
├── solution1
│ └── accounts-service
│ │ ├── settings.gradle
│ │ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ ├── bootstrap.yml
│ │ │ ├── db
│ │ │ │ └── migration
│ │ │ │ │ └── V1__init.sql
│ │ │ └── application.yml
│ │ │ └── java
│ │ │ └── msvcdojo
│ │ │ └── AccountsServiceApplication.java
│ │ ├── docker
│ │ └── Dockerfile.template
│ │ └── build.gradle
└── solution2
│ └── accounts-service
│ ├── settings.gradle
│ ├── src
│ ├── main
│ │ ├── resources
│ │ │ ├── bootstrap.yml
│ │ │ ├── db
│ │ │ │ └── migration
│ │ │ │ │ ├── V2__add_role.sql
│ │ │ │ │ └── V1__init.sql
│ │ │ └── application.yml
│ │ └── java
│ │ │ └── msvcdojo
│ │ │ └── AccountsServiceApplication.java
│ └── test
│ │ └── java
│ │ └── msvcdojo
│ │ └── AccountsServiceApplicationTests.java
│ ├── docker
│ └── Dockerfile.template
│ └── build.gradle
├── kata6
├── start
│ ├── accounts-service
│ │ ├── settings.gradle
│ │ ├── src
│ │ │ └── main
│ │ │ │ ├── resources
│ │ │ │ ├── db
│ │ │ │ │ └── migration
│ │ │ │ │ │ ├── V2__add_role.sql
│ │ │ │ │ │ └── V1__init.sql
│ │ │ │ └── bootstrap.yml
│ │ │ │ └── java
│ │ │ │ └── msvcdojo
│ │ │ │ └── AccountsServiceApplication.java
│ │ ├── docker
│ │ │ └── Dockerfile.template
│ │ ├── build.gradle
│ │ └── gradlew.bat
│ └── profiles-service
│ │ ├── settings.gradle
│ │ ├── src
│ │ └── main
│ │ │ └── resources
│ │ │ └── bootstrap.yml
│ │ ├── docker
│ │ └── Dockerfile.template
│ │ ├── build.gradle
│ │ └── gradlew.bat
├── solution1
│ ├── accounts-service
│ │ ├── settings.gradle
│ │ ├── gradle
│ │ │ └── wrapper
│ │ │ │ ├── gradle-wrapper.jar
│ │ │ │ └── gradle-wrapper.properties
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── resources
│ │ │ │ ├── db
│ │ │ │ └── migration
│ │ │ │ │ ├── V2__add_role.sql
│ │ │ │ │ └── V1__init.sql
│ │ │ │ └── bootstrap.yml
│ │ └── docker
│ │ │ └── Dockerfile.template
│ ├── profiles-service
│ │ ├── settings.gradle
│ │ ├── gradle
│ │ │ └── wrapper
│ │ │ │ ├── gradle-wrapper.jar
│ │ │ │ └── gradle-wrapper.properties
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── resources
│ │ │ │ └── bootstrap.yml
│ │ ├── docker
│ │ │ └── Dockerfile.template
│ │ └── build.gradle
│ └── eureka-service
│ │ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ │ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ └── bootstrap.yml
│ │ │ └── java
│ │ │ └── msvcdojo
│ │ │ └── EurekaServiceApplication.java
│ │ ├── docker
│ │ └── Dockerfile.template
│ │ ├── build.gradle
│ │ └── gradlew.bat
└── solution2
│ ├── accounts-service
│ ├── src
│ │ └── main
│ │ │ └── resources
│ │ │ ├── application.yml
│ │ │ ├── db
│ │ │ └── migration
│ │ │ │ ├── V2__add_role.sql
│ │ │ │ └── V1__init.sql
│ │ │ └── bootstrap.yml
│ └── docker
│ │ └── Dockerfile.template
│ ├── eureka-service
│ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ └── bootstrap.yml
│ │ │ └── java
│ │ │ └── msvcdojo
│ │ │ └── EurekaServiceApplication.java
│ ├── docker
│ │ └── Dockerfile.template
│ ├── build.gradle
│ └── gradlew.bat
│ └── profiles-service
│ ├── src
│ └── main
│ │ └── resources
│ │ └── bootstrap.yml
│ ├── docker
│ └── Dockerfile.template
│ └── build.gradle
├── kata7
├── start
│ └── accounts-service
│ │ ├── settings.gradle
│ │ ├── src
│ │ └── main
│ │ │ └── resources
│ │ │ ├── db
│ │ │ └── migration
│ │ │ │ ├── V2__add_role.sql
│ │ │ │ └── V1__init.sql
│ │ │ └── bootstrap.yml
│ │ └── docker
│ │ └── Dockerfile.template
└── solution
│ ├── accounts-service
│ ├── settings.gradle
│ ├── src
│ │ └── main
│ │ │ └── resources
│ │ │ ├── db
│ │ │ └── migration
│ │ │ │ ├── V2__add_role.sql
│ │ │ │ └── V1__init.sql
│ │ │ └── bootstrap.yml
│ ├── docker
│ │ └── Dockerfile.template
│ └── gradlew.bat
│ └── hystrix-service
│ ├── settings.gradle
│ ├── src
│ └── main
│ │ ├── resources
│ │ └── bootstrap.yml
│ │ └── java
│ │ └── doge
│ │ └── HystrixApplication.java
│ ├── docker
│ └── Dockerfile.template
│ └── build.gradle
├── guides
└── src
│ ├── misc
│ └── macros.adoc
│ ├── images
│ └── dojo.jpg
│ ├── kata-elk
│ ├── kibana.png
│ ├── Logging_ELK.png
│ └── kibana_add_index.png
│ ├── kata-mesos
│ ├── mesos.png
│ └── marathon.png
│ ├── kata6
│ ├── eureka-dashboard.png
│ └── eureka-dashboard-with-service.png
│ ├── kata-swagger
│ └── swagger-ui.jpg
│ ├── kata7
│ ├── hystrix_dashboard.png
│ ├── hystrix_dashboard_stream.png
│ ├── hystrix_dashboard_stream_error.png
│ ├── hystrix_dashboard_stream_error_open.png
│ └── circuit_breakers.adoc
│ ├── kata-spring-restdocs
│ └── images
│ │ └── rest-maturity-model.png
│ ├── environment
│ ├── git.adoc
│ ├── intellij.adoc
│ ├── gradle.adoc
│ ├── curl.adoc
│ ├── ruby.adoc
│ └── environment.adoc
│ ├── header.adoc
│ ├── kata4
│ └── env.json
│ └── kata-web-client
│ └── web-client-basics.adoc
├── kata-mesos
└── solution1
│ ├── Gemfile
│ ├── container_templates
│ ├── zookeeper.yml
│ ├── scripts
│ │ └── mesos.rake
│ ├── mesos_marathon.erb.yml
│ ├── mesos_master.erb.yml
│ └── mesos_slave.erb.yml
│ ├── Gemfile.lock
│ └── hello.json
├── kata-swagger
├── start
│ └── accounts-service
│ │ ├── settings.gradle
│ │ ├── src
│ │ └── main
│ │ │ └── resources
│ │ │ └── application.yml
│ │ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ │ ├── docker
│ │ └── Dockerfile.template
│ │ └── build.gradle
└── solution
│ └── accounts-service
│ ├── settings.gradle
│ ├── src
│ └── main
│ │ └── resources
│ │ └── application.yml
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── docker
│ └── Dockerfile.template
│ └── build.gradle
├── kata4
├── solution2
│ ├── config-service
│ │ ├── settings.gradle
│ │ ├── src
│ │ │ └── main
│ │ │ │ ├── resources
│ │ │ │ ├── bootstrap.yml
│ │ │ │ ├── application-native.yml
│ │ │ │ └── application.yml
│ │ │ │ └── java
│ │ │ │ └── msvcdojo
│ │ │ │ └── ConfigurationServerApplication.java
│ │ ├── gradle
│ │ │ └── wrapper
│ │ │ │ ├── gradle-wrapper.jar
│ │ │ │ └── gradle-wrapper.properties
│ │ ├── config
│ │ │ └── my-service.yml
│ │ ├── docker
│ │ │ └── Dockerfile.template
│ │ ├── build.gradle
│ │ └── gradlew.bat
│ └── mysvc
│ │ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ └── bootstrap.yml
│ │ │ └── java
│ │ │ └── msvcdojo
│ │ │ └── MysvcApplication.java
│ │ ├── build.gradle
│ │ └── gradlew.bat
├── start
│ └── mysvc
│ │ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ └── application.yml
│ │ │ └── java
│ │ │ └── msvcdojo
│ │ │ └── MysvcApplication.java
│ │ ├── build.gradle
│ │ └── gradlew.bat
└── solution1
│ └── mysvc
│ ├── src
│ └── main
│ │ ├── resources
│ │ └── application.yml
│ │ └── java
│ │ └── msvcdojo
│ │ └── MysvcApplication.java
│ ├── build.gradle
│ └── gradlew.bat
├── kata5
├── start
│ └── profiles-service
│ │ ├── settings.gradle
│ │ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ └── bootstrap.yml
│ │ │ └── java
│ │ │ └── msvcdojo
│ │ │ └── ProfilesServiceApplication.java
│ │ ├── docker
│ │ └── Dockerfile.template
│ │ ├── build.gradle
│ │ └── gradlew.bat
└── solution
│ └── profiles-service
│ ├── settings.gradle
│ ├── src
│ └── main
│ │ └── resources
│ │ └── bootstrap.yml
│ ├── docker
│ └── Dockerfile.template
│ ├── build.gradle
│ └── gradlew.bat
├── kata8
└── solution1
│ └── gateway-service
│ ├── settings.gradle
│ ├── src
│ └── main
│ │ ├── resources
│ │ └── bootstrap.yml
│ │ └── java
│ │ └── msvcdojo
│ │ └── GatewayServiceApplication.java
│ ├── docker
│ └── Dockerfile.template
│ └── build.gradle
├── misc
├── dojo.jpg
└── face.png
├── kata2
├── solution
│ └── mysvc
│ │ ├── gradle.properties
│ │ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ └── application.yml
│ │ │ └── java
│ │ │ └── msvcdojo
│ │ │ └── MysvcApplication.java
│ │ ├── docker
│ │ └── Dockerfile.template
│ │ ├── build.gradle
│ │ └── gradlew.bat
└── start
│ └── mysvc
│ ├── src
│ └── main
│ │ ├── resources
│ │ └── application.yml
│ │ └── java
│ │ └── msvcdojo
│ │ └── MysvcApplication.java
│ ├── build.gradle
│ └── gradlew.bat
├── kata-elk
├── container_templates
│ ├── zookeeper.yml
│ ├── elasticSearchData.yml
│ ├── logData.yml
│ ├── elasticsearch.yml
│ ├── kibana.erb.yml
│ ├── fileBeat.erb.yml
│ ├── logstash.erb.yml
│ └── scripts
│ │ └── elk.rake
├── logstash
│ ├── Dockerfile
│ ├── docker-entrypoint.sh
│ └── logstash.conf
├── Gemfile
├── filebeat
│ ├── docker-entrypoint.sh
│ └── Dockerfile
├── baseos
│ └── Dockerfile
└── Gemfile.lock
├── README.md
├── kata1
└── solution
│ └── mysvc
│ ├── src
│ ├── main
│ │ ├── resources
│ │ │ └── application.yml
│ │ └── java
│ │ │ └── msvcdojo
│ │ │ └── MysvcApplication.java
│ └── test
│ │ └── java
│ │ └── msvcdojo
│ │ ├── HomeControllerTest.java
│ │ └── HomeControllerIT.java
│ ├── build.gradle
│ └── gradlew.bat
├── .gitignore
└── LICENSE
/kata-spring-restdocs/solution/mysvc/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/dev-environment/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 |
3 | gem 'docker_rack'
4 |
--------------------------------------------------------------------------------
/kata-web-client/solution/angular2-quickstart/app/home/home.html:
--------------------------------------------------------------------------------
1 |
Hello, Web!
2 |
--------------------------------------------------------------------------------
/kata-web-client/start/angular2-quickstart/app/home/home.html:
--------------------------------------------------------------------------------
1 | Hello, Web!
2 |
--------------------------------------------------------------------------------
/kata3/start/accounts-service/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'accounts-service'
2 |
--------------------------------------------------------------------------------
/kata6/start/accounts-service/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'accounts-service'
2 |
--------------------------------------------------------------------------------
/kata7/start/accounts-service/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'accounts-service'
2 |
--------------------------------------------------------------------------------
/guides/src/misc/macros.adoc:
--------------------------------------------------------------------------------
1 | :linkattrs:
2 |
3 | ifndef::java_version[:java_version: 1.8]
4 |
--------------------------------------------------------------------------------
/kata-mesos/solution1/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 |
3 | gem 'docker_rack'
4 |
--------------------------------------------------------------------------------
/kata-swagger/start/accounts-service/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'accounts-service'
2 |
--------------------------------------------------------------------------------
/kata3/solution1/accounts-service/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'accounts-service'
2 |
--------------------------------------------------------------------------------
/kata3/solution2/accounts-service/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'accounts-service'
2 |
--------------------------------------------------------------------------------
/kata4/solution2/config-service/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'config-service'
2 |
3 |
--------------------------------------------------------------------------------
/kata5/start/profiles-service/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'profiles-service'
2 |
3 |
--------------------------------------------------------------------------------
/kata6/solution1/accounts-service/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'accounts-service'
2 |
--------------------------------------------------------------------------------
/kata6/start/profiles-service/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'profiles-service'
2 |
3 |
--------------------------------------------------------------------------------
/kata7/solution/accounts-service/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'accounts-service'
2 |
--------------------------------------------------------------------------------
/kata7/solution/hystrix-service/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'hystrix-service'
2 |
3 |
--------------------------------------------------------------------------------
/kata8/solution1/gateway-service/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'gateway-service'
2 |
3 |
--------------------------------------------------------------------------------
/misc/dojo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/misc/dojo.jpg
--------------------------------------------------------------------------------
/misc/face.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/misc/face.png
--------------------------------------------------------------------------------
/kata-swagger/solution/accounts-service/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'accounts-service'
2 |
--------------------------------------------------------------------------------
/kata5/solution/profiles-service/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'profiles-service'
2 |
3 |
--------------------------------------------------------------------------------
/kata6/solution1/profiles-service/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'profiles-service'
2 |
3 |
--------------------------------------------------------------------------------
/guides/src/images/dojo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/guides/src/images/dojo.jpg
--------------------------------------------------------------------------------
/kata3/start/accounts-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: accounts-service
4 |
--------------------------------------------------------------------------------
/kata4/solution2/config-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: config-service
4 |
--------------------------------------------------------------------------------
/guides/src/kata-elk/kibana.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/guides/src/kata-elk/kibana.png
--------------------------------------------------------------------------------
/guides/src/kata-mesos/mesos.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/guides/src/kata-mesos/mesos.png
--------------------------------------------------------------------------------
/kata2/solution/mysvc/gradle.properties:
--------------------------------------------------------------------------------
1 | Group = msvcdojo
2 | Name = mysvc
3 | Version = 0.0.1
4 | SourceCompatibility = 1.8
5 |
--------------------------------------------------------------------------------
/kata3/solution1/accounts-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: accounts-service
4 |
--------------------------------------------------------------------------------
/kata3/solution2/accounts-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: accounts-service
4 |
--------------------------------------------------------------------------------
/guides/src/kata-mesos/marathon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/guides/src/kata-mesos/marathon.png
--------------------------------------------------------------------------------
/kata-elk/container_templates/zookeeper.yml:
--------------------------------------------------------------------------------
1 | zookeeper:
2 | image: zookeeper
3 | container_name: zk
4 | ports:
5 | - 2181
--------------------------------------------------------------------------------
/guides/src/kata-elk/Logging_ELK.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/guides/src/kata-elk/Logging_ELK.png
--------------------------------------------------------------------------------
/guides/src/kata6/eureka-dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/guides/src/kata6/eureka-dashboard.png
--------------------------------------------------------------------------------
/guides/src/kata-swagger/swagger-ui.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/guides/src/kata-swagger/swagger-ui.jpg
--------------------------------------------------------------------------------
/guides/src/kata7/hystrix_dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/guides/src/kata7/hystrix_dashboard.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Micro-services Dojo
2 |
3 | All the information can be found on the new [Home Page](http://accordance.github.io/microservice-dojo/).
--------------------------------------------------------------------------------
/guides/src/kata-elk/kibana_add_index.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/guides/src/kata-elk/kibana_add_index.png
--------------------------------------------------------------------------------
/kata3/start/accounts-service/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8100
3 |
4 | endpoints:
5 | shutdown:
6 | enabled: true
7 |
--------------------------------------------------------------------------------
/guides/src/kata7/hystrix_dashboard_stream.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/guides/src/kata7/hystrix_dashboard_stream.png
--------------------------------------------------------------------------------
/guides/src/kata6/eureka-dashboard-with-service.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/guides/src/kata6/eureka-dashboard-with-service.png
--------------------------------------------------------------------------------
/guides/src/kata7/hystrix_dashboard_stream_error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/guides/src/kata7/hystrix_dashboard_stream_error.png
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-index-example/curl-request.adoc:
--------------------------------------------------------------------------------
1 | [source,bash]
2 | ----
3 | $ curl 'http://localhost:8080/' -i
4 | ----
--------------------------------------------------------------------------------
/kata-elk/container_templates/elasticSearchData.yml:
--------------------------------------------------------------------------------
1 | elasticSearchData:
2 | image: busybox
3 | command: true
4 | volumes:
5 | - /usr/share/elasticsearch/data
6 |
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-index-example/http-request.adoc:
--------------------------------------------------------------------------------
1 | [source,http]
2 | ----
3 | GET / HTTP/1.1
4 | Host: localhost
5 |
6 | ----
--------------------------------------------------------------------------------
/kata4/solution2/mysvc/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: my-service
4 | cloud:
5 | config:
6 | uri: http://localhost:8888
--------------------------------------------------------------------------------
/dev-environment/container_templates/mongo.erb.yml:
--------------------------------------------------------------------------------
1 | demo-mongo:
2 | image: mongo:2.2.7
3 | ports:
4 | - 27017
5 | checks:
6 | - port: 27017
7 | retry: 10
8 |
--------------------------------------------------------------------------------
/guides/src/kata7/hystrix_dashboard_stream_error_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/guides/src/kata7/hystrix_dashboard_stream_error_open.png
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-account-example/curl-request.adoc:
--------------------------------------------------------------------------------
1 | [source,bash]
2 | ----
3 | $ curl 'http://localhost:8080/accounts/1' -i
4 | ----
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-accounts-example/curl-request.adoc:
--------------------------------------------------------------------------------
1 | [source,bash]
2 | ----
3 | $ curl 'http://localhost:8080/accounts' -i
4 | ----
--------------------------------------------------------------------------------
/kata2/start/mysvc/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8100
3 |
4 | endpoints:
5 | health:
6 | sensitive: false
7 | shutdown:
8 | enabled: true
9 |
--------------------------------------------------------------------------------
/kata4/start/mysvc/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8100
3 |
4 | endpoints:
5 | health:
6 | sensitive: false
7 | shutdown:
8 | enabled: true
9 |
--------------------------------------------------------------------------------
/kata-elk/container_templates/logData.yml:
--------------------------------------------------------------------------------
1 | logData:
2 | image: busybox
3 | command: /bin/sh -c 'mkdir -p /log/app'
4 | name: logData2
5 | volumes:
6 | - /log/app
7 |
8 |
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-account-example/http-request.adoc:
--------------------------------------------------------------------------------
1 | [source,http]
2 | ----
3 | GET /accounts/1 HTTP/1.1
4 | Host: localhost
5 |
6 | ----
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-accounts-example/http-request.adoc:
--------------------------------------------------------------------------------
1 | [source,http]
2 | ----
3 | GET /accounts HTTP/1.1
4 | Host: localhost
5 |
6 | ----
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-accounts-simple-doc/curl-request.adoc:
--------------------------------------------------------------------------------
1 | [source,bash]
2 | ----
3 | $ curl 'http://localhost:8080/accounts' -i
4 | ----
--------------------------------------------------------------------------------
/kata1/solution/mysvc/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8100
3 |
4 | endpoints:
5 | health:
6 | sensitive: false
7 | shutdown:
8 | enabled: true
9 |
--------------------------------------------------------------------------------
/kata2/solution/mysvc/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8100
3 |
4 | endpoints:
5 | health:
6 | sensitive: false
7 | shutdown:
8 | enabled: true
9 |
--------------------------------------------------------------------------------
/guides/src/kata-spring-restdocs/images/rest-maturity-model.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/guides/src/kata-spring-restdocs/images/rest-maturity-model.png
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-accounts-simple-doc/http-request.adoc:
--------------------------------------------------------------------------------
1 | [source,http]
2 | ----
3 | GET /accounts HTTP/1.1
4 | Host: localhost
5 |
6 | ----
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-contact-example/curl-request.adoc:
--------------------------------------------------------------------------------
1 | [source,bash]
2 | ----
3 | $ curl 'http://localhost:8080/accounts/1/contacts' -i
4 | ----
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-contact-example/http-request.adoc:
--------------------------------------------------------------------------------
1 | [source,http]
2 | ----
3 | GET /accounts/1/contacts HTTP/1.1
4 | Host: localhost
5 |
6 | ----
--------------------------------------------------------------------------------
/kata4/solution2/config-service/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/kata4/solution2/config-service/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/kata6/solution1/eureka-service/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/kata6/solution1/eureka-service/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/kata6/solution2/accounts-service/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | # tag::feign-logging[]
2 | logging:
3 | level:
4 | msvcdojo.ProfilesServiceProxy: DEBUG
5 | # tag::feign-logging[]
6 |
--------------------------------------------------------------------------------
/kata-swagger/start/accounts-service/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8100
3 |
4 | endpoints:
5 | health:
6 | sensitive: false
7 | shutdown:
8 | enabled: true
9 |
--------------------------------------------------------------------------------
/kata6/solution1/accounts-service/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/kata6/solution1/accounts-service/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/kata6/solution1/profiles-service/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/kata6/solution1/profiles-service/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/kata-swagger/solution/accounts-service/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8100
3 |
4 | endpoints:
5 | health:
6 | sensitive: false
7 | shutdown:
8 | enabled: true
9 |
--------------------------------------------------------------------------------
/kata-swagger/start/accounts-service/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/kata-swagger/start/accounts-service/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/kata6/start/accounts-service/src/main/resources/db/migration/V2__add_role.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE account
2 | ADD role varchar(255);
3 |
4 | UPDATE account SET role = 'admin'
5 | WHERE username = 'john';
6 |
--------------------------------------------------------------------------------
/kata7/solution/accounts-service/src/main/resources/db/migration/V2__add_role.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE account
2 | ADD role varchar(255);
3 |
4 | UPDATE account SET role = 'admin'
5 | WHERE username = 'john';
6 |
--------------------------------------------------------------------------------
/kata7/start/accounts-service/src/main/resources/db/migration/V2__add_role.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE account
2 | ADD role varchar(255);
3 |
4 | UPDATE account SET role = 'admin'
5 | WHERE username = 'john';
6 |
--------------------------------------------------------------------------------
/kata-swagger/solution/accounts-service/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accordance/microservice-dojo/HEAD/kata-swagger/solution/accounts-service/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/kata3/solution2/accounts-service/src/main/resources/db/migration/V2__add_role.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE account
2 | ADD role varchar(255);
3 |
4 | UPDATE account SET role = 'admin'
5 | WHERE username = 'john';
6 |
--------------------------------------------------------------------------------
/kata5/start/profiles-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: profiles-service
4 | cloud:
5 | config:
6 | uri: ${config-service.uri:http://localhost:8888}
--------------------------------------------------------------------------------
/kata6/solution1/accounts-service/src/main/resources/db/migration/V2__add_role.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE account
2 | ADD role varchar(255);
3 |
4 | UPDATE account SET role = 'admin'
5 | WHERE username = 'john';
6 |
--------------------------------------------------------------------------------
/kata6/solution1/eureka-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: eureka-service
4 | cloud:
5 | config:
6 | uri: ${config-service.uri:http://localhost:8888}
--------------------------------------------------------------------------------
/kata6/solution2/accounts-service/src/main/resources/db/migration/V2__add_role.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE account
2 | ADD role varchar(255);
3 |
4 | UPDATE account SET role = 'admin'
5 | WHERE username = 'john';
6 |
--------------------------------------------------------------------------------
/kata6/solution2/eureka-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: eureka-service
4 | cloud:
5 | config:
6 | uri: ${config-service.uri:http://localhost:8888}
--------------------------------------------------------------------------------
/kata6/start/profiles-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: profiles-service
4 | cloud:
5 | config:
6 | uri: ${config-service.uri:http://localhost:8888}
--------------------------------------------------------------------------------
/kata7/solution/hystrix-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: hystrix-service
4 | cloud:
5 | config:
6 | uri: ${config-service.uri:http://localhost:8888}
--------------------------------------------------------------------------------
/kata-elk/container_templates/elasticsearch.yml:
--------------------------------------------------------------------------------
1 | elasticsearch:
2 | image: elasticsearch:2.1.1
3 | volumes_from:
4 | - elasticSearchData
5 | ports:
6 | - 9200:9200
7 | depends:
8 | - logstash
9 |
--------------------------------------------------------------------------------
/kata5/solution/profiles-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: profiles-service
4 | cloud:
5 | config:
6 | uri: ${config-service.uri:http://localhost:8888}
--------------------------------------------------------------------------------
/kata6/solution1/profiles-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: profiles-service
4 | cloud:
5 | config:
6 | uri: ${config-service.uri:http://localhost:8888}
--------------------------------------------------------------------------------
/kata6/solution2/profiles-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: profiles-service
4 | cloud:
5 | config:
6 | uri: ${config-service.uri:http://localhost:8888}
--------------------------------------------------------------------------------
/kata6/start/accounts-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: accounts-service
4 | cloud:
5 | config:
6 | uri: ${config-service.uri:http://localhost:8888}
7 |
--------------------------------------------------------------------------------
/kata7/start/accounts-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: accounts-service
4 | cloud:
5 | config:
6 | uri: ${config-service.uri:http://localhost:8888}
7 |
--------------------------------------------------------------------------------
/kata8/solution1/gateway-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: gateway-service
4 | cloud:
5 | config:
6 | uri: ${config-service.uri:http://localhost:8888}
7 |
--------------------------------------------------------------------------------
/kata4/solution2/config-service/config/my-service.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: ${PORT:8100}
3 |
4 | name: World
5 |
6 | endpoints:
7 | health:
8 | sensitive: false
9 | shutdown:
10 | enabled: true
11 |
--------------------------------------------------------------------------------
/kata6/solution1/accounts-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: accounts-service
4 | cloud:
5 | config:
6 | uri: ${config-service.uri:http://localhost:8888}
7 |
--------------------------------------------------------------------------------
/kata6/solution2/accounts-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: accounts-service
4 | cloud:
5 | config:
6 | uri: ${config-service.uri:http://localhost:8888}
7 |
--------------------------------------------------------------------------------
/kata7/solution/accounts-service/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: accounts-service
4 | cloud:
5 | config:
6 | uri: ${config-service.uri:http://localhost:8888}
7 |
--------------------------------------------------------------------------------
/kata-elk/container_templates/kibana.erb.yml:
--------------------------------------------------------------------------------
1 | kibana:
2 | image: kibana:4.3.1
3 | ports:
4 | - 5601
5 | environment:
6 | ELASTICSEARCH_URL: http://<%= dockerhost %>:9200
7 | depends:
8 | - elasticsearch
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-index-example/response-fields.adoc:
--------------------------------------------------------------------------------
1 | |===
2 | |Path|Type|Description
3 |
4 | |_links
5 | |Object
6 | |<> to other resources
7 |
8 | |===
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-contact-example/response-fields.adoc:
--------------------------------------------------------------------------------
1 | |===
2 | |Path|Type|Description
3 |
4 | |_embedded.contactList
5 | |Array
6 | |An array of <>
7 |
8 | |===
--------------------------------------------------------------------------------
/guides/src/environment/git.adoc:
--------------------------------------------------------------------------------
1 |
2 | [[git]]
3 | == Git
4 |
5 | Your machine should be configured with Git access.
6 | You can install Git from here: https://git-scm.com/downloads
7 |
8 | NOTE: On Windows configure Git to commit with Linux line endings
9 |
--------------------------------------------------------------------------------
/kata-elk/logstash/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM logstash:2.1.1
2 | COPY logstash.conf /logstash.conf
3 | RUN chmod -v 754 /logstash.conf
4 | COPY docker-entrypoint.sh /docker-entrypoint.sh
5 | RUN chmod -v 754 /docker-entrypoint.sh
6 | ENTRYPOINT ["/docker-entrypoint.sh"]
7 |
--------------------------------------------------------------------------------
/kata-web-client/solution/angular2-quickstart/app/page2/page2.component.css:
--------------------------------------------------------------------------------
1 | .characters {list-style-type: none; margin-left: 1em; padding: 0; width: 14em;}
2 | .characters li { cursor: pointer; }
3 | .characters li:hover {color: #369; background-color: #EEE; }
4 |
--------------------------------------------------------------------------------
/kata-web-client/start/angular2-quickstart/app/page2/page2.component.css:
--------------------------------------------------------------------------------
1 | .characters {list-style-type: none; margin-left: 1em; padding: 0; width: 14em;}
2 | .characters li { cursor: pointer; }
3 | .characters li:hover {color: #369; background-color: #EEE; }
4 |
--------------------------------------------------------------------------------
/kata6/start/accounts-service/src/main/resources/db/migration/V1__init.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE account (
2 | id BIGINT NOT NULL AUTO_INCREMENT,
3 | username varchar(255) NOT NULL,
4 | PRIMARY KEY (id)
5 | );
6 |
7 | INSERT INTO account (username) VALUES ('john');
8 |
--------------------------------------------------------------------------------
/kata7/start/accounts-service/src/main/resources/db/migration/V1__init.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE account (
2 | id BIGINT NOT NULL AUTO_INCREMENT,
3 | username varchar(255) NOT NULL,
4 | PRIMARY KEY (id)
5 | );
6 |
7 | INSERT INTO account (username) VALUES ('john');
8 |
--------------------------------------------------------------------------------
/guides/src/environment/intellij.adoc:
--------------------------------------------------------------------------------
1 |
2 | [[intellij]]
3 | == IntelliJ
4 |
5 | All of the code is tested to work with the IntelliJ Community Edition.
6 |
7 | You can download and install it for free from here: https://www.jetbrains.com/idea/download/#section=windows
8 |
--------------------------------------------------------------------------------
/kata-elk/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 |
3 | gem 'rspec'
4 | gem 'rake'
5 | gem 'bundler'
6 | gem 'rubocop'
7 | gem 'multi_json' #, "~> 1.8"
8 | # gem 'docker-api', '~> 1.15', :require => 'docker'
9 | gem "orientdb4r"
10 | gem 'mongo', '~> 2.0'
11 |
--------------------------------------------------------------------------------
/kata3/solution1/accounts-service/src/main/resources/db/migration/V1__init.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE account (
2 | id BIGINT NOT NULL AUTO_INCREMENT,
3 | username varchar(255) NOT NULL,
4 | PRIMARY KEY (id)
5 | );
6 |
7 | INSERT INTO account (username) VALUES ('john');
8 |
--------------------------------------------------------------------------------
/kata3/solution2/accounts-service/src/main/resources/db/migration/V1__init.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE account (
2 | id BIGINT NOT NULL AUTO_INCREMENT,
3 | username varchar(255) NOT NULL,
4 | PRIMARY KEY (id)
5 | );
6 |
7 | INSERT INTO account (username) VALUES ('john');
8 |
--------------------------------------------------------------------------------
/kata6/solution1/accounts-service/src/main/resources/db/migration/V1__init.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE account (
2 | id BIGINT NOT NULL AUTO_INCREMENT,
3 | username varchar(255) NOT NULL,
4 | PRIMARY KEY (id)
5 | );
6 |
7 | INSERT INTO account (username) VALUES ('john');
8 |
--------------------------------------------------------------------------------
/kata6/solution2/accounts-service/src/main/resources/db/migration/V1__init.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE account (
2 | id BIGINT NOT NULL AUTO_INCREMENT,
3 | username varchar(255) NOT NULL,
4 | PRIMARY KEY (id)
5 | );
6 |
7 | INSERT INTO account (username) VALUES ('john');
8 |
--------------------------------------------------------------------------------
/kata7/solution/accounts-service/src/main/resources/db/migration/V1__init.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE account (
2 | id BIGINT NOT NULL AUTO_INCREMENT,
3 | username varchar(255) NOT NULL,
4 | PRIMARY KEY (id)
5 | );
6 |
7 | INSERT INTO account (username) VALUES ('john');
8 |
--------------------------------------------------------------------------------
/kata-web-client/solution/angular2-quickstart/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started
2 |
3 | 1. `npm install`
4 | 1. Run the TypeScript compiler, watch for changes, start the server, and launch the browser `npm start`
5 |
6 | Note: inspired by https://github.com/johnpapa/angular2-go
7 |
--------------------------------------------------------------------------------
/kata-web-client/start/angular2-quickstart/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started
2 |
3 | 1. `npm install`
4 | 1. Run the TypeScript compiler, watch for changes, start the server, and launch the browser `npm start`
5 |
6 | Note: inspired by https://github.com/johnpapa/angular2-go
7 |
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-index-example/links.adoc:
--------------------------------------------------------------------------------
1 | |===
2 | |Relation|Description
3 |
4 | |accounts
5 | |The <>
6 |
7 | |contacts
8 | |The <>
9 |
10 | |===
--------------------------------------------------------------------------------
/kata-elk/filebeat/docker-entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | # Render config file
5 | cat filebeat.yml | sed "s/LOGSTASH_HOST/$LOGSTASH_HOST/" | sed "s/LOGSTASH_PORT/$LOGSTASH_PORT/" > filebeat.yml.tmp
6 | cat filebeat.yml.tmp > filebeat.yml
7 | rm filebeat.yml.tmp
8 | exec "$@"
9 |
--------------------------------------------------------------------------------
/kata-elk/logstash/docker-entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | # Render config file
5 | cat logstash.conf | sed "s/ELASTICSEARCH_HOST/$ELASTICSEARCH_HOST/" | sed "s/ELASTICSEARCH_PORT/$ELASTICSEARCH_PORT/" > logstash.tmp
6 | cat logstash.tmp > logstash.conf
7 | rm logstash.tmp
8 | exec "$@"
9 |
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-accounts-example/response-fields.adoc:
--------------------------------------------------------------------------------
1 | |===
2 | |Path|Type|Description
3 |
4 | |_links.self
5 | |Object
6 | |Resource Self Link
7 |
8 | |_embedded.accountList
9 | |Array
10 | |An array of <>
11 |
12 | |===
--------------------------------------------------------------------------------
/kata4/solution1/mysvc/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | # tag::config[]
2 | # tag::server.port[]
3 | server:
4 | port: ${PORT:8100}
5 | # end::server.port[]
6 |
7 | name: World
8 | # end::config[]
9 |
10 | endpoints:
11 | health:
12 | sensitive: false
13 | shutdown:
14 | enabled: true
15 |
--------------------------------------------------------------------------------
/kata-mesos/solution1/container_templates/zookeeper.yml:
--------------------------------------------------------------------------------
1 | zookeeper:
2 | image: jplock/zookeeper:3.4.6
3 | ports:
4 | - 2181
5 | - 2888
6 | - 3888
7 | checks:
8 | - port: 2181
9 |
10 | # docker inspect --format '{{ .NetworkSettings.IPAddress }}' zookeeper # use ip for following zk:// reqs
11 |
--------------------------------------------------------------------------------
/kata-web-client/start/angular2-quickstart/app/home/home.ts:
--------------------------------------------------------------------------------
1 | import {Component, View} from "angular2/core";
2 |
3 | @Component({
4 | selector: 'home'
5 | })
6 |
7 | @View({
8 | templateUrl: 'app/home/home.html'
9 | })
10 |
11 | export class HomeComponent {
12 | constructor() {
13 |
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/kata4/solution2/config-service/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Jan 21 12:48:22 EST 2016
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-all.zip
7 |
--------------------------------------------------------------------------------
/kata6/solution1/accounts-service/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Jan 21 12:22:14 EST 2016
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-all.zip
7 |
--------------------------------------------------------------------------------
/kata6/solution1/eureka-service/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Jan 21 12:59:01 EST 2016
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip
7 |
--------------------------------------------------------------------------------
/kata6/solution1/profiles-service/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Jan 16 17:08:04 EST 2016
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip
7 |
--------------------------------------------------------------------------------
/kata-mesos/solution1/container_templates/scripts/mesos.rake:
--------------------------------------------------------------------------------
1 | namespace :mesos do
2 | desc "Start Mesos Environment"
3 | task start: [ 'container:mesos_slave:start', 'container:mesos_marathon:start' ]
4 | desc "Stop Mesos Environment"
5 | task stop: [ 'container:mesos_marathon:stop', 'container:zookeeper:stop' ]
6 | end
7 |
--------------------------------------------------------------------------------
/kata-swagger/solution/accounts-service/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Jan 21 12:22:14 EST 2016
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-all.zip
7 |
--------------------------------------------------------------------------------
/kata-swagger/start/accounts-service/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Jan 21 12:22:14 EST 2016
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-all.zip
7 |
--------------------------------------------------------------------------------
/kata-web-client/solution/angular2-quickstart/app/home/home.ts:
--------------------------------------------------------------------------------
1 | import {Component, View} from "angular2/core";
2 |
3 | @Component({
4 | selector: 'home'
5 | })
6 |
7 | @View({
8 | templateUrl: 'app/home/home.html'
9 | })
10 |
11 | export class HomeComponent {
12 | constructor() {
13 |
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/dev-environment/container_templates/config-service.erb.yml:
--------------------------------------------------------------------------------
1 | config-service:
2 | image: msvcdojo/config-service:0.0.1
3 | ports:
4 | - 8888
5 | # log-driver: gelf
6 | # log-opt:
7 | # gelf-address: udp://<%= dockerhost %>:12201
8 | checks:
9 | - uri: http://<%= dockerhost %>:8888/health
10 | retry: 10
11 |
--------------------------------------------------------------------------------
/dev-environment/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | docker_rack (0.0.6)
5 | rake (~> 0)
6 | thor (~> 0.18, >= 0.18.0)
7 | rake (0.9.6)
8 | thor (0.19.1)
9 |
10 | PLATFORMS
11 | x86-mingw32
12 |
13 | DEPENDENCIES
14 | docker_rack
15 |
16 | BUNDLED WITH
17 | 1.10.6
18 |
--------------------------------------------------------------------------------
/kata-mesos/solution1/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | docker_rack (0.0.7)
5 | rake (~> 0)
6 | thor (~> 0.18, >= 0.18.0)
7 | rake (0.9.6)
8 | thor (0.19.1)
9 |
10 | PLATFORMS
11 | x86-mingw32
12 |
13 | DEPENDENCIES
14 | docker_rack
15 |
16 | BUNDLED WITH
17 | 1.10.6
18 |
--------------------------------------------------------------------------------
/kata2/solution/mysvc/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8100
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | # RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
8 |
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/src/main/java/msvcdojo/ContactController.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.springframework.web.bind.annotation.RequestMapping;
4 | import org.springframework.web.bind.annotation.RestController;
5 |
6 | @RestController
7 | @RequestMapping(value = "/contacts")
8 | public class ContactController {
9 | }
10 |
--------------------------------------------------------------------------------
/kata5/start/profiles-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8101
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | #RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
8 |
--------------------------------------------------------------------------------
/kata6/solution1/eureka-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8100
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | # RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
--------------------------------------------------------------------------------
/kata6/solution2/eureka-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8100
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | # RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
--------------------------------------------------------------------------------
/kata6/start/profiles-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8101
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | #RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
8 |
--------------------------------------------------------------------------------
/kata7/solution/hystrix-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8110
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | # RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8100
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | # RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
--------------------------------------------------------------------------------
/kata3/solution1/accounts-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8100
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | # RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
8 |
--------------------------------------------------------------------------------
/kata3/solution2/accounts-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8100
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | # RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
8 |
--------------------------------------------------------------------------------
/kata3/start/accounts-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8100
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | # RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
8 |
--------------------------------------------------------------------------------
/kata4/solution2/config-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8888
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | # RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
8 |
--------------------------------------------------------------------------------
/kata5/solution/profiles-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8101
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | #RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
8 |
--------------------------------------------------------------------------------
/kata6/solution1/accounts-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8100
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | # RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
8 |
--------------------------------------------------------------------------------
/kata6/solution1/profiles-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8101
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | #RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
8 |
--------------------------------------------------------------------------------
/kata6/solution2/accounts-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8100
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | # RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
8 |
--------------------------------------------------------------------------------
/kata6/solution2/profiles-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8101
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | #RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
8 |
--------------------------------------------------------------------------------
/kata6/start/accounts-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8100
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | # RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
8 |
--------------------------------------------------------------------------------
/kata7/solution/accounts-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8100
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | # RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
8 |
--------------------------------------------------------------------------------
/kata7/start/accounts-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8100
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | # RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
8 |
--------------------------------------------------------------------------------
/kata-swagger/start/accounts-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8100
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | # RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
8 |
--------------------------------------------------------------------------------
/kata-swagger/solution/accounts-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | EXPOSE 8100
5 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
6 | # RUN bash -c 'touch /${project.name}.jar'
7 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
8 |
--------------------------------------------------------------------------------
/dev-environment/container_templates/mysql.yml:
--------------------------------------------------------------------------------
1 | demo-mysql:
2 | image: mysql:5.6
3 | environment:
4 | SERVICE_ID: mysql-0
5 | ports:
6 | - 3306
7 | environment:
8 | MYSQL_ROOT_PASSWORD: password
9 | MYSQL_DATABASE: demo
10 | MYSQL_USER: demo_user
11 | MYSQL_PASSWORD: demo_pass
12 | checks:
13 | - port: 3306
14 | retry: 10
15 |
--------------------------------------------------------------------------------
/kata-elk/container_templates/fileBeat.erb.yml:
--------------------------------------------------------------------------------
1 | fileBeat:
2 | image: filebeat
3 | environment:
4 | TZ: UTC
5 | volumes_from:
6 | - logData
7 | volumes:
8 | - /conf:/conf
9 | command: /usr/bin/filebeat -e -v -c /filebeat.yml
10 | environment:
11 | LOGSTASH_HOST: <%= dockerhost %>
12 | LOGSTASH_PORT: 5044
13 |
--------------------------------------------------------------------------------
/kata8/solution1/gateway-service/docker/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | MAINTAINER Igor Moochnick "igor@igorshare.com"
3 | VOLUME /tmp
4 | VOLUME /public
5 | EXPOSE 8111
6 | ADD ${jar.baseName}-${jar.version}.jar ${project.name}.jar
7 | # RUN bash -c 'touch /${project.name}.jar'
8 | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom" ,"-jar", "/${project.name}.jar" ]
--------------------------------------------------------------------------------
/guides/src/header.adoc:
--------------------------------------------------------------------------------
1 | :toc: left
2 | :toclevels: 4
3 | // :linkcss:
4 | // :data-uri:
5 | // :icons:
6 | :experimental:
7 | // :toc: macro
8 | // :toc-title:
9 | :prewrap!:
10 | :icons: font
11 | :source-highlighter: coderay
12 | <<../index.adoc#,icon:home[] Home>> | https://github.com/Accordance/microservice-dojo/tree/master/{kata_dir}[icon:github[] Source for Kata]
13 |
--------------------------------------------------------------------------------
/dev-environment/container_templates/eureka-service.erb.yml:
--------------------------------------------------------------------------------
1 | eureka-service:
2 | image: msvcdojo/eureka-service:0.0.1
3 | ports:
4 | - 8761
5 | environment:
6 | config-service.uri: http://<%= dockerhost %>:8888
7 | checks:
8 | - port: 8761
9 | retry: 15
10 | - uri: http://<%= dockerhost %>:8761/eureka/apps
11 | depends:
12 | - config-service
13 |
--------------------------------------------------------------------------------
/kata-elk/baseos/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM centos:centos7
2 |
3 | RUN yum -y install wget \
4 | && wget -O jre.rpm --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u60-b27/jre-8u60-linux-x64.rpm \
5 | && yum -y localinstall jre.rpm \
6 | && rm jre.rpm \
7 | && yum -y install nmap
8 |
--------------------------------------------------------------------------------
/kata-elk/filebeat/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM baseos:latest
2 |
3 | RUN curl -L -O https://download.elastic.co/beats/filebeat/filebeat-1.1.0-x86_64.rpm \
4 | && rpm -vi filebeat-1.1.0-x86_64.rpm
5 | COPY filebeat.yml /filebeat.yml
6 | RUN chmod -v 754 /filebeat.yml
7 | COPY docker-entrypoint.sh /docker-entrypoint.sh
8 | RUN chmod -v 754 /docker-entrypoint.sh
9 | ENTRYPOINT ["/docker-entrypoint.sh"]
10 |
--------------------------------------------------------------------------------
/kata-web-client/solution/angular2-quickstart/app/page2/page2.component.html:
--------------------------------------------------------------------------------
1 | Select a Character
2 |
3 | -
4 | {{character.id}} {{character.name}}
5 |
6 |
7 |
8 | {{currentCharacter.name | uppercase}} is my character
9 |
10 |
--------------------------------------------------------------------------------
/kata-web-client/start/angular2-quickstart/app/page2/page2.component.html:
--------------------------------------------------------------------------------
1 | Select a Character
2 |
3 | -
4 | {{character.id}} {{character.name}}
5 |
6 |
7 |
8 | {{currentCharacter.name | uppercase}} is my character
9 |
10 |
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-account-example/response-fields.adoc:
--------------------------------------------------------------------------------
1 | |===
2 | |Path|Type|Description
3 |
4 | |id
5 | |Number
6 | |Account unique identifier
7 |
8 | |name
9 | |String
10 | |Account name
11 |
12 | |_links.self
13 | |Object
14 | |Account Resource Self Link
15 |
16 | |_links.account-contacts
17 | |Object
18 | |Contacts associated for given Account
19 |
20 | |===
--------------------------------------------------------------------------------
/kata-web-client/start/angular2-quickstart/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES5",
4 | "module": "system",
5 | "moduleResolution": "node",
6 | "sourceMap": true,
7 | "emitDecoratorMetadata": true,
8 | "experimentalDecorators": true,
9 | "removeComments": false,
10 | "noImplicitAny": false
11 | },
12 | "exclude": [
13 | "node_modules"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/guides/src/environment/gradle.adoc:
--------------------------------------------------------------------------------
1 |
2 | [[gradle]]
3 | == Gradle
4 |
5 | https://docs.gradle.org/current/userguide/installation.html[Gradle installation] instructions.
6 |
7 | === Gradle for Windows
8 |
9 | Install Gradle from https://gradle.org/gradle-download/[Gradle downloads^] page.
10 |
11 | For running Gradle, add GRADLE_HOME/bin to your PATH environment variable. Usually, this is sufficient to run Gradle.
12 |
--------------------------------------------------------------------------------
/kata-web-client/solution/angular2-quickstart/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES5",
4 | "module": "system",
5 | "moduleResolution": "node",
6 | "sourceMap": true,
7 | "emitDecoratorMetadata": true,
8 | "experimentalDecorators": true,
9 | "removeComments": false,
10 | "noImplicitAny": false
11 | },
12 | "exclude": [
13 | "node_modules"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-index-example/http-response.adoc:
--------------------------------------------------------------------------------
1 | [source,http]
2 | ----
3 | HTTP/1.1 200 OK
4 | Content-Type: application/hal+json
5 | Content-Length: 178
6 |
7 | {
8 | "_links" : {
9 | "accounts" : {
10 | "href" : "http://localhost:8080/accounts"
11 | },
12 | "contacts" : {
13 | "href" : "http://localhost:8080/contacts"
14 | }
15 | }
16 | }
17 | ----
--------------------------------------------------------------------------------
/kata-elk/container_templates/logstash.erb.yml:
--------------------------------------------------------------------------------
1 | logstash:
2 | image: logstash
3 | environment:
4 | TZ: UTC
5 | expose:
6 | - 12201
7 | - 5044
8 | ports:
9 | - "12201:12201"
10 | - "5044:5044"
11 | - "12201:12201/udp"
12 | command: logstash -f /logstash.conf
13 | environment:
14 | ELASTICSEARCH_HOST: <%= dockerhost %>
15 | ELASTICSEARCH_PORT: 9200
16 |
--------------------------------------------------------------------------------
/guides/src/environment/curl.adoc:
--------------------------------------------------------------------------------
1 |
2 | [[curl]]
3 | == Curl
4 |
5 | NOTE: This section is only for Windows users. Linux have Curl
6 | available out of the box.
7 |
8 | === Curl for Windows
9 |
10 | Navigate to https://curl.haxx.se/download.html[Curl Downloads^] and pick the,
11 | right for you, x32/x64 package and follow the instructions.
12 |
13 | === Curl for Mac
14 |
15 | Use `brew` to install curl
16 |
17 | ....
18 | $ brew install curl
19 | ....
20 |
--------------------------------------------------------------------------------
/kata3/solution1/accounts-service/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8100
3 |
4 | endpoints:
5 | shutdown:
6 | enabled: true
7 |
8 | # tag::jpa[]
9 | spring:
10 | jpa:
11 | database: MYSQL
12 | hibernate:
13 | ddl-auto: validate
14 |
15 | datasource:
16 | url: jdbc:mysql://dockerhost:3306/demo
17 | username: demo_user
18 | password: demo_pass
19 | driver-class-name: com.mysql.jdbc.Driver
20 | # end::jpa[]
--------------------------------------------------------------------------------
/kata3/solution2/accounts-service/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8100
3 |
4 | endpoints:
5 | shutdown:
6 | enabled: true
7 |
8 | # tag::jpa[]
9 | spring:
10 | jpa:
11 | database: MYSQL
12 | hibernate:
13 | ddl-auto: validate
14 |
15 | datasource:
16 | url: jdbc:mysql://dockerhost:3306/demo
17 | username: demo_user
18 | password: demo_pass
19 | driver-class-name: com.mysql.jdbc.Driver
20 | # end::jpa[]
--------------------------------------------------------------------------------
/dev-environment/container_templates/gateway-service.erb.yml:
--------------------------------------------------------------------------------
1 | gateway-service:
2 | image: msvcdojo/gateway-service:0.0.1
3 | ports:
4 | - 8111
5 | environment:
6 | config-service.uri: http://<%= dockerhost %>:8888
7 | service-registry.uri: http://<%= dockerhost %>:8761
8 | external.ip: <%= dockerhost %>
9 | checks:
10 | - uri: http://<%= dockerhost %>:8111/health
11 | retry: 15
12 | depends:
13 | - accounts-service
14 | - profiles-service
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.class
2 |
3 | # Mobile Tools for Java (J2ME)
4 | .mtj.tmp/
5 |
6 | # Package Files #
7 | *.jar
8 | *.war
9 | *.ear
10 |
11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
12 | hs_err_pid*
13 | **/bin/
14 | **/.idea/
15 | **/node-modules/
16 | **/gradle/
17 | **/.gradle/
18 | **/build/
19 | **/bower_components/
20 | **/lib/
21 | *.iml
22 | tmp/
23 | todo/
24 | done/
25 | microservice-dojo-configuration/
26 | guides/docs/
27 |
--------------------------------------------------------------------------------
/dev-environment/container_templates/hystrix-service.erb.yml:
--------------------------------------------------------------------------------
1 | hystrix-service:
2 | image: msvcdojo/hystrix-service:0.0.1
3 | ports:
4 | - 7980
5 | environment:
6 | config-service.uri: http://<%= dockerhost %>:8888
7 | service-registry.uri: http://<%= dockerhost %>:8761
8 | external.ip: <%= dockerhost %>
9 | checks:
10 | - uri: http://<%= dockerhost %>:7980/health
11 | retry: 15
12 | depends:
13 | - config-service
14 | - eureka-service
15 |
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-account-example/http-response.adoc:
--------------------------------------------------------------------------------
1 | [source,http]
2 | ----
3 | HTTP/1.1 200 OK
4 | Content-Type: application/json
5 | Content-Length: 228
6 |
7 | {
8 | "id" : 1,
9 | "name" : "John",
10 | "_links" : {
11 | "self" : {
12 | "href" : "http://localhost:8080/accounts/1"
13 | },
14 | "account-contacts" : {
15 | "href" : "http://localhost:8080/accounts/1/contacts"
16 | }
17 | }
18 | }
19 | ----
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/src/main/java/msvcdojo/MysvcApplication.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | // tag::spring-boot-app[]
7 | @SpringBootApplication
8 | public class MysvcApplication {
9 |
10 | public static void main(String[] args) {
11 | SpringApplication.run(MysvcApplication.class, args);
12 | }
13 | }
14 | // end::spring-boot-app[]
--------------------------------------------------------------------------------
/kata3/start/accounts-service/src/main/java/msvcdojo/AccountsServiceApplication.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | /**
7 | * @author Igor Moochnick
8 | */
9 | @SpringBootApplication
10 | public class AccountsServiceApplication {
11 |
12 | public static void main(String[] args) {
13 | SpringApplication.run(AccountsServiceApplication.class, args);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/kata-web-client/solution/angular2-quickstart/app/boot.ts:
--------------------------------------------------------------------------------
1 | import {bootstrap} from 'angular2/platform/browser'
2 | import {provide} from 'angular2/core';
3 | import {APP_BASE_HREF, ROUTER_PROVIDERS} from 'angular2/router';
4 | import {HTTP_PROVIDERS} from 'angular2/http';
5 | import { DataService} from './services/data.service';
6 | import {AppComponent} from './app.component'
7 |
8 | bootstrap(AppComponent, [
9 | ROUTER_PROVIDERS,
10 | HTTP_PROVIDERS,
11 | DataService,
12 | provide(APP_BASE_HREF, {useValue: '/'})
13 | ]);
14 |
--------------------------------------------------------------------------------
/kata-web-client/start/angular2-quickstart/app/boot.ts:
--------------------------------------------------------------------------------
1 | import {bootstrap} from 'angular2/platform/browser'
2 | import {provide} from 'angular2/core';
3 | import {APP_BASE_HREF, ROUTER_PROVIDERS} from 'angular2/router';
4 | import {HTTP_PROVIDERS} from 'angular2/http';
5 | import { DataService} from './services/data.service';
6 | import {AppComponent} from './app.component'
7 |
8 | bootstrap(AppComponent, [
9 | ROUTER_PROVIDERS,
10 | HTTP_PROVIDERS,
11 | DataService,
12 | provide(APP_BASE_HREF, {useValue: '/'})
13 | ]);
14 |
--------------------------------------------------------------------------------
/dev-environment/container_templates/profiles-service.erb.yml:
--------------------------------------------------------------------------------
1 | profiles-service:
2 | image: msvcdojo/profiles-service:0.0.2
3 | ports:
4 | - 8101
5 | environment:
6 | mongoserver: <%= dockerhost %>
7 | config-service.uri: http://<%= dockerhost %>:8888
8 | service-registry.uri: http://<%= dockerhost %>:8761
9 | external.ip: <%= dockerhost %>
10 | checks:
11 | - uri: http://<%= dockerhost %>:8101/health
12 | retry: 15
13 | depends:
14 | - demo-mongo
15 | - eureka-service
16 | - config-service
17 |
--------------------------------------------------------------------------------
/kata-mesos/solution1/hello.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "mysvcdojo/staging/hello",
3 | "instances": 1,
4 | "cpus": 0.1,
5 | "mem": 256,
6 | "constraints": [["hostname", "UNIQUE", ""]],
7 | "container": {
8 | "type": "DOCKER",
9 | "docker": {
10 | "image": "tutum/hello-world",
11 | "network": "BRIDGE",
12 | "portMappings": [
13 | {
14 | "containerPort": 80,
15 | "hostPort": 0,
16 | "servicePort": 0,
17 | "protocol": "tcp"
18 | }
19 | ]
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/kata-elk/logstash/logstash.conf:
--------------------------------------------------------------------------------
1 | input {
2 | tcp {
3 | port => 4560
4 | codec => json_lines
5 | }
6 | beats {
7 | port => 5044
8 | }
9 | gelf {
10 | port => 12201
11 | }
12 | log4j {
13 | type => "log4j-type"
14 | port => 4561
15 | }
16 | }
17 | output {
18 | stdout {
19 | codec => "json"
20 | }
21 | file {
22 | codec => "json"
23 | path => "/tmp/debug-filters.json"
24 | }
25 | elasticsearch { hosts => ["ELASTICSEARCH_HOST:ELASTICSEARCH_PORT"] }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/kata-web-client/start/angular2-quickstart/app/page1/page1.component.ts:
--------------------------------------------------------------------------------
1 | import {Component} from 'angular2/core';
2 |
3 | @Component({
4 | selector: 'my-dashboard',
5 | template: `
6 | Page 1
7 | Hello, {{name}}!
8 |
9 |
10 | {{message}}
11 | `
12 | })
13 | export class Page1Component {
14 | name = 'world';
15 | message = '';
16 |
17 | sayHello() {
18 | this.message = 'Hello, ' + this.name + '! For real this time.';
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/kata-web-client/solution/angular2-quickstart/app/page1/page1.component.ts:
--------------------------------------------------------------------------------
1 | import {Component} from 'angular2/core';
2 |
3 | @Component({
4 | selector: 'my-dashboard',
5 | template: `
6 | Page 1
7 | Hello, {{name}}!
8 |
9 |
10 | {{message}}
11 | `
12 | })
13 | export class Page1Component {
14 | name = 'world';
15 | message = '';
16 |
17 | sayHello() {
18 | this.message = 'Hello, ' + this.name + '! For real this time.';
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/dev-environment/container_templates/accounts-service.erb.yml:
--------------------------------------------------------------------------------
1 | accounts-service:
2 | image: msvcdojo/accounts-service:0.0.3
3 | ports:
4 | - 8100
5 | environment:
6 | PORT: 8100
7 | sqlserver: <%= dockerhost %>
8 | config-service.uri: http://<%= dockerhost %>:8888
9 | service-registry.uri: http://<%= dockerhost %>:8761
10 | external.ip: <%= dockerhost %>
11 | checks:
12 | - uri: http://<%= dockerhost %>:8100/health
13 | retry: 15
14 | depends:
15 | - demo-mysql
16 | - profiles-service
17 | - eureka-service
18 | - config-service
19 |
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/src/main/java/msvcdojo/Contact.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | public class Contact {
4 | private int id;
5 | private String address;
6 |
7 | public Contact(int id, String address) {
8 | this.id = id;
9 | this.address = address;
10 | }
11 |
12 | public int getId() {
13 | return id;
14 | }
15 |
16 | public void setId(int id) {
17 | this.id = id;
18 | }
19 |
20 | public String getAddress() {
21 | return address;
22 | }
23 |
24 | public void setAddress(String address) {
25 | this.address = address;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/guides/src/environment/ruby.adoc:
--------------------------------------------------------------------------------
1 |
2 | [[ruby]]
3 | == Ruby
4 |
5 | === Ruby for Windows
6 |
7 | Navigate to http://rubyinstaller.org/downloads/[Ruby downloads^] page and
8 | get the, right for you, x32/x64 package of the latest Ruby.
9 |
10 | NOTE: At the moment this article was written, latest Ruby package version
11 | was 2.2.4
12 |
13 | After Ruby is installed you need, from the same page, to download and
14 | install `Ruby Development Kit`. Follow the https://github.com/oneclick/rubyinstaller/wiki/Development-Kit#installation-instructions[installtion instructions for Ruby
15 | Development Kit^]
16 |
--------------------------------------------------------------------------------
/kata5/start/profiles-service/src/main/java/msvcdojo/ProfilesServiceApplication.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | /**
7 | * @author Igor Moochnick
8 | * Inspired by https://github.com/joshlong/spring-doge-microservice/tree/master/doge-service
9 | */
10 | @SpringBootApplication
11 | public class ProfilesServiceApplication {
12 |
13 | public static void main(String[] args) {
14 | SpringApplication.run(ProfilesServiceApplication.class, args);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/dev-environment/container_templates/scripts/environment.rake:
--------------------------------------------------------------------------------
1 | namespace :env do
2 | desc 'Start Environment'
3 | task start: ['container:gateway-service:start', :create_profile]
4 |
5 | desc 'Populate Profiles-Service with Test data'
6 | task :create_profile do
7 | json = {'key': 'john', 'fullName': 'John Smith'}
8 | response = Utils.http_post("http://#{$environment[:dockerhost]}:8101/profiles", json)
9 | abort if response.code.to_i != 201
10 | end
11 |
12 | desc 'Stop Environment'
13 | task stop: ['container:demo-mysql:stop', 'container:demo-mongo:stop', 'container:config-service:stop']
14 | end
15 |
--------------------------------------------------------------------------------
/guides/src/kata4/env.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": [],
3 | "server.ports": {
4 | "local.server.port": 8222
5 | },
6 | "servletContextInitParams": {},
7 | "systemProperties": {
8 | "java.runtime.name": "Java(TM) SE Runtime Environment",
9 | "PORT": "8222",
10 | "name": "Alice",
11 | ...
12 | },
13 | "systemEnvironment": {
14 | "NUMBER_OF_PROCESSORS": "4",
15 | "name": "John",
16 | ...
17 | },
18 | "applicationConfig: [classpath:/application.yml]": {
19 | "server.port": "${PORT:8100}",
20 | "name": "World",
21 | "endpoints.health.sensitive": false,
22 | "endpoints.shutdown.enabled": true
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/kata-mesos/solution1/container_templates/mesos_marathon.erb.yml:
--------------------------------------------------------------------------------
1 | mesos_marathon:
2 | image: mesosphere/marathon:v0.11.1
3 | command: --checkpoint --task_launch_timeout 300000
4 | net: host
5 | ports:
6 | - 8282
7 | - 9090
8 | environment:
9 | LIBPROCESS_PORT: 9090
10 | MARATHON_HOSTNAME: <%= dockerhost %>
11 | MARATHON_HTTP_PORT: 8282
12 | MARATHON_MASTER: zk://<%= dockerhost %>:2181/mesos
13 | # MARATHON_WEBUI_URL: http://<%= dockerhost %>:8282
14 | MARATHON_ZK: zk://<%= dockerhost %>:2181/marathon
15 | checks:
16 | - uri: http://<%= dockerhost %>:8282/ping
17 | retry: 5
18 | depends:
19 | - mesos_slave
20 |
--------------------------------------------------------------------------------
/kata-mesos/solution1/container_templates/mesos_master.erb.yml:
--------------------------------------------------------------------------------
1 | mesos_master:
2 | image: msvcdojo/mesos_master:0.27.0-0.2.190.ubuntu1404
3 | net: host
4 | ports:
5 | - 5050
6 | environment:
7 | MESOS_CLUSTER: localmesos
8 | MESOS_HOSTNAME: <%= dockerhost %>
9 | MESOS_IP: <%= dockerhost %>
10 | MESOS_LOG_DIR: /var/log/mesos/master
11 | MESOS_PORT: 5050
12 | MESOS_QUORUM: 1
13 | MESOS_WORK_DIR: /var/lib/mesos/master
14 | MESOS_ZK: zk://<%= dockerhost %>:2181/mesos
15 | # MESOS_REGISTRY: in_memory
16 | depends:
17 | - zookeeper
18 | checks:
19 | - uri: http://<%= dockerhost %>:5050/metrics/snapshot
20 | retry: 5
21 |
--------------------------------------------------------------------------------
/kata4/solution2/config-service/src/main/java/msvcdojo/ConfigurationServerApplication.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.cloud.config.server.EnableConfigServer;
6 |
7 | /**
8 | * @author Igor Moochnick
9 | */
10 | @SpringBootApplication
11 | // tag::annotation[]
12 | @EnableConfigServer
13 | public class ConfigurationServerApplication {
14 |
15 | public static void main(String[] args) throws Exception {
16 | SpringApplication.run(ConfigurationServerApplication.class, args);
17 | }
18 | }
19 | // end::annotation[]
20 |
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/src/main/java/msvcdojo/NestedContentResource.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonUnwrapped;
4 |
5 | import org.springframework.hateoas.ResourceSupport;
6 | import org.springframework.hateoas.Resources;
7 |
8 | // tag::NestedContentResource[]
9 | public class NestedContentResource extends ResourceSupport {
10 |
11 | private final Resources nested;
12 |
13 | public NestedContentResource(Iterable toNest) {
14 | this.nested = new Resources<>(toNest);
15 | }
16 |
17 | @JsonUnwrapped
18 | public Resources getNested() {
19 | return this.nested;
20 | }
21 | }
22 | // end::NestedContentResource[]
23 |
--------------------------------------------------------------------------------
/kata4/solution2/config-service/src/main/resources/application-native.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: ${PORT:8888}
3 |
4 | # tag::native[]
5 | spring:
6 | profiles:
7 | active: native
8 | cloud:
9 | config:
10 | server:
11 | native:
12 | searchLocations: file:./config/
13 | # end::native[]
14 |
15 | #spring:
16 | # cloud:
17 | # config:
18 | # server:
19 | # git:
20 | # uri: ${conf:https://github.com/Accordance/microservice-dojo-configuration}
21 | # This is where the git repository is cloned. It is ephemeral. By default it's in /tmp
22 | # basedir: config
23 |
24 | logging:
25 | level:
26 | com.netflix.discovery: OFF
27 |
--------------------------------------------------------------------------------
/kata6/solution1/eureka-service/src/main/java/msvcdojo/EurekaServiceApplication.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
6 | import org.springframework.context.annotation.Configuration;
7 |
8 | /**
9 | * @author Igor Moochnick
10 | */
11 | @Configuration
12 | @EnableAutoConfiguration
13 | // tag::eureka[]
14 | @EnableEurekaServer
15 | public class EurekaServiceApplication {
16 |
17 | public static void main(String[] args) throws Exception {
18 | SpringApplication.run(EurekaServiceApplication.class, args);
19 | }
20 | }
21 | // end::eureka[]
--------------------------------------------------------------------------------
/kata6/solution2/eureka-service/src/main/java/msvcdojo/EurekaServiceApplication.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
6 | import org.springframework.context.annotation.Configuration;
7 |
8 | /**
9 | * @author Igor Moochnick
10 | */
11 | @Configuration
12 | @EnableAutoConfiguration
13 | // tag::eureka[]
14 | @EnableEurekaServer
15 | public class EurekaServiceApplication {
16 |
17 | public static void main(String[] args) throws Exception {
18 | SpringApplication.run(EurekaServiceApplication.class, args);
19 | }
20 | }
21 | // end::eureka[]
--------------------------------------------------------------------------------
/kata-elk/container_templates/scripts/elk.rake:
--------------------------------------------------------------------------------
1 | namespace :elk do
2 | desc "Start ELK Environment"
3 | task start: [ 'container:elasticSearchData:start',
4 | 'container:logData:start',
5 | 'container:logstash:start',
6 | 'container:elasticsearch:start',
7 | 'container:kibana:start',
8 | 'container:fileBeat:start'
9 | ]
10 |
11 | desc "Stop ELK Environment"
12 | task stop: [ 'container:kibana:stop',
13 | 'container:logstash:stop',
14 | 'container:elasticsearch:stop',
15 | 'container:elasticSearchData:stop',
16 | 'container:logData:stop',
17 | 'container:fileBeat:stop']
18 | end
19 |
--------------------------------------------------------------------------------
/kata4/solution2/config-service/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | # tag::port[]
3 | port: ${PORT:8888}
4 | # end::port[]
5 | # tag::native[]
6 | #spring:
7 | # profiles:
8 | # active: native
9 | # cloud:
10 | # config:
11 | # server:
12 | # native:
13 | # searchLocations: file:./config/
14 | # end::native[]
15 |
16 | # tag::git[]
17 | spring:
18 | cloud:
19 | config:
20 | server:
21 | git:
22 | uri: ${conf:https://github.com/Accordance/microservice-dojo-configuration}
23 | # end::git[]
24 | # This is where the git repository is cloned. It is ephemeral. By default it's in /tmp
25 | # basedir: config
26 |
27 | logging:
28 | level:
29 | com.netflix.discovery: OFF
30 |
--------------------------------------------------------------------------------
/kata8/solution1/gateway-service/src/main/java/msvcdojo/GatewayServiceApplication.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
7 | import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
8 |
9 | @SpringBootApplication
10 | @EnableEurekaClient
11 | // tag::enable-zuul[]
12 | @EnableZuulProxy
13 | public class GatewayServiceApplication {
14 |
15 | public static void main(String args[]) {
16 | SpringApplication.run(GatewayServiceApplication.class, args);
17 | }
18 | }
19 | // end::enable-zuul[]
20 |
--------------------------------------------------------------------------------
/kata2/start/mysvc/src/main/java/msvcdojo/MysvcApplication.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.web.bind.annotation.RequestMapping;
6 | import org.springframework.web.bind.annotation.RestController;
7 |
8 | // tag::code[]
9 | @SpringBootApplication
10 | public class MysvcApplication {
11 |
12 | public static void main(String[] args) {
13 | SpringApplication.run(MysvcApplication.class, args);
14 | }
15 | }
16 | // end::code[]
17 |
18 | // tag::controller[]
19 | @RestController
20 | class HomeController {
21 |
22 | @RequestMapping("/")
23 | String home() {
24 | return "Hello World!";
25 | }
26 | }
27 | // end::controller[]
28 |
--------------------------------------------------------------------------------
/kata1/solution/mysvc/src/main/java/msvcdojo/MysvcApplication.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.web.bind.annotation.RequestMapping;
6 | import org.springframework.web.bind.annotation.RestController;
7 |
8 | // tag::code[]
9 | @SpringBootApplication
10 | public class MysvcApplication {
11 |
12 | public static void main(String[] args) {
13 | SpringApplication.run(MysvcApplication.class, args);
14 | }
15 | }
16 | // end::code[]
17 |
18 | // tag::controller[]
19 | @RestController
20 | class HomeController {
21 |
22 | @RequestMapping("/")
23 | String home() {
24 | return "Hello World!";
25 | }
26 | }
27 | // end::controller[]
28 |
--------------------------------------------------------------------------------
/kata2/solution/mysvc/src/main/java/msvcdojo/MysvcApplication.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.web.bind.annotation.RequestMapping;
6 | import org.springframework.web.bind.annotation.RestController;
7 |
8 | // tag::code[]
9 | @SpringBootApplication
10 | public class MysvcApplication {
11 |
12 | public static void main(String[] args) {
13 | SpringApplication.run(MysvcApplication.class, args);
14 | }
15 | }
16 | // end::code[]
17 |
18 | // tag::controller[]
19 | @RestController
20 | class HomeController {
21 |
22 | @RequestMapping("/")
23 | String home() {
24 | return "Hello World!";
25 | }
26 | }
27 | // end::controller[]
28 |
--------------------------------------------------------------------------------
/guides/src/environment/environment.adoc:
--------------------------------------------------------------------------------
1 | :sectanchors:
2 | :sectlinks:
3 | include::../header.adoc[]
4 |
5 | == Pre-requisits
6 |
7 | You need to have the following tools available on your machine:
8 |
9 | . <>
10 | . <>
11 | . <>
12 | . <>
13 | . <>
14 | . <>
15 |
16 | // ======================================================================================
17 |
18 | include::intellij.adoc[]
19 | include::git.adoc[]
20 | include::docker.adoc[]
21 | include::curl.adoc[]
22 | include::ruby.adoc[]
23 | include::gradle.adoc[]
24 |
25 | // ======================================================================================
26 |
--------------------------------------------------------------------------------
/kata4/solution2/mysvc/src/main/java/msvcdojo/MysvcApplication.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.springframework.beans.factory.annotation.Value;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.web.bind.annotation.RequestMapping;
7 | import org.springframework.web.bind.annotation.RestController;
8 |
9 | @SpringBootApplication
10 | public class MysvcApplication {
11 |
12 | public static void main(String[] args) {
13 | SpringApplication.run(MysvcApplication.class, args);
14 | }
15 | }
16 |
17 | @RestController
18 | class HomeController {
19 |
20 | @Value("${name}")
21 | private String name;
22 |
23 | @RequestMapping("/")
24 | String home() {
25 | return "Hello, " + name + "!";
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/src/main/java/msvcdojo/IndexController.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
4 |
5 | import org.springframework.hateoas.ResourceSupport;
6 | import org.springframework.web.bind.annotation.RequestMapping;
7 | import org.springframework.web.bind.annotation.RequestMethod;
8 | import org.springframework.web.bind.annotation.RestController;
9 |
10 | @RestController
11 | @RequestMapping("/")
12 | public class IndexController {
13 |
14 | @RequestMapping(method= RequestMethod.GET)
15 | public ResourceSupport index() {
16 | ResourceSupport index = new ResourceSupport();
17 | index.add(linkTo(AccountController.class).withRel("accounts"));
18 | index.add(linkTo(ContactController.class).withRel("contacts"));
19 | return index;
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/kata-web-client/start/angular2-quickstart/app/services/data.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from 'angular2/core';
2 | import { Http, Response } from 'angular2/http';
3 | import 'rxjs/add/operator/map';
4 |
5 | @Injectable()
6 | export class DataService {
7 | constructor(private _http: Http) { }
8 |
9 | getCharacters() {
10 | let observable = this._http.get('characters.json')
11 | .map(function(response: Response) {
12 | return response.json();
13 | });
14 |
15 | return observable;
16 | }
17 |
18 | getCharacter(id: number) {
19 | let observable = this._http.get('characters.json')
20 | .map((response: Response) => response.json().filter((c: Character) => c.id === id)[0]);
21 | return observable;
22 | }
23 | }
24 |
25 | export interface Character {
26 | id: number;
27 | name: string;
28 | }
29 |
--------------------------------------------------------------------------------
/kata4/start/mysvc/src/main/java/msvcdojo/MysvcApplication.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.springframework.beans.factory.annotation.Value;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.web.bind.annotation.RequestMapping;
7 | import org.springframework.web.bind.annotation.RestController;
8 |
9 | @SpringBootApplication
10 | public class MysvcApplication {
11 |
12 | public static void main(String[] args) {
13 | SpringApplication.run(MysvcApplication.class, args);
14 | }
15 | }
16 |
17 | // tag::controller[]
18 | @RestController
19 | class HomeController {
20 |
21 | private String name = "World";
22 |
23 | @RequestMapping("/")
24 | String home() {
25 | return "Hello, " + name + "!";
26 | }
27 | }
28 | // end::controller[]
--------------------------------------------------------------------------------
/kata-web-client/solution/angular2-quickstart/app/services/data.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from 'angular2/core';
2 | import { Http, Response } from 'angular2/http';
3 | import 'rxjs/add/operator/map';
4 |
5 | @Injectable()
6 | export class DataService {
7 | constructor(private _http: Http) { }
8 |
9 | getCharacters() {
10 | let observable = this._http.get('characters.json')
11 | .map(function(response: Response) {
12 | return response.json();
13 | });
14 |
15 | return observable;
16 | }
17 |
18 | getCharacter(id: number) {
19 | let observable = this._http.get('characters.json')
20 | .map((response: Response) => response.json().filter((c: Character) => c.id === id)[0]);
21 | return observable;
22 | }
23 | }
24 |
25 | export interface Character {
26 | id: number;
27 | name: string;
28 | }
29 |
--------------------------------------------------------------------------------
/kata4/solution1/mysvc/src/main/java/msvcdojo/MysvcApplication.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.springframework.beans.factory.annotation.Value;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.web.bind.annotation.RequestMapping;
7 | import org.springframework.web.bind.annotation.RestController;
8 |
9 | @SpringBootApplication
10 | public class MysvcApplication {
11 |
12 | public static void main(String[] args) {
13 | SpringApplication.run(MysvcApplication.class, args);
14 | }
15 | }
16 |
17 | // tag::controller[]
18 | @RestController
19 | class HomeController {
20 |
21 | @Value("${name}")
22 | private String name;
23 |
24 | @RequestMapping("/")
25 | String home() {
26 | return "Hello, " + name + "!";
27 | }
28 | }
29 | // end::controller[]
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-contact-example/http-response.adoc:
--------------------------------------------------------------------------------
1 | [source,http]
2 | ----
3 | HTTP/1.1 200 OK
4 | Content-Type: application/json
5 | Content-Length: 619
6 |
7 | {
8 | "_embedded" : {
9 | "contactList" : [ {
10 | "id" : 1,
11 | "address" : "Waltham, MA",
12 | "_links" : {
13 | "self" : {
14 | "href" : "http://localhost:8080/contacts/1"
15 | },
16 | "contact-accounts" : {
17 | "href" : "http://localhost:8080/contacts/1/accounts"
18 | }
19 | }
20 | }, {
21 | "id" : 2,
22 | "address" : "Boston, MA",
23 | "_links" : {
24 | "self" : {
25 | "href" : "http://localhost:8080/contacts/2"
26 | },
27 | "contact-accounts" : {
28 | "href" : "http://localhost:8080/contacts/2/accounts"
29 | }
30 | }
31 | } ]
32 | }
33 | }
34 | ----
--------------------------------------------------------------------------------
/kata-web-client/start/angular2-quickstart/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import {Component} from 'angular2/core';
2 | import {RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router'
3 | import {Injectable, Inject} from 'angular2/core';
4 |
5 | import { HomeComponent } from './home/home';
6 | import { Page1Component } from './page1/page1.component';
7 | import { Page2Component } from './page2/page2.component';
8 |
9 | @Component({
10 | selector: 'app',
11 | template: `
12 | Home |
13 | Page 1 |
14 | Page 2
15 |
16 |
17 | `,
18 | directives: [ROUTER_DIRECTIVES]
19 | })
20 |
21 | @RouteConfig([
22 | { path: "/", component: HomeComponent, as: "Default" },
23 | { path: '/page1', as: 'Page1', component: Page1Component},
24 | { path: '/page2', as: 'Page2', component: Page2Component }
25 | ])
26 |
27 | export class AppComponent {}
28 |
--------------------------------------------------------------------------------
/kata-web-client/solution/angular2-quickstart/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import {Component} from 'angular2/core';
2 | import {RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router'
3 | import {Injectable, Inject} from 'angular2/core';
4 |
5 | import { HomeComponent } from './home/home';
6 | import { Page1Component } from './page1/page1.component';
7 | import { Page2Component } from './page2/page2.component';
8 |
9 | @Component({
10 | selector: 'app',
11 | template: `
12 | Home |
13 | Page 1 |
14 | Page 2
15 |
16 |
17 | `,
18 | directives: [ROUTER_DIRECTIVES]
19 | })
20 |
21 | @RouteConfig([
22 | { path: "/", component: HomeComponent, as: "Default" },
23 | { path: '/page1', as: 'Page1', component: Page1Component},
24 | { path: '/page2', as: 'Page2', component: Page2Component }
25 | ])
26 |
27 | export class AppComponent {}
28 |
--------------------------------------------------------------------------------
/kata-web-client/solution/angular2-quickstart/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "angular2-quickstart",
3 | "version": "0.1.0",
4 | "description": "A minimal Angular2 playground using TypeScript",
5 | "repository": {
6 | "type": "git",
7 | "url": "git+https://github.com/Accordance/generator-webapp-angular2.git"
8 | },
9 | "homepage": "https://github.com/Accordance/generator-webapp-angular2/blob/master/README.md",
10 | "scripts": {
11 | "tsc": "tsc",
12 | "tsc:w": "tsc -w",
13 | "lite": "lite-server",
14 | "start": "concurrent \"npm run tsc:w\" \"npm run lite\" "
15 | },
16 | "dependencies": {
17 | "angular2": "2.0.0-beta.0",
18 | "systemjs": "0.19.8",
19 | "es6-promise": "^3.0.2",
20 | "es6-shim": "^0.33.13",
21 | "reflect-metadata": "^0.1.2",
22 | "rxjs": "5.0.0-beta.0",
23 | "zone.js": "0.5.10"
24 | },
25 | "devDependencies": {
26 | "concurrently": "^1.0.0",
27 | "lite-server": "^1.3.1",
28 | "typescript": "^1.7.3"
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/kata-web-client/start/angular2-quickstart/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "angular2-quickstart",
3 | "version": "0.1.0",
4 | "description": "A minimal Angular2 playground using TypeScript",
5 | "repository": {
6 | "type": "git",
7 | "url": "git+https://github.com/Accordance/generator-webapp-angular2.git"
8 | },
9 | "homepage": "https://github.com/Accordance/generator-webapp-angular2/blob/master/README.md",
10 | "scripts": {
11 | "tsc": "tsc",
12 | "tsc:w": "tsc -w",
13 | "lite": "lite-server",
14 | "start": "concurrent \"npm run tsc:w\" \"npm run lite\" "
15 | },
16 | "dependencies": {
17 | "angular2": "2.0.0-beta.0",
18 | "systemjs": "0.19.8",
19 | "es6-promise": "^3.0.2",
20 | "es6-shim": "^0.33.13",
21 | "reflect-metadata": "^0.1.2",
22 | "rxjs": "5.0.0-beta.0",
23 | "zone.js": "0.5.10"
24 | },
25 | "devDependencies": {
26 | "concurrently": "^1.0.0",
27 | "lite-server": "^1.3.1",
28 | "typescript": "^1.7.3"
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/kata3/solution2/accounts-service/src/test/java/msvcdojo/AccountsServiceApplicationTests.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.junit.Test;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.boot.test.SpringApplicationConfiguration;
7 | import org.springframework.jdbc.core.JdbcTemplate;
8 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
9 |
10 | import static org.junit.Assert.assertEquals;
11 |
12 | // tag::test[]
13 | @RunWith(SpringJUnit4ClassRunner.class)
14 | @SpringApplicationConfiguration(AccountsServiceApplication.class)
15 | public class AccountsServiceApplicationTests {
16 |
17 | @Autowired
18 | private JdbcTemplate template;
19 |
20 | @Test
21 | public void testDefaultSettings() throws Exception {
22 | assertEquals(new Integer(1), this.template
23 | .queryForObject("SELECT COUNT(*) from account WHERE username='john'", Integer.class));
24 | }
25 |
26 | }
27 | // end::test[]
--------------------------------------------------------------------------------
/kata-web-client/solution/angular2-quickstart/characters.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "id": 11,
4 | "name": "General Hux"
5 | },
6 | {
7 | "id": 12,
8 | "name": "Rey"
9 | },
10 | {
11 | "id": 13,
12 | "name": "Finn (FN2187)"
13 | },
14 | {
15 | "id": 14,
16 | "name": "Han Solo"
17 | },
18 | {
19 | "id": 15,
20 | "name": "Leia Organa"
21 | },
22 | {
23 | "id": 16,
24 | "name": "Luke Skywalker"
25 | },
26 | {
27 | "id": 17,
28 | "name": "Poe Dameron"
29 | },
30 | {
31 | "id": 18,
32 | "name": "Kylo Ren"
33 | },
34 | {
35 | "id": 19,
36 | "name": "Supreme Commander Snoke"
37 | },
38 | {
39 | "id": 20,
40 | "name": "R2-D2"
41 | },
42 | {
43 | "id": 21,
44 | "name": "BB8"
45 | },
46 | {
47 | "id": 22,
48 | "name": "C-3PO"
49 | },
50 | {
51 | "id": 23,
52 | "name": "Maz Kanata"
53 | },
54 | {
55 | "id": 24,
56 | "name": "Captain Phasma"
57 | },
58 | {
59 | "id": 25,
60 | "name": "Chewbacca"
61 | }
62 | ]
63 |
--------------------------------------------------------------------------------
/kata-web-client/start/angular2-quickstart/characters.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "id": 11,
4 | "name": "General Hux"
5 | },
6 | {
7 | "id": 12,
8 | "name": "Rey"
9 | },
10 | {
11 | "id": 13,
12 | "name": "Finn (FN2187)"
13 | },
14 | {
15 | "id": 14,
16 | "name": "Han Solo"
17 | },
18 | {
19 | "id": 15,
20 | "name": "Leia Organa"
21 | },
22 | {
23 | "id": 16,
24 | "name": "Luke Skywalker"
25 | },
26 | {
27 | "id": 17,
28 | "name": "Poe Dameron"
29 | },
30 | {
31 | "id": 18,
32 | "name": "Kylo Ren"
33 | },
34 | {
35 | "id": 19,
36 | "name": "Supreme Commander Snoke"
37 | },
38 | {
39 | "id": 20,
40 | "name": "R2-D2"
41 | },
42 | {
43 | "id": 21,
44 | "name": "BB8"
45 | },
46 | {
47 | "id": 22,
48 | "name": "C-3PO"
49 | },
50 | {
51 | "id": 23,
52 | "name": "Maz Kanata"
53 | },
54 | {
55 | "id": 24,
56 | "name": "Captain Phasma"
57 | },
58 | {
59 | "id": 25,
60 | "name": "Chewbacca"
61 | }
62 | ]
63 |
--------------------------------------------------------------------------------
/kata-web-client/start/angular2-quickstart/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Angular 2 QuickStart
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
27 |
28 |
29 |
30 |
31 |
32 | Loading...
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/kata-web-client/solution/angular2-quickstart/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Angular 2 QuickStart
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
27 |
28 |
29 |
30 |
31 |
32 | Loading...
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/kata4/solution1/mysvc/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.2.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | jar {
18 | baseName = 'mysvc'
19 | version = '0.0.1'
20 | group = 'msvcdojo'
21 | }
22 | sourceCompatibility = 1.8
23 | targetCompatibility = 1.8
24 |
25 | repositories {
26 | mavenCentral()
27 | }
28 |
29 | dependencies {
30 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
31 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
32 | }
33 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
34 | exclude group: 'org.eclipse.jetty.websocket'
35 | }
36 | compile('org.springframework.boot:spring-boot-starter-actuator')
37 | testCompile('org.springframework.boot:spring-boot-starter-test')
38 | }
39 |
40 | task wrapper(type: Wrapper) {
41 | gradleVersion = '2.9'
42 | }
43 |
--------------------------------------------------------------------------------
/kata4/start/mysvc/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.2.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | jar {
18 | baseName = 'mysvc'
19 | version = '0.0.1'
20 | group = 'msvcdojo'
21 | }
22 |
23 | sourceCompatibility = 1.8
24 | targetCompatibility = 1.8
25 |
26 | repositories {
27 | mavenCentral()
28 | }
29 |
30 | dependencies {
31 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
32 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
33 | }
34 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
35 | exclude group: 'org.eclipse.jetty.websocket'
36 | }
37 | compile('org.springframework.boot:spring-boot-starter-actuator')
38 | testCompile('org.springframework.boot:spring-boot-starter-test')
39 | }
40 |
41 | task wrapper(type: Wrapper) {
42 | gradleVersion = '2.9'
43 | }
44 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Accordance
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/src/main/java/msvcdojo/Account.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | // tag::entity[]
4 | public class Account {
5 | private int id;
6 | private String name;
7 |
8 | public Account() {
9 | }
10 |
11 | public Account(int id, String name) {
12 | super();
13 | this.id = id;
14 | this.name = name;
15 | }
16 |
17 | public int getId() {
18 | return id;
19 | }
20 |
21 | public void setId(int id) {
22 | this.id = id;
23 | }
24 |
25 | public String getName() {
26 | return name;
27 | }
28 |
29 | public void setName(String name) {
30 | this.name = name;
31 | }
32 |
33 | @Override
34 | public int hashCode() {
35 | final int prime = 31;
36 | int result = 1;
37 | result = prime * result + id;
38 | return result;
39 | }
40 |
41 | @Override
42 | public boolean equals(Object obj) {
43 | if (this == obj)
44 | return true;
45 | if (obj == null)
46 | return false;
47 | if (getClass() != obj.getClass())
48 | return false;
49 | Account other = (Account) obj;
50 | if (id != other.id)
51 | return false;
52 | return true;
53 | }
54 | }
55 | // end::entity[]
56 |
--------------------------------------------------------------------------------
/kata-mesos/solution1/container_templates/mesos_slave.erb.yml:
--------------------------------------------------------------------------------
1 | mesos_slave:
2 | image: msvcdojo/mesos_slave:0.27.0-0.2.190.ubuntu1404
3 | net: host
4 | privileged: true
5 | pid: host
6 | ports:
7 | - 5051
8 | environment:
9 | MESOS_CONTAINERIZERS: docker,mesos
10 | MESOS_DOCKER_SOCK: /var/run/docker.sock
11 | MESOS_DOCKER_MESOS_IMAGE: msvcdojo/mesos_slave:0.27.0-0.2.190.ubuntu1404
12 | MESOS_EXECUTOR_REGISTRATION_TIMEOUT: 10mins
13 | MESOS_ISOLATOR: cgroups/cpu,cgroups/mem
14 | MESOS_LOG_DIR: /var/log/mesos/slave
15 | # MESOS_LOGGING_LEVEL: INFO
16 | MESOS_MASTER: zk://<%= dockerhost %>:2181/mesos
17 | MESOS_PORT: 5051
18 | MESOS_WORK_DIR: /var/lib/mesos/slave
19 | MESOS_IP: <%= dockerhost %>
20 | MESOS_HOSTNAME: <%= dockerhost %>
21 | MESOS_RESOURCES: ports(*):[31000-32000]
22 | MESOS_DOCKER: /usr/bin/docker
23 | GLOG_v: 1
24 | volumes:
25 | # - /usr/local/bin/docker:/usr/bin/docker:ro
26 | - /var/run/docker.sock:/var/run/docker.sock
27 | - /sys:/sys
28 | - /proc:/host/proc:ro
29 | depends:
30 | - mesos_master
31 | checks:
32 | - uri: http://<%= dockerhost %>:5050/metrics/snapshot
33 | retry: 5
34 |
--------------------------------------------------------------------------------
/kata2/start/mysvc/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.2.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | jar {
18 | baseName = 'mysvc'
19 | version = '0.0.1'
20 | group = 'msvcdojo'
21 | }
22 |
23 | sourceCompatibility = 1.8
24 | targetCompatibility = 1.8
25 |
26 | repositories {
27 | mavenCentral()
28 | }
29 |
30 | dependencies {
31 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
32 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
33 | }
34 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
35 | exclude group: 'org.eclipse.jetty.websocket'
36 | }
37 | compile('org.springframework.boot:spring-boot-starter-actuator')
38 | compile('org.springframework.boot:spring-boot-actuator-docs')
39 | testCompile('org.springframework.boot:spring-boot-starter-test')
40 | }
41 |
42 | task wrapper(type: Wrapper) {
43 | gradleVersion = '2.9'
44 | }
45 |
--------------------------------------------------------------------------------
/kata7/solution/hystrix-service/src/main/java/doge/HystrixApplication.java:
--------------------------------------------------------------------------------
1 | package doge;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
7 | import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
8 | import org.springframework.cloud.netflix.ribbon.SpringClientFactory;
9 | import org.springframework.context.annotation.Bean;
10 | import org.springframework.context.annotation.ComponentScan;
11 | import org.springframework.context.annotation.Configuration;
12 | import org.springframework.stereotype.Controller;
13 | import org.springframework.web.bind.annotation.RequestMapping;
14 |
15 | @SpringBootApplication
16 | @EnableAutoConfiguration
17 | @EnableHystrixDashboard
18 | @EnableEurekaClient
19 | public class HystrixApplication {
20 |
21 | public static void main(String[] args) {
22 | SpringApplication.run(HystrixApplication.class, args);
23 | }
24 | }
25 |
26 | @Controller
27 | class HystrixDashboardController {
28 |
29 | @RequestMapping("/")
30 | public String home() {
31 | return "forward:/hystrix/index.html";
32 | }
33 |
34 | }
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-accounts-example/http-response.adoc:
--------------------------------------------------------------------------------
1 | [source,http]
2 | ----
3 | HTTP/1.1 200 OK
4 | Content-Type: application/json
5 | Content-Length: 967
6 |
7 | {
8 | "_embedded" : {
9 | "accountList" : [ {
10 | "id" : 1,
11 | "name" : "John",
12 | "_links" : {
13 | "self" : {
14 | "href" : "http://localhost:8080/accounts/1"
15 | },
16 | "account-contacts" : {
17 | "href" : "http://localhost:8080/accounts/1/contacts"
18 | }
19 | }
20 | }, {
21 | "id" : 2,
22 | "name" : "Tim",
23 | "_links" : {
24 | "self" : {
25 | "href" : "http://localhost:8080/accounts/2"
26 | },
27 | "account-contacts" : {
28 | "href" : "http://localhost:8080/accounts/2/contacts"
29 | }
30 | }
31 | }, {
32 | "id" : 3,
33 | "name" : "Mike",
34 | "_links" : {
35 | "self" : {
36 | "href" : "http://localhost:8080/accounts/3"
37 | },
38 | "account-contacts" : {
39 | "href" : "http://localhost:8080/accounts/3/contacts"
40 | }
41 | }
42 | } ]
43 | },
44 | "_links" : {
45 | "self" : {
46 | "href" : "http://localhost:8080/accounts"
47 | }
48 | }
49 | }
50 | ----
--------------------------------------------------------------------------------
/kata-web-client/solution/angular2-quickstart/app/page2/page2.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from 'angular2/core';
2 | import { Injectable, Inject } from 'angular2/core';
3 | import { Router } from 'angular2/router';
4 |
5 | import { DataService, Character } from '../services/data.service';
6 |
7 | @Component({
8 | selector: 'page2',
9 | templateUrl: 'app/page2/page2.component.html',
10 | styleUrls: ['app/page2/page2.component.css']
11 | })
12 | export class Page2Component implements OnInit {
13 | characters: Character[];
14 | currentCharacter: Character;
15 |
16 | constructor(private _dataService: DataService) { }
17 |
18 | ngOnInit() {
19 | this.characters = this.getCharacters();
20 | }
21 |
22 | onSelect(character: Character) {
23 | this.currentCharacter = character;
24 | this._dataService.getCharacter(character.id)
25 | .subscribe((character: Character) => {
26 | this.currentCharacter = character;
27 | });
28 | }
29 |
30 | /////////////////
31 |
32 | getCharacters() {
33 | this.currentCharacter = undefined;
34 | this.characters = [];
35 |
36 | this._dataService.getCharacters()
37 | .subscribe((characters: Character[]) => {
38 | this.characters = characters;
39 | });
40 |
41 | return this.characters;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/kata-web-client/start/angular2-quickstart/app/page2/page2.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from 'angular2/core';
2 | import { Injectable, Inject } from 'angular2/core';
3 | import { Router } from 'angular2/router';
4 |
5 | import { DataService, Character } from '../services/data.service';
6 |
7 | @Component({
8 | selector: 'page2',
9 | templateUrl: 'app/page2/page2.component.html',
10 | styleUrls: ['app/page2/page2.component.css']
11 | })
12 | export class Page2Component implements OnInit {
13 | characters: Character[];
14 | currentCharacter: Character;
15 |
16 | constructor(private _dataService: DataService) { }
17 |
18 | ngOnInit() {
19 | this.characters = this.getCharacters();
20 | }
21 |
22 | onSelect(character: Character) {
23 | this.currentCharacter = character;
24 | this._dataService.getCharacter(character.id)
25 | .subscribe((character: Character) => {
26 | this.currentCharacter = character;
27 | });
28 | }
29 |
30 | /////////////////
31 |
32 | getCharacters() {
33 | this.currentCharacter = undefined;
34 | this.characters = [];
35 |
36 | this._dataService.getCharacters()
37 | .subscribe((characters: Character[]) => {
38 | this.characters = characters;
39 | });
40 |
41 | return this.characters;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build/generated-snippets/get-accounts-simple-doc/http-response.adoc:
--------------------------------------------------------------------------------
1 | [source,http]
2 | ----
3 | HTTP/1.1 200 OK
4 | Content-Type: application/json
5 | Content-Length: 967
6 |
7 | {
8 | "_embedded" : {
9 | "accountList" : [ {
10 | "id" : 1,
11 | "name" : "John",
12 | "_links" : {
13 | "self" : {
14 | "href" : "http://localhost:8080/accounts/1"
15 | },
16 | "account-contacts" : {
17 | "href" : "http://localhost:8080/accounts/1/contacts"
18 | }
19 | }
20 | }, {
21 | "id" : 2,
22 | "name" : "Tim",
23 | "_links" : {
24 | "self" : {
25 | "href" : "http://localhost:8080/accounts/2"
26 | },
27 | "account-contacts" : {
28 | "href" : "http://localhost:8080/accounts/2/contacts"
29 | }
30 | }
31 | }, {
32 | "id" : 3,
33 | "name" : "Mike",
34 | "_links" : {
35 | "self" : {
36 | "href" : "http://localhost:8080/accounts/3"
37 | },
38 | "account-contacts" : {
39 | "href" : "http://localhost:8080/accounts/3/contacts"
40 | }
41 | }
42 | } ]
43 | },
44 | "_links" : {
45 | "self" : {
46 | "href" : "http://localhost:8080/accounts"
47 | }
48 | }
49 | }
50 | ----
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/src/main/java/msvcdojo/AccountResourceAssembler.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
4 | import org.springframework.hateoas.Resource;
5 | import org.springframework.hateoas.mvc.ResourceAssemblerSupport;
6 | import org.springframework.stereotype.Component;
7 |
8 | // tag::ResourceAssembler[]
9 | @Component
10 | public class AccountResourceAssembler
11 | extends ResourceAssemblerSupport {
12 |
13 | public AccountResourceAssembler() {
14 | super(AccountController.class, AccountResource.class);
15 | }
16 |
17 |
18 | @Override
19 | public AccountResource toResource(Account entity) {
20 | AccountResource resource = createResourceWithId(entity.getId(), entity);
21 | resource.add(linkTo(AccountController.class).slash(entity.getId()).slash("contacts").withRel("account-contacts"));
22 | return resource;
23 | }
24 |
25 | @Override
26 | protected AccountResource instantiateResource(Account entity) {
27 | return new AccountResource(entity);
28 | }
29 |
30 | static class AccountResource extends Resource {
31 | public AccountResource(Account account) {
32 | super(account);
33 | }
34 | }
35 |
36 | }
37 | // end::ResourceAssembler[]
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/src/main/java/msvcdojo/ContactResourceAssembler.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
4 |
5 | import org.springframework.hateoas.Resource;
6 | import org.springframework.hateoas.mvc.ResourceAssemblerSupport;
7 | import org.springframework.stereotype.Component;
8 |
9 | // tag::ResourceAssembler[]
10 | @Component
11 | public class ContactResourceAssembler
12 | extends ResourceAssemblerSupport {
13 |
14 | public ContactResourceAssembler() {
15 | super(ContactController.class, ContactResource.class);
16 | }
17 |
18 |
19 | @Override
20 | public ContactResource toResource(Contact entity) {
21 | ContactResource resource = createResourceWithId(entity.getId(), entity);
22 | resource.add(linkTo(ContactController.class).slash(entity.getId()).slash("accounts").withRel("contact-accounts"));
23 | return resource;
24 | }
25 |
26 | @Override
27 | protected ContactResource instantiateResource(Contact entity) {
28 | return new ContactResource(entity);
29 | }
30 |
31 | static class ContactResource extends Resource {
32 | public ContactResource(Contact contact) {
33 | super(contact);
34 | }
35 | }
36 |
37 | }
38 | // end::ResourceAssembler[]
--------------------------------------------------------------------------------
/kata4/solution2/mysvc/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.2.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | project.ext {
18 | springBootVersion = '1.3.1.RELEASE'
19 | springCloudVersion = '1.0.3.RELEASE'
20 | }
21 |
22 | jar {
23 | baseName = 'mysvc'
24 | version = '0.0.1'
25 | group = 'msvcdojo'
26 | }
27 | sourceCompatibility = 1.8
28 | targetCompatibility = 1.8
29 |
30 | repositories {
31 | mavenCentral()
32 | }
33 |
34 | dependencies {
35 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
36 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
37 | }
38 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
39 | exclude group: 'org.eclipse.jetty.websocket'
40 | }
41 | compile("org.springframework.boot:spring-boot-starter-actuator:$springBootVersion")
42 | compile("org.springframework.cloud:spring-cloud-starter-config:$springCloudVersion")
43 | testCompile('org.springframework.boot:spring-boot-starter-test')
44 | }
45 |
46 | task wrapper(type: Wrapper) {
47 | gradleVersion = '2.9'
48 | }
49 |
--------------------------------------------------------------------------------
/kata1/solution/mysvc/src/test/java/msvcdojo/HomeControllerTest.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.junit.Before;
4 | import org.junit.Test;
5 | import org.junit.runner.RunWith;
6 | import org.springframework.boot.test.SpringApplicationConfiguration;
7 | import org.springframework.http.MediaType;
8 | import org.springframework.mock.web.MockServletContext;
9 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
10 | import org.springframework.test.context.web.WebAppConfiguration;
11 | import org.springframework.test.web.servlet.MockMvc;
12 | import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
13 | import org.springframework.test.web.servlet.setup.MockMvcBuilders;
14 |
15 | import static org.hamcrest.Matchers.equalTo;
16 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
17 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
18 |
19 | // tag::test[]
20 | @RunWith(SpringJUnit4ClassRunner.class)
21 | @SpringApplicationConfiguration(classes = MockServletContext.class)
22 | @WebAppConfiguration
23 | public class HomeControllerTest {
24 |
25 | private MockMvc mvc;
26 |
27 | @Before
28 | public void setUp() throws Exception {
29 | mvc = MockMvcBuilders.standaloneSetup(new HomeController()).build();
30 | }
31 |
32 | @Test
33 | public void getHello() throws Exception {
34 | mvc.perform(MockMvcRequestBuilders.get("/").accept(MediaType.APPLICATION_JSON))
35 | .andExpect(status().isOk())
36 | .andExpect(content().string(equalTo("Hello World!")));
37 | }
38 | }
39 | // end::test[]
--------------------------------------------------------------------------------
/kata1/solution/mysvc/src/test/java/msvcdojo/HomeControllerIT.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.junit.Before;
4 | import org.junit.Test;
5 | import org.junit.runner.RunWith;
6 | import org.springframework.beans.factory.annotation.Value;
7 | import org.springframework.boot.test.IntegrationTest;
8 | import org.springframework.boot.test.SpringApplicationConfiguration;
9 | import org.springframework.boot.test.TestRestTemplate;
10 | import org.springframework.http.ResponseEntity;
11 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
12 | import org.springframework.test.context.web.WebAppConfiguration;
13 | import org.springframework.web.client.RestTemplate;
14 |
15 | import java.net.URL;
16 |
17 | import static org.hamcrest.Matchers.equalTo;
18 | import static org.junit.Assert.assertThat;
19 |
20 | // tag::test[]
21 | @RunWith(SpringJUnit4ClassRunner.class)
22 | @SpringApplicationConfiguration(classes = MysvcApplication.class)
23 | @WebAppConfiguration
24 | @IntegrationTest({"server.port=0"})
25 | public class HomeControllerIT {
26 |
27 | @Value("${local.server.port}")
28 | private int port;
29 |
30 | private URL base;
31 | private RestTemplate template;
32 |
33 | @Before
34 | public void setUp() throws Exception {
35 | this.base = new URL("http://localhost:" + port + "/");
36 | template = new TestRestTemplate();
37 | }
38 |
39 | @Test
40 | public void getHello() throws Exception {
41 | ResponseEntity response = template.getForEntity(base.toString(), String.class);
42 | assertThat(response.getBody(), equalTo("Hello World!"));
43 | }
44 | }
45 | // end::test[]
46 |
--------------------------------------------------------------------------------
/kata3/start/accounts-service/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.1.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | project.ext {
18 | springBootVersion = '1.3.1.RELEASE'
19 | springCloudVersion = '1.0.3.RELEASE'
20 | }
21 |
22 | jar {
23 | group = 'msvcdojo'
24 | baseName = 'accounts-service'
25 | version = '0.0.1'
26 | }
27 |
28 | sourceCompatibility = 1.8
29 | targetCompatibility = 1.8
30 |
31 | repositories {
32 | mavenCentral()
33 | }
34 |
35 | bootRun {
36 | // support passing -Dsystem.property=value to bootRun task
37 | systemProperties = System.properties
38 | }
39 |
40 | test {
41 | // support passing -Dsystem.property=value to bootRun task
42 | systemProperties = System.properties
43 | }
44 |
45 | dependencies {
46 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
47 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
48 | }
49 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
50 | exclude group: 'org.eclipse.jetty.websocket'
51 | }
52 | compile("org.springframework.boot:spring-boot-starter-actuator:$springBootVersion")
53 | testCompile('org.springframework.boot:spring-boot-starter-test')
54 | }
55 |
56 | task wrapper(type: org.gradle.api.tasks.wrapper.Wrapper) {
57 | gradleVersion = '2.9'
58 | }
59 |
--------------------------------------------------------------------------------
/kata-elk/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | ast (2.0.0)
5 | astrolabe (1.3.0)
6 | parser (>= 2.2.0.pre.3, < 3.0)
7 | bson (3.0.3)
8 | diff-lcs (1.2.5)
9 | domain_name (0.5.24)
10 | unf (>= 0.0.5, < 1.0.0)
11 | http-cookie (1.0.2)
12 | domain_name (~> 0.5)
13 | mime-types (2.6.1)
14 | mongo (2.0.4)
15 | bson (~> 3.0)
16 | multi_json (1.11.0)
17 | netrc (0.10.3)
18 | orientdb4r (0.5.1)
19 | rest-client (~> 1.7)
20 | parser (2.2.2.5)
21 | ast (>= 1.1, < 3.0)
22 | powerpack (0.1.1)
23 | rainbow (2.0.0)
24 | rake (10.4.2)
25 | rest-client (1.8.0)
26 | http-cookie (>= 1.0.2, < 2.0)
27 | mime-types (>= 1.16, < 3.0)
28 | netrc (~> 0.7)
29 | rspec (3.2.0)
30 | rspec-core (~> 3.2.0)
31 | rspec-expectations (~> 3.2.0)
32 | rspec-mocks (~> 3.2.0)
33 | rspec-core (3.2.3)
34 | rspec-support (~> 3.2.0)
35 | rspec-expectations (3.2.1)
36 | diff-lcs (>= 1.2.0, < 2.0)
37 | rspec-support (~> 3.2.0)
38 | rspec-mocks (3.2.1)
39 | diff-lcs (>= 1.2.0, < 2.0)
40 | rspec-support (~> 3.2.0)
41 | rspec-support (3.2.2)
42 | rubocop (0.31.0)
43 | astrolabe (~> 1.3)
44 | parser (>= 2.2.2.1, < 3.0)
45 | powerpack (~> 0.1)
46 | rainbow (>= 1.99.1, < 3.0)
47 | ruby-progressbar (~> 1.4)
48 | ruby-progressbar (1.7.5)
49 | unf (0.1.4)
50 | unf_ext
51 | unf_ext (0.0.7.1)
52 |
53 | PLATFORMS
54 | ruby
55 |
56 | DEPENDENCIES
57 | bundler
58 | mongo (~> 2.0)
59 | multi_json
60 | orientdb4r
61 | rake
62 | rspec
63 | rubocop
64 |
65 | BUNDLED WITH
66 | 1.10.2
67 |
--------------------------------------------------------------------------------
/kata2/solution/mysvc/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.2.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | jar {
18 | baseName = Name
19 | version = Version
20 | group = Group
21 | }
22 |
23 | sourceCompatibility = SourceCompatibility
24 | targetCompatibility = SourceCompatibility
25 |
26 | repositories {
27 | mavenCentral()
28 | }
29 |
30 | dependencies {
31 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
32 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
33 | }
34 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
35 | exclude group: 'org.eclipse.jetty.websocket'
36 | }
37 | compile('org.springframework.boot:spring-boot-starter-actuator')
38 | compile('org.springframework.boot:spring-boot-actuator-docs')
39 | testCompile('org.springframework.boot:spring-boot-starter-test')
40 | }
41 |
42 | // tag::docker[]
43 | task prepDocker(type: Copy, dependsOn: assemble) {
44 | from 'docker'
45 | into "$buildDir/docker"
46 | include 'Dockerfile.template'
47 | rename { file -> 'Dockerfile' }
48 | expand(project: project, jar: jar )
49 | doFirst {
50 | copy {
51 | from jar
52 | into "$buildDir/docker"
53 | }
54 | }
55 | doLast {
56 | println "Docker command: docker build -t ${jar.group}/${jar.baseName}:${jar.version} build/docker"
57 | }
58 | }
59 | // end::docker[]
60 |
61 | task wrapper(type: Wrapper) {
62 | gradleVersion = '2.9'
63 | }
64 |
--------------------------------------------------------------------------------
/kata1/solution/mysvc/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.2.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | jar {
18 | baseName = 'mysvc'
19 | version = '0.0.1'
20 | group = 'msvcdojo'
21 | }
22 | sourceCompatibility = 1.8
23 | targetCompatibility = 1.8
24 |
25 | repositories {
26 | mavenCentral()
27 | }
28 |
29 | dependencies {
30 | // tag::jetty[]
31 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
32 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
33 | }
34 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
35 | exclude group: 'org.eclipse.jetty.websocket'
36 | }
37 | // end::jetty[]
38 | // tag::actuator[]
39 | compile('org.springframework.boot:spring-boot-starter-actuator')
40 | // tag::actuator-docs[]
41 | compile('org.springframework.boot:spring-boot-actuator-docs')
42 | // end::actuator-docs[]
43 | // end::actuator[]
44 | testCompile('org.springframework.boot:spring-boot-starter-test')
45 | }
46 |
47 | // tag::test[]
48 | test {
49 | testLogging {
50 | afterSuite { desc, result ->
51 | if (!desc.parent) {
52 | println "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
53 | }
54 | }
55 | }
56 | reports {
57 | junitXml.enabled = false
58 | html.enabled = true
59 | }
60 | }
61 | // end::test[]
62 |
63 | task wrapper(type: Wrapper) {
64 | gradleVersion = '2.9'
65 | }
66 |
--------------------------------------------------------------------------------
/guides/src/kata7/circuit_breakers.adoc:
--------------------------------------------------------------------------------
1 | :kata_dir: kata7
2 | :sourcedir: ../../../{kata_dir}
3 | include::../header.adoc[]
4 |
5 | == Circuit Breaker pattern
6 |
7 | TIP: This Kata is based on the assumption that you're running the Config service,
8 | Eureka service (Kata6) and Profiles Service (Kata6) in Docker.
9 |
10 | WARNING: Under constructions
11 |
12 | === Enabling Hystrix in your application
13 |
14 | Make sure that you have Actuator in your class-path
15 |
16 | [source,groovy,indent=0]
17 | .accounts-service/build.gradle
18 | ----
19 | include::{sourcedir}/solution/accounts-service/build.gradle[tags=enable-actuator]
20 | ----
21 |
22 | Add Hystrix to your application's class-path:
23 | [source,groovy,indent=0]
24 | .accounts-service/build.gradle
25 | ----
26 | include::{sourcedir}/solution/accounts-service/build.gradle[tags=enable-hystrix]
27 | ----
28 |
29 | Annotate your application with `@EnableHystrix`:
30 | [source,java,indent=0]
31 | .src/main/java/msvcdojo/AccountServiceApplication.java
32 | ----
33 | include::{sourcedir}/solution/accounts-service/src/main/java/msvcdojo/AccountsServiceApplication.java[tags=enable-hystrix]
34 | ----
35 |
36 | Open http://dockerhost:7980 to get to the Hystrix dashboard:
37 |
38 | image::hystrix_dashboard.png[]
39 |
40 | == Stressing circuit breakers
41 |
42 | WARNING: Under construction
43 |
44 | No problems detected in the application - everything is normal:
45 |
46 | image::hystrix_dashboard_stream.png[]
47 |
48 | When one of the dependencies goes down, system detects errors - note red circle and error count:
49 |
50 | image::hystrix_dashboard_stream_error.png[]
51 |
52 | When the amount of errors goes over a threshold - circuit breaker trips (notice "Open" status):
53 |
54 | image::hystrix_dashboard_stream_error_open.png[]
55 |
56 | == Turbine dashboard
57 |
58 | WARNING: Under construction
59 |
--------------------------------------------------------------------------------
/kata3/solution1/accounts-service/src/main/java/msvcdojo/AccountsServiceApplication.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.data.jpa.repository.JpaRepository;
6 | import org.springframework.data.repository.query.Param;
7 | import org.springframework.data.rest.core.annotation.RepositoryRestResource;
8 |
9 | import javax.persistence.Entity;
10 | import javax.persistence.GeneratedValue;
11 | import javax.persistence.Id;
12 | import java.util.List;
13 |
14 | /**
15 | * @author Igor Moochnick
16 | */
17 | @SpringBootApplication
18 | public class AccountsServiceApplication {
19 |
20 | public static void main(String[] args) {
21 | SpringApplication.run(AccountsServiceApplication.class, args);
22 | }
23 | }
24 |
25 | // tag::data-repository[]
26 | @RepositoryRestResource
27 | interface AccountRepository extends JpaRepository {
28 | List findByUsername(@Param("username") String username);
29 | }
30 | // end::data-repository[]
31 |
32 |
33 | // tag::data-model[]
34 | @Entity
35 | class Account {
36 |
37 | public String getUsername() {
38 | return username;
39 | }
40 |
41 | public Long getId() {
42 | return id;
43 | }
44 |
45 | @Id
46 | @GeneratedValue
47 | private Long id;
48 |
49 | private String username;
50 |
51 | Account() { // JPA only
52 | }
53 |
54 | public Account(String username) {
55 | this.username = username;
56 | }
57 |
58 | @Override
59 | public String toString() {
60 | final StringBuilder sb = new StringBuilder("User{");
61 | sb.append("id=").append(id);
62 | sb.append(", username='").append(username).append('\'');
63 | sb.append('}');
64 | return sb.toString();
65 | }
66 | }
67 | // end::data-model[]
68 |
--------------------------------------------------------------------------------
/guides/src/kata-web-client/web-client-basics.adoc:
--------------------------------------------------------------------------------
1 | :toc: left
2 | :icons: font
3 | :source-highlighter: coderay
4 | :kata_dir: kata-web-client
5 | :sourcedir: ../../../{kata_dir}
6 |
7 | == Basics of Web Client
8 |
9 | We're going to use https://angularjs.org/[AngularJS^] to build our web client.
10 |
11 | IMPORTANT: We're in the JavaScript world. Make sure you have appropriate
12 | tools installed to work with JavaScript, i.e.: https://nodejs.org/en/[node.js^],
13 | npm
14 |
15 | === Getting Started
16 |
17 | Clone a quick-start project for AngularJS client.
18 |
19 | ....
20 | $ git clone https://github.com/Accordance/angular2-quickstart
21 | ....
22 |
23 | Bring all the required dependencies:
24 | ....
25 | $ npm install
26 | ....
27 |
28 | Compile the code (here we're using TypeScript) and launch light web server:
29 | [source,text,options="nowrap"]
30 | ....
31 | $ npm start
32 |
33 | > angular2-quickstart@0.1.0 start /angular2-quickstart
34 | > concurrent "npm run tsc:w" "npm run lite"
35 |
36 | [0]
37 | [0] > angular2-quickstart@0.1.0 tsc:w /angular2-quickstart
38 | [0] > tsc -w
39 | [0]
40 | [1]
41 | [1] > angular2-quickstart@0.1.0 lite /angular2-quickstart
42 | [1] > lite-server
43 | [1]
44 | [0] 5:31:10 PM - Compilation complete. Watching for file changes.
45 | [1] [BS] Access URLs:
46 | [1] -------------------------------------
47 | [1] Local: http://localhost:3000
48 | [1] External: http://192.168.99.1:3000
49 | [1] -------------------------------------
50 | [1] UI: http://localhost:3001
51 | [1] UI External: http://192.168.99.1:3001
52 | [1] -------------------------------------
53 | [1] [BS] Serving files from: ./
54 | [1] [BS] Watching files...
55 | ....
56 |
57 | At this moment your web browser will pop up with a "home" page of the Web client.
58 |
59 | === Play time
60 |
61 | . Navigate to 'Page 1' and edit the text field
62 | . On 'Page 1' click on 'Say Hello' button
63 | . Navigate to 'Page 2' and select any item from the list
64 |
--------------------------------------------------------------------------------
/kata6/start/accounts-service/src/main/java/msvcdojo/AccountsServiceApplication.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.data.jpa.repository.JpaRepository;
6 | import org.springframework.data.repository.query.Param;
7 | import org.springframework.data.rest.core.annotation.RepositoryRestResource;
8 |
9 | import javax.persistence.Entity;
10 | import javax.persistence.GeneratedValue;
11 | import javax.persistence.Id;
12 | import java.util.List;
13 |
14 | /**
15 | * @author Igor Moochnick
16 | */
17 | @SpringBootApplication
18 | public class AccountsServiceApplication {
19 |
20 | public static void main(String[] args) {
21 | SpringApplication.run(AccountsServiceApplication.class, args);
22 | }
23 | }
24 |
25 | @RepositoryRestResource
26 | interface AccountRepository extends JpaRepository {
27 | List findByUsername(@Param("username") String username);
28 |
29 | List findByRole(@Param("role") String role);
30 | }
31 |
32 |
33 | @Entity
34 | class Account {
35 |
36 | @Id
37 | @GeneratedValue
38 | private Long id;
39 |
40 | private String username;
41 |
42 | private String role;
43 | public String getRole() { return role; }
44 |
45 | Account() { // JPA only
46 | }
47 |
48 | public String getUsername() {
49 | return username;
50 | }
51 | public Long getId() {
52 | return id;
53 | }
54 |
55 | public Account(String username) {
56 | this.username = username;
57 | }
58 |
59 | @Override
60 | public String toString() {
61 | final StringBuilder sb = new StringBuilder("User{");
62 | sb.append("id=").append(id);
63 | sb.append(", username='").append(username).append('\'');
64 | sb.append(", role='").append(role).append('\'');
65 | sb.append('}');
66 | return sb.toString();
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/kata3/solution2/accounts-service/src/main/java/msvcdojo/AccountsServiceApplication.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.data.jpa.repository.JpaRepository;
6 | import org.springframework.data.repository.query.Param;
7 | import org.springframework.data.rest.core.annotation.RepositoryRestResource;
8 |
9 | import javax.persistence.Entity;
10 | import javax.persistence.GeneratedValue;
11 | import javax.persistence.Id;
12 | import java.util.List;
13 |
14 | /**
15 | * @author Igor Moochnick
16 | */
17 | @SpringBootApplication
18 | public class AccountsServiceApplication {
19 |
20 | public static void main(String[] args) {
21 | SpringApplication.run(AccountsServiceApplication.class, args);
22 | }
23 | }
24 |
25 | @RepositoryRestResource
26 | interface AccountRepository extends JpaRepository {
27 | List findByUsername(@Param("username") String username);
28 |
29 | // tag::findByRole[]
30 | List findByRole(@Param("role") String role);
31 | // end::findByRole[]
32 | }
33 |
34 |
35 | @Entity
36 | class Account {
37 |
38 | public Long getId() {
39 | return id;
40 | }
41 | public String getUsername() {
42 | return username;
43 | }
44 |
45 | @Id
46 | @GeneratedValue
47 | private Long id;
48 |
49 | private String username;
50 |
51 | // tag::data-model[]
52 | private String role;
53 | public String getRole() { return role; }
54 | // end::data-model[]
55 |
56 | Account() { // JPA only
57 | }
58 |
59 | public Account(String username) {
60 | this.username = username;
61 | }
62 |
63 | @Override
64 | public String toString() {
65 | final StringBuilder sb = new StringBuilder("User{");
66 | sb.append("id=").append(id);
67 | sb.append(", username='").append(username).append('\'');
68 | sb.append(", role='").append(role).append('\'');
69 | sb.append('}');
70 | return sb.toString();
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/kata4/solution2/config-service/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.1.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | // tag::config-vars[]
18 | project.ext {
19 | springBootVersion = '1.3.1.RELEASE'
20 | springCloudVersion = '1.0.3.RELEASE'
21 | }
22 | // end::config-vars[]
23 |
24 | jar {
25 | group = 'msvcdojo'
26 | baseName = 'config-service'
27 | version = '0.0.1'
28 | }
29 |
30 | sourceCompatibility = 1.8
31 | targetCompatibility = 1.8
32 |
33 | repositories {
34 | mavenCentral()
35 | maven { url 'http://repo.spring.io/release' }
36 | }
37 |
38 | dependencies {
39 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
40 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
41 | }
42 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
43 | exclude group: 'org.eclipse.jetty.websocket'
44 | }
45 | // tag::config-server[]
46 | compile("org.springframework.boot:spring-boot-starter-actuator:$springBootVersion")
47 | compile("org.springframework.cloud:spring-cloud-config-server:$springCloudVersion")
48 | // end::config-server[]
49 | testCompile('org.springframework.boot:spring-boot-starter-test')
50 | }
51 |
52 | task prepDocker(type: Copy, dependsOn: assemble) {
53 | from 'docker'
54 | into "$buildDir/docker"
55 | include 'Dockerfile.template'
56 | rename { file -> 'Dockerfile' }
57 | expand ( project: project, jar: jar )
58 | doFirst {
59 | copy {
60 | from jar
61 | into "$buildDir/docker"
62 | }
63 | }
64 | doLast {
65 | println "Docker command: docker build -t ${jar.group}/${jar.baseName}:${jar.version} build/docker"
66 | }
67 | }
68 |
69 | task wrapper(type: Wrapper) {
70 | gradleVersion = '2.9'
71 | }
72 |
--------------------------------------------------------------------------------
/kata6/solution1/eureka-service/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.1.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | project.ext {
18 | springBootVersion = '1.3.1.RELEASE'
19 | springCloudVersion = '1.0.3.RELEASE'
20 | }
21 |
22 | jar {
23 | group = 'msvcdojo'
24 | baseName = 'eureka-service'
25 | version = '0.0.1'
26 | }
27 |
28 | sourceCompatibility = 1.8
29 | targetCompatibility = 1.8
30 |
31 | repositories {
32 | mavenCentral()
33 | }
34 |
35 | bootRun {
36 | // support passing -Dsystem.property=value to bootRun task
37 | systemProperties = System.properties
38 | }
39 |
40 | dependencies {
41 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
42 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
43 | }
44 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
45 | exclude group: 'org.eclipse.jetty.websocket'
46 | }
47 | // tag::eureka[]
48 | compile("org.springframework.cloud:spring-cloud-starter-eureka-server:$springCloudVersion")
49 | // end::eureka[]
50 | compile("org.springframework.cloud:spring-cloud-config-client:$springCloudVersion")
51 | testCompile('org.springframework.boot:spring-boot-starter-test')
52 | }
53 |
54 | task prepDocker(type: Copy, dependsOn: assemble) {
55 | from 'docker'
56 | into "$buildDir/docker"
57 | include 'Dockerfile.template'
58 | rename { file -> 'Dockerfile' }
59 | expand(project: project, jar: jar )
60 | doFirst {
61 | copy {
62 | from jar
63 | into "$buildDir/docker"
64 | }
65 | }
66 | doLast {
67 | println "Docker command: docker build -t ${jar.group}/${jar.baseName}:${jar.version} build/docker"
68 | }
69 | }
70 |
71 | task wrapper(type: Wrapper) {
72 | gradleVersion = '2.9'
73 | }
74 |
--------------------------------------------------------------------------------
/kata6/solution2/eureka-service/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.1.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | project.ext {
18 | springBootVersion = '1.3.1.RELEASE'
19 | springCloudVersion = '1.0.3.RELEASE'
20 | }
21 |
22 | jar {
23 | group = 'msvcdojo'
24 | baseName = 'eureka-service'
25 | version = '0.0.1'
26 | }
27 |
28 | sourceCompatibility = 1.8
29 | targetCompatibility = 1.8
30 |
31 | repositories {
32 | mavenCentral()
33 | }
34 |
35 | bootRun {
36 | // support passing -Dsystem.property=value to bootRun task
37 | systemProperties = System.properties
38 | }
39 |
40 | dependencies {
41 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
42 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
43 | }
44 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
45 | exclude group: 'org.eclipse.jetty.websocket'
46 | }
47 | // tag::eureka[]
48 | compile("org.springframework.cloud:spring-cloud-starter-eureka-server:$springCloudVersion")
49 | // end::eureka[]
50 | compile("org.springframework.cloud:spring-cloud-config-client:$springCloudVersion")
51 | testCompile('org.springframework.boot:spring-boot-starter-test')
52 | }
53 |
54 | task prepDocker(type: Copy, dependsOn: assemble) {
55 | from 'docker'
56 | into "$buildDir/docker"
57 | include 'Dockerfile.template'
58 | rename { file -> 'Dockerfile' }
59 | expand(project: project, jar: jar )
60 | doFirst {
61 | copy {
62 | from jar
63 | into "$buildDir/docker"
64 | }
65 | }
66 | doLast {
67 | println "Docker command: docker build -t ${jar.group}/${jar.baseName}:${jar.version} build/docker"
68 | }
69 | }
70 |
71 | task wrapper(type: Wrapper) {
72 | gradleVersion = '2.9'
73 | }
74 |
--------------------------------------------------------------------------------
/kata-swagger/start/accounts-service/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.1.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | project.ext {
18 | springBootVersion = '1.3.1.RELEASE'
19 | springCloudVersion = '1.0.3.RELEASE'
20 | }
21 |
22 | jar {
23 | group = 'msvcdojo'
24 | baseName = 'accounts-service'
25 | version = '0.0.1'
26 | }
27 |
28 | sourceCompatibility = 1.8
29 | targetCompatibility = 1.8
30 |
31 | repositories {
32 | mavenCentral()
33 | }
34 |
35 | bootRun {
36 | // support passing -Dsystem.property=value to bootRun task
37 | systemProperties = System.properties
38 | }
39 |
40 | test {
41 | // support passing -Dsystem.property=value to bootRun task
42 | systemProperties = System.properties
43 | }
44 |
45 | dependencies {
46 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
47 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
48 | }
49 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
50 | exclude group: 'org.eclipse.jetty.websocket'
51 | }
52 | compile("org.springframework.boot:spring-boot-starter-actuator:$springBootVersion")
53 | testCompile('org.springframework.boot:spring-boot-starter-test')
54 | }
55 |
56 | task prepDocker(type: Copy, dependsOn: assemble) {
57 | from 'docker'
58 | into "$buildDir/docker"
59 | include 'Dockerfile.template'
60 | rename { file -> 'Dockerfile' }
61 | expand(project: project, jar: jar)
62 | doFirst {
63 | copy {
64 | from jar
65 | into "$buildDir/docker"
66 | }
67 | }
68 | doLast {
69 | println "Docker command: docker build -t ${jar.group}/${jar.baseName}:${jar.version} build/docker"
70 | }
71 | }
72 |
73 | task wrapper(type: org.gradle.api.tasks.wrapper.Wrapper) {
74 | gradleVersion = '2.9'
75 | }
76 |
--------------------------------------------------------------------------------
/kata5/start/profiles-service/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.1.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | project.ext {
18 | springBootVersion = '1.3.1.RELEASE'
19 | springCloudVersion = '1.0.3.RELEASE'
20 | }
21 |
22 | jar {
23 | group = 'msvcdojo'
24 | baseName = 'profiles-service'
25 | version = '0.0.1'
26 | }
27 |
28 | sourceCompatibility = 1.8
29 | targetCompatibility = 1.8
30 |
31 | repositories {
32 | mavenCentral()
33 | }
34 |
35 | bootRun {
36 | // support passing -Dsystem.property=value to bootRun task
37 | systemProperties = System.properties
38 | }
39 |
40 | test {
41 | // support passing -Dsystem.property=value to bootRun task
42 | systemProperties = System.properties
43 | }
44 |
45 | dependencies {
46 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
47 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
48 | }
49 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
50 | exclude group: 'org.eclipse.jetty.websocket'
51 | }
52 | compile("org.springframework.cloud:spring-cloud-config-client:$springCloudVersion")
53 | compile("org.springframework.boot:spring-boot-starter-actuator:$springBootVersion")
54 | testCompile('org.springframework.boot:spring-boot-starter-test')
55 | }
56 |
57 | task prepDocker(type: Copy, dependsOn: build) {
58 | from 'docker'
59 | into "$buildDir/docker"
60 | include 'Dockerfile.template'
61 | rename { file -> 'Dockerfile' }
62 | expand(project: project, jar: jar )
63 | doFirst {
64 | copy {
65 | from jar
66 | into "$buildDir/docker"
67 | }
68 | }
69 | doLast {
70 | println "Docker command: docker build -t ${jar.group}/${jar.baseName}:${jar.version} build/docker"
71 | }
72 | }
73 |
74 | task wrapper(type: org.gradle.api.tasks.wrapper.Wrapper) {
75 | gradleVersion = '2.9'
76 | }
77 |
--------------------------------------------------------------------------------
/kata8/solution1/gateway-service/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.1.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | project.ext {
18 | springBootVersion = '1.3.1.RELEASE'
19 | springCloudVersion = '1.0.3.RELEASE'
20 | }
21 |
22 | jar {
23 | group = 'msvcdojo'
24 | baseName = 'gateway-service'
25 | version = '0.0.1'
26 | }
27 |
28 | sourceCompatibility = 1.8
29 | targetCompatibility = 1.8
30 |
31 | repositories {
32 | mavenCentral()
33 | }
34 |
35 | bootRun {
36 | // support passing -Dsystem.property=value to bootRun task
37 | systemProperties = System.properties
38 | }
39 |
40 | dependencies {
41 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
42 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
43 | }
44 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
45 | exclude group: 'org.eclipse.jetty.websocket'
46 | }
47 | compile("org.springframework.cloud:spring-cloud-config-client:$springCloudVersion")
48 | compile("org.springframework.cloud:spring-cloud-starter-eureka:$springCloudVersion")
49 | compile("org.springframework.cloud:spring-cloud-netflix-core:$springCloudVersion")
50 | // tag::zuul[]
51 | compile("org.springframework.cloud:spring-cloud-starter-zuul:$springCloudVersion")
52 | // end::zuul[]
53 | testCompile('org.springframework.boot:spring-boot-starter-test')
54 | }
55 |
56 | task prepDocker(type: Copy, dependsOn: assemble) {
57 | from 'docker'
58 | into "$buildDir/docker"
59 | include 'Dockerfile.template'
60 | rename { file -> 'Dockerfile' }
61 | expand(project: project, jar: jar )
62 | doFirst {
63 | copy {
64 | from jar
65 | into "$buildDir/docker"
66 | }
67 | }
68 | doLast {
69 | println "Docker command: docker build -t ${jar.group}/${jar.baseName}:${jar.version} build/docker"
70 | }
71 | }
72 |
73 | task wrapper(type: Wrapper) {
74 | gradleVersion = '2.9'
75 | }
--------------------------------------------------------------------------------
/kata-swagger/solution/accounts-service/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.1.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | project.ext {
18 | springBootVersion = '1.3.1.RELEASE'
19 | springCloudVersion = '1.0.3.RELEASE'
20 | }
21 |
22 | jar {
23 | group = 'msvcdojo'
24 | baseName = 'accounts-service'
25 | version = '0.0.1'
26 | }
27 |
28 | sourceCompatibility = 1.8
29 | targetCompatibility = 1.8
30 |
31 | repositories {
32 | mavenCentral()
33 | }
34 |
35 | bootRun {
36 | // support passing -Dsystem.property=value to bootRun task
37 | systemProperties = System.properties
38 | }
39 |
40 | test {
41 | // support passing -Dsystem.property=value to bootRun task
42 | systemProperties = System.properties
43 | }
44 |
45 | dependencies {
46 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
47 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
48 | }
49 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
50 | exclude group: 'org.eclipse.jetty.websocket'
51 | }
52 | compile("org.springframework.boot:spring-boot-starter-actuator:$springBootVersion")
53 | testCompile('org.springframework.boot:spring-boot-starter-test')
54 |
55 | // tag::swagger[]
56 | compile("io.springfox:springfox-swagger2:2.2.2")
57 | compile("io.springfox:springfox-swagger-ui:2.2.2")
58 | // end::swagger[]
59 | }
60 |
61 | task prepDocker(type: Copy, dependsOn: assemble) {
62 | from 'docker'
63 | into "$buildDir/docker"
64 | include 'Dockerfile.template'
65 | rename { file -> 'Dockerfile' }
66 | expand(project: project, jar: jar)
67 | doFirst {
68 | copy {
69 | from jar
70 | into "$buildDir/docker"
71 | }
72 | }
73 | doLast {
74 | println "Docker command: docker build -t ${jar.group}/${jar.baseName}:${jar.version} build/docker"
75 | }
76 | }
77 |
78 | task wrapper(type: org.gradle.api.tasks.wrapper.Wrapper) {
79 | gradleVersion = '2.9'
80 | }
81 |
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/src/main/java/msvcdojo/AccountController.java:
--------------------------------------------------------------------------------
1 | package msvcdojo;
2 |
3 | import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
4 | import static org.springframework.web.bind.annotation.RequestMethod.GET;
5 |
6 | import com.google.common.collect.Lists;
7 |
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.web.bind.annotation.PathVariable;
10 | import org.springframework.web.bind.annotation.RequestMapping;
11 | import org.springframework.web.bind.annotation.RestController;
12 |
13 | import java.util.List;
14 |
15 | // tag::AccountController[]
16 | @RestController
17 | @RequestMapping(value = "/accounts", produces = "application/json")
18 | public class AccountController {
19 |
20 | @Autowired
21 | private AccountResourceAssembler accountResourceAssembler;
22 | @Autowired
23 | private ContactResourceAssembler contactResourceAssembler;
24 |
25 | List accounts = Lists.newArrayList(
26 | new Account(1, "John"),
27 | new Account(2, "Tim"),
28 | new Account(3, "Mike"));
29 |
30 | List contacts = Lists.newArrayList(
31 | new Contact(1, "Waltham, MA"),
32 | new Contact(2, "Boston, MA")
33 | );
34 |
35 | @RequestMapping(method = GET)
36 | NestedContentResource getAccounts() {
37 | //Link accountsLink = linkTo(AccountController.class).slash("/accounts").withSelfRel();
38 | NestedContentResource nestedContentResource =
39 | new NestedContentResource<>
40 | (this.accountResourceAssembler.toResources(accounts));
41 | nestedContentResource.add(linkTo(AccountController.class).withSelfRel());
42 | return nestedContentResource;
43 | }
44 |
45 | @RequestMapping(value = "/{id}", method = GET)
46 | AccountResourceAssembler.AccountResource getAccount(@PathVariable("id") int id) {
47 | return this.accountResourceAssembler.toResource(accounts.get(id-1));
48 | }
49 |
50 | @RequestMapping(value = "/{id}/contacts", method = GET)
51 | NestedContentResource getAccountContacts(@PathVariable("id") int id) {
52 | return new NestedContentResource<>
53 | (this.contactResourceAssembler.toResources(contacts));
54 | }
55 |
56 | }
57 | // end::AccountController[]
58 |
--------------------------------------------------------------------------------
/kata3/solution1/accounts-service/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.1.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | // tag::flyway-plugin-dep[]
11 | classpath("org.flywaydb:flyway-gradle-plugin:3.2.1")
12 | classpath("mysql:mysql-connector-java:5.1.38")
13 | // end::flyway-plugin-dep[]
14 | }
15 | }
16 |
17 | apply plugin: 'java'
18 | apply plugin: 'idea'
19 | apply plugin: 'spring-boot'
20 | // tag::flyway-plugin[]
21 | apply plugin: 'org.flywaydb.flyway'
22 | // end::flyway-plugin[]
23 |
24 | project.ext {
25 | springBootVersion = '1.3.1.RELEASE'
26 | springCloudVersion = '1.0.3.RELEASE'
27 | }
28 |
29 | jar {
30 | group = 'msvcdojo'
31 | baseName = 'accounts-service'
32 | version = '0.0.1'
33 | }
34 |
35 | sourceCompatibility = 1.8
36 | targetCompatibility = 1.8
37 |
38 | repositories {
39 | mavenCentral()
40 | }
41 |
42 | bootRun {
43 | // support passing -Dsystem.property=value to bootRun task
44 | systemProperties = System.properties
45 | }
46 |
47 | test {
48 | // support passing -Dsystem.property=value to bootRun task
49 | systemProperties = System.properties
50 | }
51 |
52 | dependencies {
53 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
54 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
55 | }
56 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
57 | exclude group: 'org.eclipse.jetty.websocket'
58 | }
59 | compile("org.springframework.boot:spring-boot-starter-actuator:$springBootVersion")
60 | // tag::jpa[]
61 | compile("org.springframework.boot:spring-boot-starter-data-jpa:$springBootVersion")
62 | compile("org.springframework.boot:spring-boot-starter-data-rest:$springBootVersion")
63 | runtime("mysql:mysql-connector-java:5.1.38")
64 | // end::jpa[]
65 | testCompile('org.springframework.boot:spring-boot-starter-test')
66 | }
67 |
68 | // tag::flyway[]
69 | flyway {
70 | url = 'jdbc:mysql://dockerhost:3306/demo'
71 | user = 'demo_user'
72 | password = 'demo_pass'
73 | }
74 | // end::flyway[]
75 |
76 | task wrapper(type: org.gradle.api.tasks.wrapper.Wrapper) {
77 | gradleVersion = '2.9'
78 | }
79 |
--------------------------------------------------------------------------------
/kata3/solution2/accounts-service/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.1.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | // tag::flyway-plugin-dep[]
11 | classpath("org.flywaydb:flyway-gradle-plugin:3.2.1")
12 | classpath("mysql:mysql-connector-java:5.1.38")
13 | // end::flyway-plugin-dep[]
14 | }
15 | }
16 |
17 | apply plugin: 'java'
18 | apply plugin: 'idea'
19 | apply plugin: 'spring-boot'
20 | // tag::flyway-plugin[]
21 | apply plugin: 'org.flywaydb.flyway'
22 | // end::flyway-plugin[]
23 |
24 | project.ext {
25 | springBootVersion = '1.3.1.RELEASE'
26 | springCloudVersion = '1.0.3.RELEASE'
27 | }
28 |
29 | jar {
30 | group = 'msvcdojo'
31 | baseName = 'accounts-service'
32 | version = '0.0.1'
33 | }
34 |
35 | sourceCompatibility = 1.8
36 | targetCompatibility = 1.8
37 |
38 | repositories {
39 | mavenCentral()
40 | }
41 |
42 | bootRun {
43 | // support passing -Dsystem.property=value to bootRun task
44 | systemProperties = System.properties
45 | }
46 |
47 | test {
48 | // support passing -Dsystem.property=value to bootRun task
49 | systemProperties = System.properties
50 | }
51 |
52 | dependencies {
53 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
54 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
55 | }
56 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
57 | exclude group: 'org.eclipse.jetty.websocket'
58 | }
59 | compile("org.springframework.boot:spring-boot-starter-actuator:$springBootVersion")
60 | // tag::jpa[]
61 | compile("org.springframework.boot:spring-boot-starter-data-jpa:$springBootVersion")
62 | compile("org.springframework.boot:spring-boot-starter-data-rest:$springBootVersion")
63 | runtime("mysql:mysql-connector-java:5.1.38")
64 | // end::jpa[]
65 | testCompile('org.springframework.boot:spring-boot-starter-test')
66 | }
67 |
68 | // tag::flyway[]
69 | flyway {
70 | url = 'jdbc:mysql://dockerhost:3306/demo'
71 | user = 'demo_user'
72 | password = 'demo_pass'
73 | }
74 | // end::flyway[]
75 |
76 | task wrapper(type: org.gradle.api.tasks.wrapper.Wrapper) {
77 | gradleVersion = '2.9'
78 | }
79 |
--------------------------------------------------------------------------------
/kata-spring-restdocs/solution/mysvc/build.gradle:
--------------------------------------------------------------------------------
1 | //tag::asciidoctor-config[]
2 | buildscript {
3 | repositories {
4 | mavenCentral()
5 | jcenter() //<1>
6 | }
7 | dependencies {
8 | classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.7.RELEASE")
9 | classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3' //<2>
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'eclipse'
15 | apply plugin: 'idea'
16 | apply plugin: 'spring-boot'
17 | apply plugin: 'org.asciidoctor.convert' //<3>
18 |
19 | repositories {
20 | mavenLocal()
21 | maven { url 'https://repo.spring.io/libs-snapshot' }
22 | mavenCentral()
23 | }
24 | //end::asciidoctor-config[]
25 |
26 | sourceCompatibility = 1.8
27 | targetCompatibility = 1.8
28 |
29 | dependencies {
30 | compile('org.springframework.boot:spring-boot-starter-hateoas')
31 | compile group: 'com.google.guava', name: 'guava', version: '12.0'
32 | testCompile 'com.jayway.jsonpath:json-path'
33 | testCompile 'org.springframework.boot:spring-boot-starter-test'
34 | // tag::dependency-spring-restdocs[]
35 | testCompile "org.springframework.restdocs:spring-restdocs-mockmvc:1.1.0.BUILD-SNAPSHOT"
36 | // end::dependency-spring-restdocs[]
37 | }
38 |
39 | //tag::asciidoctor-spring-restdoc-int[]
40 | ext { //<1>
41 | snippetsDir = file('build/generated-snippets')
42 | }
43 |
44 | test { //<2>
45 | outputs.dir snippetsDir
46 | }
47 |
48 | asciidoctor { //<3>
49 | sourceDir '../../../guides/src/kata-spring-restdocs'
50 | attributes 'snippets': snippetsDir
51 | inputs.dir snippetsDir
52 | dependsOn test
53 | }
54 | //end::asciidoctor-spring-restdoc-int[]
55 |
56 | jar {
57 | baseName = 'mysvc'
58 | version = '0.0.1-SNAPSHOT'
59 | dependsOn asciidoctor
60 | from ("${asciidoctor.outputDir}/html5") {
61 | into 'static/docs'
62 | }
63 | }
64 |
65 | task prepDocker(type: Copy, dependsOn: assemble) {
66 | from 'docker'
67 | into "$buildDir/docker"
68 | include 'Dockerfile.template'
69 | rename { file -> 'Dockerfile' }
70 | expand(project: project, jar: jar )
71 | doFirst {
72 | copy {
73 | from jar
74 | into "$buildDir/docker"
75 | }
76 | }
77 | doLast {
78 | println "Docker command: docker build -t ${jar.group}/${jar.baseName}:${jar.version} build/docker"
79 | }
80 | }
81 |
82 | task wrapper(type: Wrapper) {
83 | gradleVersion = '2.9'
84 | }
85 |
86 | eclipseJdt.onlyIf { false }
87 | cleanEclipseJdt.onlyIf { false }
88 |
--------------------------------------------------------------------------------
/kata7/solution/hystrix-service/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.1.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | project.ext {
18 | springBootVersion = '1.3.1.RELEASE'
19 | springCloudVersion = '1.0.3.RELEASE'
20 | }
21 |
22 | jar {
23 | group = 'msvcdojo'
24 | baseName = 'hystrix-service'
25 | version = '0.0.1'
26 | }
27 |
28 | sourceCompatibility = 1.8
29 | targetCompatibility = 1.8
30 |
31 | repositories {
32 | mavenCentral()
33 | }
34 |
35 | bootRun {
36 | // support passing -Dsystem.property=value to bootRun task
37 | systemProperties = System.properties
38 | }
39 |
40 | dependencies {
41 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
42 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
43 | }
44 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
45 | exclude group: 'org.eclipse.jetty.websocket'
46 | }
47 | compile("org.springframework.boot:spring-boot-starter-actuator:$springBootVersion")
48 | compile("org.springframework.cloud:spring-cloud-starter-eureka:$springCloudVersion")
49 | compile("org.springframework.cloud:spring-cloud-config-client:$springCloudVersion") {
50 | exclude group: 'ch.qos.logback', module: 'logback-classic'
51 | exclude group: 'org.slf4j', module: 'log4j-over-slf4j'
52 | }
53 | compile("org.springframework.cloud:spring-cloud-starter-hystrix-dashboard:$springCloudVersion")
54 | testCompile('org.springframework.boot:spring-boot-starter-test')
55 | }
56 |
57 | task prepDocker(type: Copy, dependsOn: assemble) {
58 | from 'docker'
59 | into "$buildDir/docker"
60 | include 'Dockerfile.template'
61 | rename { file -> 'Dockerfile' }
62 | expand(project: project, jar: jar )
63 | doFirst {
64 | copy {
65 | from jar
66 | into "$buildDir/docker"
67 | }
68 | }
69 | doLast {
70 | println "Docker command: docker build -t ${jar.group}/${jar.baseName}:${jar.version} build/docker"
71 | }
72 | }
73 |
74 | task wrapper(type: Wrapper) {
75 | gradleVersion = '2.9'
76 | }
77 |
--------------------------------------------------------------------------------
/kata6/start/profiles-service/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.1.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | project.ext {
18 | springBootVersion = '1.3.1.RELEASE'
19 | springCloudVersion = '1.0.3.RELEASE'
20 | }
21 |
22 | jar {
23 | group = 'msvcdojo'
24 | baseName = 'profiles-service'
25 | version = '0.0.1'
26 | }
27 |
28 | sourceCompatibility = 1.8
29 | targetCompatibility = 1.8
30 |
31 | repositories {
32 | mavenCentral()
33 | }
34 |
35 | bootRun {
36 | // support passing -Dsystem.property=value to bootRun task
37 | systemProperties = System.properties
38 | }
39 |
40 | test {
41 | // support passing -Dsystem.property=value to bootRun task
42 | systemProperties = System.properties
43 | }
44 |
45 | dependencies {
46 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
47 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
48 | }
49 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
50 | exclude group: 'org.eclipse.jetty.websocket'
51 | }
52 | compile("org.springframework.cloud:spring-cloud-config-client:$springCloudVersion")
53 | compile("org.springframework.boot:spring-boot-starter-actuator:$springBootVersion")
54 | compile("org.springframework.boot:spring-boot-starter-data-rest:$springBootVersion")
55 | compile("org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion")
56 | compile("org.springframework.hateoas:spring-hateoas")
57 | testCompile('org.springframework.boot:spring-boot-starter-test')
58 | }
59 |
60 | task prepDocker(type: Copy, dependsOn: build) {
61 | from 'docker'
62 | into "$buildDir/docker"
63 | include 'Dockerfile.template'
64 | rename { file -> 'Dockerfile' }
65 | expand(project: project, jar: jar )
66 | doFirst {
67 | copy {
68 | from jar
69 | into "$buildDir/docker"
70 | }
71 | }
72 | doLast {
73 | println "Docker command: docker build -t ${jar.group}/${jar.baseName}:${jar.version} build/docker"
74 | }
75 | }
76 |
77 | task wrapper(type: org.gradle.api.tasks.wrapper.Wrapper) {
78 | gradleVersion = '2.9'
79 | }
80 |
--------------------------------------------------------------------------------
/kata5/solution/profiles-service/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.1.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | project.ext {
18 | springBootVersion = '1.3.1.RELEASE'
19 | springCloudVersion = '1.0.3.RELEASE'
20 | }
21 |
22 | jar {
23 | group = 'msvcdojo'
24 | baseName = 'profiles-service'
25 | version = '0.0.1'
26 | }
27 |
28 | sourceCompatibility = 1.8
29 | targetCompatibility = 1.8
30 |
31 | repositories {
32 | mavenCentral()
33 | }
34 |
35 | bootRun {
36 | // support passing -Dsystem.property=value to bootRun task
37 | systemProperties = System.properties
38 | }
39 |
40 | test {
41 | // support passing -Dsystem.property=value to bootRun task
42 | systemProperties = System.properties
43 | }
44 |
45 | dependencies {
46 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
47 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
48 | }
49 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
50 | exclude group: 'org.eclipse.jetty.websocket'
51 | }
52 | compile("org.springframework.cloud:spring-cloud-config-client:$springCloudVersion")
53 | compile("org.springframework.boot:spring-boot-starter-actuator:$springBootVersion")
54 | // tag::mongo[]
55 | compile("org.springframework.boot:spring-boot-starter-data-rest:$springBootVersion")
56 | compile("org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion")
57 | compile("org.springframework.hateoas:spring-hateoas")
58 | // end::mongo[]
59 | testCompile('org.springframework.boot:spring-boot-starter-test')
60 | }
61 |
62 | task prepDocker(type: Copy, dependsOn: build) {
63 | from 'docker'
64 | into "$buildDir/docker"
65 | include 'Dockerfile.template'
66 | rename { file -> 'Dockerfile' }
67 | expand(project: project, jar: jar )
68 | doFirst {
69 | copy {
70 | from jar
71 | into "$buildDir/docker"
72 | }
73 | }
74 | doLast {
75 | println "Docker command: docker build -t ${jar.group}/${jar.baseName}:${jar.version} build/docker"
76 | }
77 | }
78 |
79 | task wrapper(type: org.gradle.api.tasks.wrapper.Wrapper) {
80 | gradleVersion = '2.9'
81 | }
82 |
--------------------------------------------------------------------------------
/kata6/solution1/profiles-service/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.1.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | project.ext {
18 | springBootVersion = '1.3.1.RELEASE'
19 | springCloudVersion = '1.0.3.RELEASE'
20 | }
21 |
22 | jar {
23 | group = 'msvcdojo'
24 | baseName = 'profiles-service'
25 | version = '0.0.2'
26 | }
27 |
28 | sourceCompatibility = 1.8
29 | targetCompatibility = 1.8
30 |
31 | repositories {
32 | mavenCentral()
33 | }
34 |
35 | bootRun {
36 | // support passing -Dsystem.property=value to bootRun task
37 | systemProperties = System.properties
38 | }
39 |
40 | test {
41 | // support passing -Dsystem.property=value to bootRun task
42 | systemProperties = System.properties
43 | }
44 |
45 | dependencies {
46 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
47 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
48 | }
49 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
50 | exclude group: 'org.eclipse.jetty.websocket'
51 | }
52 | compile("org.springframework.cloud:spring-cloud-config-client:$springCloudVersion")
53 | compile("org.springframework.boot:spring-boot-starter-actuator:$springBootVersion")
54 | // tag::eureka[]
55 | compile("org.springframework.cloud:spring-cloud-starter-eureka:$springCloudVersion")
56 | // end::eureka[]
57 | compile("org.springframework.boot:spring-boot-starter-data-rest:$springBootVersion")
58 | compile("org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion")
59 | compile("org.springframework.hateoas:spring-hateoas")
60 | testCompile('org.springframework.boot:spring-boot-starter-test')
61 | }
62 |
63 | task prepDocker(type: Copy, dependsOn: build) {
64 | from 'docker'
65 | into "$buildDir/docker"
66 | include 'Dockerfile.template'
67 | rename { file -> 'Dockerfile' }
68 | expand(project: project, jar: jar )
69 | doFirst {
70 | copy {
71 | from jar
72 | into "$buildDir/docker"
73 | }
74 | }
75 | doLast {
76 | println "Docker command: docker build -t ${jar.group}/${jar.baseName}:${jar.version} build/docker"
77 | }
78 | }
79 |
80 | task wrapper(type: org.gradle.api.tasks.wrapper.Wrapper) {
81 | gradleVersion = '2.9'
82 | }
83 |
--------------------------------------------------------------------------------
/kata6/solution2/profiles-service/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.1.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | }
11 | }
12 |
13 | apply plugin: 'java'
14 | apply plugin: 'idea'
15 | apply plugin: 'spring-boot'
16 |
17 | project.ext {
18 | springBootVersion = '1.3.1.RELEASE'
19 | springCloudVersion = '1.0.3.RELEASE'
20 | }
21 |
22 | jar {
23 | group = 'msvcdojo'
24 | baseName = 'profiles-service'
25 | version = '0.0.2'
26 | }
27 |
28 | sourceCompatibility = 1.8
29 | targetCompatibility = 1.8
30 |
31 | repositories {
32 | mavenCentral()
33 | }
34 |
35 | bootRun {
36 | // support passing -Dsystem.property=value to bootRun task
37 | systemProperties = System.properties
38 | }
39 |
40 | test {
41 | // support passing -Dsystem.property=value to bootRun task
42 | systemProperties = System.properties
43 | }
44 |
45 | dependencies {
46 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
47 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
48 | }
49 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
50 | exclude group: 'org.eclipse.jetty.websocket'
51 | }
52 | compile("org.springframework.cloud:spring-cloud-config-client:$springCloudVersion")
53 | compile("org.springframework.boot:spring-boot-starter-actuator:$springBootVersion")
54 | // tag::eureka[]
55 | compile("org.springframework.cloud:spring-cloud-starter-eureka:$springCloudVersion")
56 | // end::eureka[]
57 | compile("org.springframework.boot:spring-boot-starter-data-rest:$springBootVersion")
58 | compile("org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion")
59 | compile("org.springframework.hateoas:spring-hateoas")
60 | testCompile('org.springframework.boot:spring-boot-starter-test')
61 | }
62 |
63 | task prepDocker(type: Copy, dependsOn: build) {
64 | from 'docker'
65 | into "$buildDir/docker"
66 | include 'Dockerfile.template'
67 | rename { file -> 'Dockerfile' }
68 | expand(project: project, jar: jar )
69 | doFirst {
70 | copy {
71 | from jar
72 | into "$buildDir/docker"
73 | }
74 | }
75 | doLast {
76 | println "Docker command: docker build -t ${jar.group}/${jar.baseName}:${jar.version} build/docker"
77 | }
78 | }
79 |
80 | task wrapper(type: org.gradle.api.tasks.wrapper.Wrapper) {
81 | gradleVersion = '2.9'
82 | }
83 |
--------------------------------------------------------------------------------
/kata1/solution/mysvc/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/kata2/solution/mysvc/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/kata2/start/mysvc/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/kata4/solution1/mysvc/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/kata4/solution2/mysvc/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/kata4/start/mysvc/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/kata6/start/accounts-service/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '1.3.1.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10 | classpath("org.flywaydb:flyway-gradle-plugin:3.2.1")
11 | classpath("mysql:mysql-connector-java:5.1.38")
12 | }
13 | }
14 |
15 | apply plugin: 'java'
16 | apply plugin: 'idea'
17 | apply plugin: 'spring-boot'
18 | apply plugin: 'org.flywaydb.flyway'
19 |
20 | project.ext {
21 | springBootVersion = '1.3.1.RELEASE'
22 | springCloudVersion = '1.0.3.RELEASE'
23 | }
24 |
25 | jar {
26 | group = 'msvcdojo'
27 | baseName = 'accounts-service'
28 | version = '0.0.1'
29 | }
30 |
31 | sourceCompatibility = 1.8
32 | targetCompatibility = 1.8
33 |
34 | repositories {
35 | mavenCentral()
36 | }
37 |
38 | bootRun {
39 | // support passing -Dsystem.property=value to bootRun task
40 | systemProperties = System.properties
41 | }
42 |
43 | test {
44 | // support passing -Dsystem.property=value to bootRun task
45 | systemProperties = System.properties
46 | }
47 |
48 | dependencies {
49 | compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") {
50 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
51 | }
52 | compile ('org.springframework.boot:spring-boot-starter-jetty') {
53 | exclude group: 'org.eclipse.jetty.websocket'
54 | }
55 | compile("org.springframework.boot:spring-boot-starter-actuator:$springBootVersion")
56 | compile("org.springframework.boot:spring-boot-starter-data-jpa:$springBootVersion")
57 | compile("org.springframework.boot:spring-boot-starter-data-rest:$springBootVersion")
58 | compile("org.springframework.cloud:spring-cloud-config-client:$springCloudVersion")
59 | compile("org.flywaydb:flyway-core:3.2.1")
60 | runtime("mysql:mysql-connector-java:5.1.38")
61 | testCompile('org.springframework.boot:spring-boot-starter-test')
62 | }
63 |
64 | flyway {
65 | url = 'jdbc:mysql://dockerhost:3306/demo'
66 | user = 'demo_user'
67 | password = 'demo_pass'
68 | }
69 |
70 | task prepDocker(type: Copy, dependsOn: assemble) {
71 | from 'docker'
72 | into "$buildDir/docker"
73 | include 'Dockerfile.template'
74 | rename { file -> 'Dockerfile' }
75 | expand(project: project, jar: jar )
76 | doFirst {
77 | copy {
78 | from jar
79 | into "$buildDir/docker"
80 | }
81 | }
82 | }
83 |
84 | task wrapper(type: org.gradle.api.tasks.wrapper.Wrapper) {
85 | gradleVersion = '2.9'
86 | }
87 |
--------------------------------------------------------------------------------
/kata3/start/accounts-service/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/kata4/solution2/config-service/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/kata5/solution/profiles-service/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/kata5/start/profiles-service/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/kata6/solution1/eureka-service/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/kata6/solution2/eureka-service/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/kata6/start/accounts-service/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/kata6/start/profiles-service/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/kata7/solution/accounts-service/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------