Skip to content

Commit e3f00b7

Browse files
authored
Merge pull request #2 from greenbone/change/update-build-image-name-and-readme
Change: container name in the container.yml and add badges in the README.md
2 parents d593f5b + 4b77b2f commit e3f00b7

4 files changed

Lines changed: 42 additions & 3 deletions

File tree

.github/workflows/container.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ concurrency:
2222

2323
jobs:
2424
build:
25-
if: ${{ github.repository == 'ozgen/openapi-sample-emulator' }}
25+
if: ${{ github.repository == 'greenbone/gvm-openapi-emulator' }}
2626
strategy:
2727
fail-fast: false
2828
matrix:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ APP_NAME ?= emulator
1313
MAIN_PKG ?= ./cmd/emulator
1414

1515
# Docker
16-
IMAGE_NAME ?= openapi-sample-emulator:local
16+
IMAGE_NAME ?= gvm-openapi-emulator:local
1717

1818
# Run config
1919
HOST ?= 0.0.0.0

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
![Greenbone Logo](https://www.greenbone.net/wp-content/uploads/gb_new-logo_horizontal_rgb_small.png)
2+
13
# gvm-openapi-emulator
24

5+
![CI](https://github.com/greenbone/gvm-openapi-emulator/actions/workflows/ci.yml/badge.svg)
6+
![Lint](https://github.com/greenbone/gvm-openapi-emulator/actions/workflows/lint.yml/badge.svg)
7+
![Format](https://github.com/greenbone/gvm-openapi-emulator/actions/workflows/format.yml/badge.svg)
8+
39
`gvm-openapi-emulator` is a lightweight HTTP emulator that serves predefined responses based on an OpenAPI / Swagger specification.
410

511
It is designed for **local development**, **integration testing**, and **CI environments** where deterministic and predictable API behavior is required.
@@ -12,6 +18,39 @@ It is designed for **local development**, **integration testing**, and **CI envi
1218

1319
---
1420

21+
## How to use
22+
23+
Clone the repository and run locally:
24+
25+
```bash
26+
git clone https://github.com/greenbone/gvm-openapi-emulator.git
27+
cd gvm-openapi-emulator
28+
make run
29+
```
30+
31+
### Using Makefile
32+
33+
The repository includes a `Makefile` with helpful targets:
34+
35+
```bash
36+
make build # Build the binary into ./bin/emulator
37+
make run # Build and run the emulator (uses SPEC_PATH / SAMPLES_DIR defaults)
38+
make test # Run all tests
39+
make cover # Run tests with coverage and generate reports (coverage.html)
40+
41+
make format # Format code with goimports + gofumpt + gofmt
42+
make lint # Run golangci-lint
43+
make tidy # Run go mod tidy
44+
45+
make docker-build # Build Docker image (gvm-openapi-emulator:local)
46+
make docker-run # Run Docker image with example volume mount
47+
make compose-up # Start via docker compose
48+
make compose-down # Stop docker compose
49+
make clean # Remove build and coverage artifacts
50+
```
51+
52+
---
53+
1554
## What it does
1655

1756
* Reads an OpenAPI / Swagger specification

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services:
33
build:
44
context: .
55
dockerfile: Dockerfile
6-
image: openapi-sample-emulator:local
6+
image: gvm-openapi-emulator:local
77
ports:
88
- "${EMULATOR_HOST_PORT:-8086}:8086"
99
environment:

0 commit comments

Comments
 (0)