Skip to content
Snippets Groups Projects
Unverified Commit ab096af3 authored by Martin Weise's avatar Martin Weise
Browse files

Added dist

parent e1cef7ab
Branches
No related tags found
No related merge requests found
Pipeline #2846 failed
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
#!/bin/bash
declare -A services
services[5000]=analyse
services[5010]=units
services[9091]=container
services[9092]=database
services[9093]=query
services[9094]=table
services[9096]=identifier
services[9097]=authentication
services[9098]=metadata
function replace () {
echo "... replace server url of $1"
sed -i -e "s/localhost:[0-9]+/dbrepo1.ec.tuwien.ac.at/g" "/usr/share/nginx/html/docs/$1/api.yaml"
sed -i -e "s/Generated server url/TU Wien DBRepo/g" "/usr/share/nginx/html/docs/$1/api.yaml"
}
function copy () {
echo "... copy dist to $1"
cp -r /app/dist/* "/usr/share/nginx/html/docs/$1"
}
function init () {
echo "... copy initializer to $1"
cp /app/swagger-initializer.js "/usr/share/nginx/html/docs/$1"
}
for key in "${!services[@]}"; do
echo "Preparing ${services[$key]} API"
replace "${services[$key]}"
copy "${services[$key]}"
init "${services[$key]}"
done
\ No newline at end of file
......@@ -37,6 +37,8 @@ function copy () {
#cp -r "./api-$1/swagger_client" "${HOME}/Projects/fda-services/.gitlab/api_$1"
#cp -r "./api-$1/swagger_client" "${HOME}/Projects/fda-services/.demo/api_$1"
cp -r "./api-$1/swagger_client" "./api/api_$1"
cp "./api-$1.yaml" "./$1/api.yaml"
cp -r ./dist/* "./$1"
}
function replace () {
......@@ -49,13 +51,22 @@ function replace () {
find "./api/api_$2" -type f -exec sed -i -e "s/self.host = .*/self.host = \"http:\/\/localhost:9095\"/g" {} \;
}
function move () {
echo "... moving swagger static files"
mkdir -p ../site/swagger
cp -r "./$1" ../site/swagger
}
for key in "${!services[@]}"; do
echo "Generating ${services[$key]} API"
if [[ ! -z "${UPDATE}" ]]; then
retrieve "$key" "${services[$key]}"
fi
generate "${services[$key]}"
remove "${services[$key]}"
copy "${services[$key]}"
replace "$key" "${services[$key]}"
move "${services[$key]}"
done
cp -r ./api/* "${HOME}/Projects/dbrepo-tuw/worker-airquality/"
......
<!DOCTYPE html>
<head>
<title>DBRepo Endpoint Documentation</title>
</head>
<body>
<h3>DBRepo Endpoint Documentation</h3>
<ul>
<li><a href="/docs/analyse">Analyse Service</a></li>
<li><a href="/docs/authentication">Authentication Service</a></li>
<li><a href="/docs/container">Container Service</a></li>
<li><a href="/docs/database">Database Service</a></li>
<li><a href="/docs/identifier">Identifier Service</a></li>
<li><a href="/docs/metadata">Metadata Service</a></li>
<li><a href="/docs/query">Query Service</a></li>
<li><a href="/docs/table">Table Service</a></li>
<li><a href="/docs/units">Units Service</a></li>
</ul>
</body>
\ No newline at end of file
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error_log;
pid /var/run/nginx.pid;
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
# include /etc/nginx/modules.d/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access_log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
client_max_body_size 1G;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
##
# Connection header for WebSocket reverse proxy
##
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 8080 default_server;
server_name _;
root /usr/share/nginx/html/;
index index.html index.htm;
location / {
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment