Skip to content

Commit 33ef6c9

Browse files
committed
add diffs wrt dev and deployed versions
1 parent b0271ed commit 33ef6c9

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,8 @@ tmp*
8989
*ignore*
9090
!.dockerignore
9191
!.gitignore
92+
93+
94+
# api diffs
95+
api/openapi-*-diff.json
96+
api/openapi-dev.json

api/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
include ../scripts/common.Makefile
2+
3+
4+
.PHONY: openapi-diff-dev.json
5+
openapi-dev-diff.json: ## Diffs against newer openapi-dev.json and checks backwards compatibility
6+
$(SCRIPTS_DIR)/openapi-diff.bash \
7+
/specs/openapi.json \
8+
/specs/openapi-dev.json \
9+
--fail-on-incompatible \
10+
--json=/specs/$@
11+
12+
13+
14+
.PHONY: openapi-diff-dev.json
15+
openapi-deploy-diff.json: ## Diffs against newer openapi-dev.json and checks backwards compatibility
16+
$(SCRIPTS_DIR)/openapi-diff.bash \
17+
https://api.osparc.io/api/v0/openapi.json \
18+
/specs/openapi.json \
19+
--fail-on-incompatible \
20+
--json=/specs/$@

scripts/openapi-diff.bash

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
#
3+
#
4+
# - https://github.com/OpenAPITools/openapi-diff
5+
#
6+
# NOTE: do not forget that the target /specs
7+
8+
exec docker run \
9+
--interactive \
10+
--rm \
11+
--volume="/etc/group:/etc/group:ro" \
12+
--volume="/etc/passwd:/etc/passwd:ro" \
13+
--user="$(id --user "$USER")":"$(id --group "$USER")" \
14+
--volume "$(pwd):/specs" \
15+
openapitools/openapi-diff:latest \
16+
"$@"

0 commit comments

Comments
 (0)