-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SC-16584: SwaggerUi is available for all Glue applications (#468)
* SC-16584: Update of swagger-ui image and Glue Infrastructure preparation * SC-16584: Add optional glue endpoints * SC-16584: refactored js + templates --------- Co-authored-by: Filip Sushko <filip.sushko@spryker.com>
- Loading branch information
Showing
8 changed files
with
151 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
generator/src/templates/nginx/http/gateway/glue-backend.server.conf.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
{% extends "nginx/http/gateway/server.conf.twig" %} | ||
{% set cli_proxy_pass_value = 'glueBackendSchema' %} | ||
{% block locations %} | ||
{{ parent() }} | ||
{{ include('nginx/http/gateway/glue.schema_location.twig', {cli_proxy_pass: cli_proxy_pass_value}) }} | ||
{% endblock locations %} | ||
|
7 changes: 6 additions & 1 deletion
7
generator/src/templates/nginx/http/gateway/glue-storefront.server.conf.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
{% include 'nginx/http/gateway/glue.server.conf.twig' with _context %} | ||
{% extends "nginx/http/gateway/server.conf.twig" %} | ||
{% set cli_proxy_pass_value = 'glueStorefrontSchema' %} | ||
{% block locations %} | ||
{{ parent() }} | ||
{{ include('nginx/http/gateway/glue.schema_location.twig', {cli_proxy_pass: cli_proxy_pass_value}) }} | ||
{% endblock locations %} |
13 changes: 13 additions & 0 deletions
13
generator/src/templates/nginx/http/gateway/glue.schema_location.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{% block location_schema %} | ||
location /schema.yml { | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection $connection_upgrade; | ||
proxy_set_header X-SCHEMA-BASE-URL $scheme://$host; | ||
|
||
resolver 127.0.0.11 valid=10s; | ||
set $cli_proxy_pass http://cli:9000/{{ cli_proxy_pass }}/; | ||
proxy_pass $cli_proxy_pass; | ||
} | ||
{% endblock location_schema %} |
15 changes: 3 additions & 12 deletions
15
generator/src/templates/nginx/http/gateway/glue.server.conf.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,6 @@ | ||
{% extends "nginx/http/gateway/server.conf.twig" %} | ||
{% set cli_proxy_pass_value = 'glueSchema' %} | ||
{% block locations %} | ||
{{ parent() }} | ||
location /schema.yml { | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection $connection_upgrade; | ||
proxy_set_header X-SCHEMA-BASE-URL $scheme://$host; | ||
|
||
resolver 127.0.0.11 valid=10s; | ||
set $cli_proxy_pass http://cli:9000/glueSchema/; | ||
proxy_pass $cli_proxy_pass; | ||
} | ||
{{ parent() }} | ||
{{ include('nginx/http/gateway/glue.schema_location.twig', {cli_proxy_pass: cli_proxy_pass_value}) }} | ||
{% endblock locations %} |
2 changes: 1 addition & 1 deletion
2
generator/src/templates/service/swagger-ui/default/swagger-ui.yml.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{% include "service/#{engine}/v3.24/#{engine}.yml.twig" with _context only %} | ||
{% include "service/#{engine}/v5.10/#{engine}.yml.twig" with _context only %} |
19 changes: 19 additions & 0 deletions
19
generator/src/templates/service/swagger-ui/v5.10/swagger-ui.yml.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{ serviceName }}: | ||
image: swaggerapi/swagger-ui:v5.10.5 | ||
networks: | ||
- private | ||
labels: | ||
'spryker.app.name': swagger | ||
'spryker.app.type': hidden | ||
'spryker.project': ${SPRYKER_DOCKER_PREFIX}:${SPRYKER_DOCKER_TAG} | ||
{% if serviceData['environment'] is defined %} | ||
environment: | ||
{% for key, value in serviceData['environment'] %} | ||
- {{ key }}={{ value | raw }} | ||
{% endfor %} | ||
{% endif %} | ||
healthcheck: | ||
test: [ "CMD", "nc", "-z", "localhost", "8080" ] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 |