- update README.md
- updating Jenkinsfile-PROD
This commit is contained in:
		
							
								
								
									
										40
									
								
								.idea/workspace.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										40
									
								
								.idea/workspace.xml
									
									
									
										generated
									
									
									
								
							| @@ -108,7 +108,7 @@ | |||||||
|       <recent name="com.release11.klaus.service" /> |       <recent name="com.release11.klaus.service" /> | ||||||
|     </key> |     </key> | ||||||
|   </component> |   </component> | ||||||
|   <component name="RunManager" selected="JUnit.KlausServiceImplTest"> |   <component name="RunManager" selected="Application.KlausApplication"> | ||||||
|     <configuration name="KlausApplication" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> |     <configuration name="KlausApplication" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> | ||||||
|       <envs> |       <envs> | ||||||
|         <env name="-Dspring.profiles.active" value="test" /> |         <env name="-Dspring.profiles.active" value="test" /> | ||||||
| @@ -259,11 +259,11 @@ | |||||||
|     </list> |     </list> | ||||||
|     <recent_temporary> |     <recent_temporary> | ||||||
|       <list> |       <list> | ||||||
|  |         <item itemvalue="Application.KlausApplication" /> | ||||||
|         <item itemvalue="JUnit.KlausServiceImplTest" /> |         <item itemvalue="JUnit.KlausServiceImplTest" /> | ||||||
|         <item itemvalue="JUnit.EventRepositoryImplTest" /> |         <item itemvalue="JUnit.EventRepositoryImplTest" /> | ||||||
|         <item itemvalue="JUnit.KlausMvcControllerTest" /> |         <item itemvalue="JUnit.KlausMvcControllerTest" /> | ||||||
|         <item itemvalue="JUnit.KlausControllerTest" /> |         <item itemvalue="JUnit.KlausControllerTest" /> | ||||||
|         <item itemvalue="Application.KlausApplication" /> |  | ||||||
|       </list> |       </list> | ||||||
|     </recent_temporary> |     </recent_temporary> | ||||||
|   </component> |   </component> | ||||||
| @@ -279,13 +279,6 @@ | |||||||
|       <option name="presentableId" value="Default" /> |       <option name="presentableId" value="Default" /> | ||||||
|       <updated>1598862102028</updated> |       <updated>1598862102028</updated> | ||||||
|     </task> |     </task> | ||||||
|     <task id="LOCAL-00073" summary="testing Jenkinsfile"> |  | ||||||
|       <created>1601386453295</created> |  | ||||||
|       <option name="number" value="00073" /> |  | ||||||
|       <option name="presentableId" value="LOCAL-00073" /> |  | ||||||
|       <option name="project" value="LOCAL" /> |  | ||||||
|       <updated>1601386453295</updated> |  | ||||||
|     </task> |  | ||||||
|     <task id="LOCAL-00074" summary="testing jenkins docker"> |     <task id="LOCAL-00074" summary="testing jenkins docker"> | ||||||
|       <created>1601452178576</created> |       <created>1601452178576</created> | ||||||
|       <option name="number" value="00074" /> |       <option name="number" value="00074" /> | ||||||
| @@ -622,7 +615,14 @@ | |||||||
|       <option name="project" value="LOCAL" /> |       <option name="project" value="LOCAL" /> | ||||||
|       <updated>1605784900573</updated> |       <updated>1605784900573</updated> | ||||||
|     </task> |     </task> | ||||||
|     <option name="localTasksCounter" value="122" /> |     <task id="LOCAL-00122" summary="MessageDto instead of String in Event history"> | ||||||
|  |       <created>1605785256941</created> | ||||||
|  |       <option name="number" value="00122" /> | ||||||
|  |       <option name="presentableId" value="LOCAL-00122" /> | ||||||
|  |       <option name="project" value="LOCAL" /> | ||||||
|  |       <updated>1605785256941</updated> | ||||||
|  |     </task> | ||||||
|  |     <option name="localTasksCounter" value="123" /> | ||||||
|     <servers /> |     <servers /> | ||||||
|   </component> |   </component> | ||||||
|   <component name="UnknownFeatures"> |   <component name="UnknownFeatures"> | ||||||
| @@ -730,38 +730,38 @@ | |||||||
|     <state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1602662342585" /> |     <state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1602662342585" /> | ||||||
|     <state x="2606" y="235" key="FileChooserDialogImpl/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1604501503902" /> |     <state x="2606" y="235" key="FileChooserDialogImpl/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1604501503902" /> | ||||||
|     <state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1602147205037" /> |     <state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1602147205037" /> | ||||||
|     <state width="1493" height="55" key="GridCell.Tab.0.bottom" timestamp="1605781988395"> |     <state width="1493" height="114" key="GridCell.Tab.0.bottom" timestamp="1605785217750"> | ||||||
|       <screen x="0" y="0" width="1536" height="824" /> |       <screen x="0" y="0" width="1536" height="824" /> | ||||||
|     </state> |     </state> | ||||||
|     <state width="1877" height="239" key="GridCell.Tab.0.bottom/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275797041" /> |     <state width="1877" height="239" key="GridCell.Tab.0.bottom/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275797041" /> | ||||||
|     <state width="1493" height="55" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1605781988395" /> |     <state width="1493" height="114" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1605785217750" /> | ||||||
|     <state width="1877" height="267" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1605721684342" /> |     <state width="1877" height="267" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1605721684342" /> | ||||||
|     <state width="1493" height="89" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1604916507124" /> |     <state width="1493" height="89" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1604916507124" /> | ||||||
|     <state width="1877" height="315" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1604501251887" /> |     <state width="1877" height="315" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1604501251887" /> | ||||||
|     <state width="1493" height="185" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1605634220571" /> |     <state width="1493" height="185" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1605634220571" /> | ||||||
|     <state width="1493" height="55" key="GridCell.Tab.0.center" timestamp="1605781988395"> |     <state width="1493" height="114" key="GridCell.Tab.0.center" timestamp="1605785217749"> | ||||||
|       <screen x="0" y="0" width="1536" height="824" /> |       <screen x="0" y="0" width="1536" height="824" /> | ||||||
|     </state> |     </state> | ||||||
|     <state width="1877" height="239" key="GridCell.Tab.0.center/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275797041" /> |     <state width="1877" height="239" key="GridCell.Tab.0.center/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275797041" /> | ||||||
|     <state width="1493" height="55" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1605781988395" /> |     <state width="1493" height="114" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1605785217749" /> | ||||||
|     <state width="1877" height="267" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1605721684342" /> |     <state width="1877" height="267" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1605721684342" /> | ||||||
|     <state width="1493" height="89" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1604916507123" /> |     <state width="1493" height="89" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1604916507123" /> | ||||||
|     <state width="1877" height="315" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1604501251887" /> |     <state width="1877" height="315" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1604501251887" /> | ||||||
|     <state width="1493" height="185" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1605634220571" /> |     <state width="1493" height="185" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1605634220571" /> | ||||||
|     <state width="1493" height="55" key="GridCell.Tab.0.left" timestamp="1605781988395"> |     <state width="1493" height="114" key="GridCell.Tab.0.left" timestamp="1605785217749"> | ||||||
|       <screen x="0" y="0" width="1536" height="824" /> |       <screen x="0" y="0" width="1536" height="824" /> | ||||||
|     </state> |     </state> | ||||||
|     <state width="1877" height="239" key="GridCell.Tab.0.left/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275797041" /> |     <state width="1877" height="239" key="GridCell.Tab.0.left/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275797041" /> | ||||||
|     <state width="1493" height="55" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1605781988395" /> |     <state width="1493" height="114" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1605785217749" /> | ||||||
|     <state width="1877" height="267" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1605721684342" /> |     <state width="1877" height="267" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1605721684342" /> | ||||||
|     <state width="1493" height="89" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1604916507123" /> |     <state width="1493" height="89" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1604916507123" /> | ||||||
|     <state width="1877" height="315" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1604501251887" /> |     <state width="1877" height="315" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1604501251887" /> | ||||||
|     <state width="1493" height="185" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1605634220570" /> |     <state width="1493" height="185" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1605634220570" /> | ||||||
|     <state width="1493" height="55" key="GridCell.Tab.0.right" timestamp="1605781988395"> |     <state width="1493" height="114" key="GridCell.Tab.0.right" timestamp="1605785217750"> | ||||||
|       <screen x="0" y="0" width="1536" height="824" /> |       <screen x="0" y="0" width="1536" height="824" /> | ||||||
|     </state> |     </state> | ||||||
|     <state width="1877" height="239" key="GridCell.Tab.0.right/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275797041" /> |     <state width="1877" height="239" key="GridCell.Tab.0.right/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275797041" /> | ||||||
|     <state width="1493" height="55" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1605781988395" /> |     <state width="1493" height="114" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1605785217750" /> | ||||||
|     <state width="1877" height="267" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1605721684342" /> |     <state width="1877" height="267" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1605721684342" /> | ||||||
|     <state width="1493" height="89" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1604916507123" /> |     <state width="1493" height="89" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1604916507123" /> | ||||||
|     <state width="1877" height="315" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1604501251887" /> |     <state width="1877" height="315" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1604501251887" /> | ||||||
| @@ -812,11 +812,11 @@ | |||||||
|     </state> |     </state> | ||||||
|     <state x="277" y="57" key="SettingsEditor/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1600935670743" /> |     <state x="277" y="57" key="SettingsEditor/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1600935670743" /> | ||||||
|     <state x="277" y="57" key="SettingsEditor/0.0.1536.824@0.0.1536.824" timestamp="1601975962923" /> |     <state x="277" y="57" key="SettingsEditor/0.0.1536.824@0.0.1536.824" timestamp="1601975962923" /> | ||||||
|     <state x="361" y="145" key="Vcs.Push.Dialog.v2" timestamp="1605784903807"> |     <state x="361" y="145" key="Vcs.Push.Dialog.v2" timestamp="1605785260794"> | ||||||
|       <screen x="0" y="0" width="1536" height="824" /> |       <screen x="0" y="0" width="1536" height="824" /> | ||||||
|     </state> |     </state> | ||||||
|     <state x="451" y="183" key="Vcs.Push.Dialog.v2/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275760386" /> |     <state x="451" y="183" key="Vcs.Push.Dialog.v2/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275760386" /> | ||||||
|     <state x="361" y="145" key="Vcs.Push.Dialog.v2/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1605784903807" /> |     <state x="361" y="145" key="Vcs.Push.Dialog.v2/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1605785260794" /> | ||||||
|     <state x="2371" y="183" key="Vcs.Push.Dialog.v2/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1604770067322" /> |     <state x="2371" y="183" key="Vcs.Push.Dialog.v2/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1604770067322" /> | ||||||
|     <state x="361" y="145" key="Vcs.Push.Dialog.v2/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1604494473937" /> |     <state x="361" y="145" key="Vcs.Push.Dialog.v2/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1604494473937" /> | ||||||
|     <state x="2371" y="204" key="Vcs.Push.Dialog.v2/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1604499402409" /> |     <state x="2371" y="204" key="Vcs.Push.Dialog.v2/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1604499402409" /> | ||||||
|   | |||||||
| @@ -14,11 +14,5 @@ pipeline { | |||||||
|                 sh "docker-compose -f docker-compose-PROD --context PROD up -d" |                 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' |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										62
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										62
									
								
								README.md
									
									
									
									
									
								
							| @@ -1,15 +1,32 @@ | |||||||
| # R11-Klaus | # R11-Klaus | ||||||
| Mockup service for middleware testing | Mockup service for middleware testing. | ||||||
|  |  | ||||||
| [](https://travis-ci.com/Szakalakamaka/Klaus) | [](https://travis-ci.com/Szakalakamaka/Klaus) | ||||||
|  |  | ||||||
| Available scripts: | Available scripts: | ||||||
|  |  | ||||||
| #### docker-compose up -d --build | ### Running the application on a local machine | ||||||
| Builds and launches Redis service and the application. Performs unit testing on the code and run the application. | 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 | #### 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: | Useful redis-cli commands: | ||||||
| ###### KEYS * | ###### KEYS * | ||||||
| @@ -24,8 +41,39 @@ Display list length. | |||||||
| Display elements from hashSet. | Display elements from hashSet. | ||||||
| Logs can be found in lists with names logstash_yyyy-mm-dd. | 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 |  | ||||||
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user
	 Szakalakamaka
					Szakalakamaka