Skip to content

Commit

Permalink
Merge branch 'release/3.25.0-2'
Browse files Browse the repository at this point in the history
  • Loading branch information
jgizycki committed May 26, 2020
2 parents c66a1ef + 1829603 commit 38fa4e8
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea/*
*.iml
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v3.25.0-1] - 2020-05-26
### Added
- added template for the index page
- added etcd key to set the SwaggerValidator

## [v3.25.0-1] - 2020-04-08
### Added
* add Swagger UI in version 3.25.0
* add Swagger UI in version 3.25.0
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN npm run build

FROM registry.cloudogu.com/official/base:3.10.3-2
LABEL NAME="official/swaggerui" \
VERSION="3.25.0-1" \
VERSION="3.25.0-2" \
maintainer="[email protected]"

ENV SERVICE_TAGS=webapp
Expand Down
9 changes: 8 additions & 1 deletion dogu.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Name": "official/swaggerui",
"Version": "3.25.0-1",
"Version": "3.25.0-2",
"DisplayName": "Swagger UI",
"Description": "Swagger UI displays your openAPI specification.",
"Logo": "https://github.com/cloudogu/swagger-ui/blob/master/src/img/logo_small.png?raw=true",
Expand All @@ -16,6 +16,13 @@
"Dependencies": [
"nginx"
],
"Configuration": [
{
"Name": "validator_url",
"Description": "Set the url of the swaggerui validator.",
"Optional": true
}
],
"HealthChecks": [
{
"Type": "tcp",
Expand Down
4 changes: 4 additions & 0 deletions resources/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ set -o pipefail

NGINX_ROOT=/var/www/html
INDEX_FILE=$NGINX_ROOT/index.html
INDEX_TEMPLATE_PATH=/var/www/html/index.html.tpl
INDEX_FILE_PATH=/var/www/html/index.html
doguctl state "starting"

# remove swagger.json from index.html
sed -i "s|https://petstore.swagger.io/v2/swagger.json||g" $INDEX_FILE

doguctl template "${INDEX_TEMPLATE_PATH}" "${INDEX_FILE_PATH}"

doguctl state "ready"

# Start nginx
Expand Down
65 changes: 65 additions & 0 deletions resources/var/www/html/index.html.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" >
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
<style>
html
{
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
*,
*:before,
*:after
{
box-sizing: inherit;
}
body
{
margin:0;
background: #fafafa;
}
</style>
</head>

<body>
<div id="swagger-ui"></div>

<script src="./swagger-ui-bundle.js"> </script>
<script src="./swagger-ui-standalone-preset.js"> </script>
<script>
window.onload = function() {
// Begin Swagger UI call region
const ui = SwaggerUIBundle({
url: "",
dom_id: '#swagger-ui',
deepLinking: true,
{{ if .Config.Exists "validator_url" }}
validatorUrl: "{{ .Config.Get "validator_url"}}",
{{ else }}
validatorUrl: null,
{{ end }}
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
})
// End Swagger UI call region
window.ui = ui
}
</script>
</body>
</html>

0 comments on commit 38fa4e8

Please sign in to comment.