From 48343b407effe38b7df8d16cab7f2a6271741b18 Mon Sep 17 00:00:00 2001 From: Dmitriy Lukiyanchuk Date: Mon, 20 May 2024 12:24:11 +0300 Subject: [PATCH] Add GUI to wiremock instances - inherit Wiremock GUI by holomekc --- .image-build-args | 4 ++-- README.md | 18 ++++++++++++++---- static/supervisord/files/supervisord.conf.tpl | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.image-build-args b/.image-build-args index aa0e24a..aa50bea 100644 --- a/.image-build-args +++ b/.image-build-args @@ -4,7 +4,7 @@ GOLANG_IMAGE_TAG="1.21.7" WIREMOCK_IMAGE_REPO="docker.io" -WIREMOCK_IMAGE_NAME="wiremock/wiremock" -WIREMOCK_IMAGE_TAG="2.32.0-alpine" +WIREMOCK_IMAGE_NAME="holomekc/wiremock-gui" +WIREMOCK_IMAGE_TAG="3.6.7-alpine" # See COPYRIGHT file. diff --git a/README.md b/README.md index ead022b..d3fe62f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,14 @@ # grpc-wiremock -[Wiremock](https://wiremock.org/docs) is a great way to test your connected services. -But it has one drawback. And that is support for **proto** contracts. +**grpc-wiremock** is a tool for mocking server API. It provides -**grpc-wiremock** is designed to solve this problem, -and also provide a handy *tool for generating mocks*. And their *automatic reloading*. +* simultaneous work with **multiple APIs**; +* mocking of **grpc (protobuf)** API; +* generating mocks by **proto** and **openapi** files; +* hot reload on contract changes. + +**grpc-wiremock** is based on [Wiremock](https://wiremock.org/docs), so it provides the all its power of matchers. +Also it inherites [Wiremock GUI](https://github.com/holomekc/wiremock) made by [holomekc](https://github.com/holomekc). [Here](docs/comparsion.md) you can compare the functionality with existing solutions. @@ -39,6 +43,12 @@ docker run \ -v ${CONTRACTS_PATH}:/proto \ SberMarket-Tech/grpc-wiremock@latest ``` + +To view status and API mocks + +* Open Supervisor GUI on http://localhost:9000. +* Open Wiremock GUI on http://localhost:8000/__admin/webapp + ## Overview In general, **grpc-wiremock** contains two main components. diff --git a/static/supervisord/files/supervisord.conf.tpl b/static/supervisord/files/supervisord.conf.tpl index f4eab5c..c2f08d6 100644 --- a/static/supervisord/files/supervisord.conf.tpl +++ b/static/supervisord/files/supervisord.conf.tpl @@ -3,4 +3,4 @@ environment = ROOT="{{ .Root }}",PORT="{{ .Port }}",NAME="{{ .Domain }}" autorestart = true redirect_stderr = true stdout_logfile = /var/log/supervisord/mock-{{ .Domain }}.log -command = java -cp "/var/wiremock/lib/*:/var/wiremock/extensions/*" com.github.tomakehurst.wiremock.standalone.WireMockServerRunner --port {{ .Port }} --root-dir {{ .Root }} --global-response-templating --record-mappings --verbose +command = java -cp "/var/wiremock/lib/*:/var/wiremock/extensions/*" wiremock.Run --port {{ .Port }} --root-dir {{ .Root }} --global-response-templating --record-mappings --verbose