From 024485ace09b59aa675612a50ebc3b12b3166986 Mon Sep 17 00:00:00 2001 From: Szakalakamaka Date: Thu, 19 Nov 2020 17:05:26 +0100 Subject: [PATCH] - update README.md - updating Jenkinsfile-PROD --- .idea/workspace.xml | 40 +++++------ Jenkinsfile-PROD | 6 -- README.md | 62 ++++++++++++++++-- .../klaus/service/KlausServiceImplTest.class | Bin 5165 -> 5006 bytes 4 files changed, 75 insertions(+), 33 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 658f904..e6fc3f1 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -108,7 +108,7 @@ - + @@ -259,11 +259,11 @@ + - @@ -279,13 +279,6 @@ @@ -730,38 +730,38 @@ - + - + - + - + - + - + - + - + @@ -812,11 +812,11 @@ - + - + diff --git a/Jenkinsfile-PROD b/Jenkinsfile-PROD index 1654fa5..0783d1c 100644 --- a/Jenkinsfile-PROD +++ b/Jenkinsfile-PROD @@ -14,11 +14,5 @@ pipeline { sh "docker-compose -f docker-compose-PROD --context PROD up -d" } } - stage('Logs') { - steps { - sleep time: 1, unit: 'MINUTES' - sh 'docker -f docker-compose-PROD --context PROD logs klaus' - } - } } } diff --git a/README.md b/README.md index 67894ca..f2e7c66 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,32 @@ # R11-Klaus -Mockup service for middleware testing +Mockup service for middleware testing. [![Build Status](https://travis-ci.com/Szakalakamaka/Klaus.svg?token=Tt3QbF7q4wiFNnCGkuew&branch=master)](https://travis-ci.com/Szakalakamaka/Klaus) Available scripts: -#### docker-compose up -d --build -Builds and launches Redis service and the application. Performs unit testing on the code and run the application. +### Running the application on a local machine +For Intellij: +Plugins: +settings -> plugins -> install lombok plugin +settings -> annotation processors -> enable annotation processing + +A connection to a Redis database is expected to run the application successfully. You need to download and run Redis DB on +your local machine with default values localhost 6379. + +You can also run the application via Docker. +#### docker-compose up --build -d + +However, you need either to run it with Spring Cloud Config application or override property value +from redis.host = localhost to redis.host = redis. Where value "redis" will be treated as a DB service address and used +for connection between docker images. + +### Operations on Redis DB + +Use Redis CLI or attach to Redis docker image in order to manually operate on DB. #### docker exec -it mockedservices_redis-server redis-cli -Attach to the running local redis server and open a redis client. +Attach to redis server image and open a redis client. Useful redis-cli commands: ###### KEYS * @@ -24,8 +41,39 @@ Display list length. Display elements from hashSet. Logs can be found in lists with names logstash_yyyy-mm-dd. -Plugins: +### Deployment and building with docker and jenkins +For creating docker context (feature available from docker version 19.03): + +docker context create DEV \ + --description "context for DEV environment" \ + --docker "host=ssh://jenkins@s5000xvn:22" + + +docker context create PROD \ + --description "connection to PROD environment" \ + --docker "host=ssh://jenkins@server361209.nazwa.pl:22" + +docker context create PROD \ + --description "context for PROD environment" \ + --docker "host=ssh://jenkins@server361209:22" + +#### docker-compose up -d --build +Builds and launches Redis service and the application. Performs unit testing on the code and run the application. + +#### docker-compose --context DEV up --build -d +The same as above, but the application will be deployed on the server defined via docker context as DEV. + +#### docker-compose --context PROD up --build -d +The same as above, but the application will be deployed on the server defined via docker context as PROD. + +The application can be started on a local machine without environment support. However, for application supervising and +updating configuration on deployment spring cloud applications should be deployed before. In order: +- Spring Cloud Eureka +- Spring Cloud Configuration +- MockedServices +Once a docker image repository will be availabe, the proper deployment order should be under control by docker-compose script +which should check if the applications are present and if not deploy stable images of Spring Cloud applications from +docker image repo. + -settings -> plugins -> install lombok plugin -settings -> annotation processors -> enable annotation processing \ No newline at end of file diff --git a/target/test-classes/com/release11/klaus/service/KlausServiceImplTest.class b/target/test-classes/com/release11/klaus/service/KlausServiceImplTest.class index fcf850485e809e1f113ef00cd046308ef12b1b33..f3637277c182a8833446c7284eeb5db19f598aa1 100644 GIT binary patch delta 641 zcmah_yG{Z@6g{(xq6@M-5{SVDHGzbR!WeBWw6QU2Vk|6{6%zxPtd)%gz0EWhHhusq zqNs~+e4^s(6Z991o$>B2%7&O&%$+kg=bU@)K?=Ltmayr@77E3Z zDUhC-h`!scNG^@<3$uU)1$YwOPD0wKjlcgOmB%ifiN71oB%J5VB`f(h%Z3rL*5To<^#T5 zw846>vwqT?nhLG1c=Pow8xuSbsgBb zn+f~VWQ~|2n9f)IQ)Y@FZ4M|1B8e`{B7qc!F=sOxsT);@=b$kczrSqdy81s?)@Ikp z6|iDkF4vX|&j&hF8_j!ZHoe@m*A2xIaZ6P|)r=M*bVot&6+ECu;BgvE!4sZ|B+)yD IZoHuV8%)+~GXMYp delta 769 zcmZvY%}X0m6vfXQqrpiuY8O(nQ6m@=C3GQ$3hpdjs0&ep6cmYLl$e>2nOZE=Anr?H zw*41cjZqU#)x`SUYU{V%`!Bc^?|kSC;^Mt`-s7J0e)oQ9`tIis@76W|yutr8?{(EB zFz?0!(hSwIpma--m@wKa$O%c51%|L+O|#(J_U0}r84bya6PkPD~^WWfS?I0v&RUk0Dn zom;f?lmK|)KoGx3xs7^kV~1|QE@g2js>hyNwxw=Y%{5t7H)hoX>7MS8O@~-C&xVUNs-Rlax`UAA(JUS(Uao+tKWLMy>v+By8wo2VsqLdd5PoZ+0r#e1*_ PE^$RgJl*|-bdB