summaryrefslogtreecommitdiffstats
path: root/dovetail/api/boot.sh
diff options
context:
space:
mode:
Diffstat (limited to 'dovetail/api/boot.sh')
-rwxr-xr-xdovetail/api/boot.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/dovetail/api/boot.sh b/dovetail/api/boot.sh
index dc49876a..9fbb5484 100755
--- a/dovetail/api/boot.sh
+++ b/dovetail/api/boot.sh
@@ -1,4 +1,16 @@
#!/bin/sh
+mkdir -p /var/www/html/dovetail-api
+cp -r /home/opnfv/swagger-ui/dist/* /var/www/html/dovetail-api
+cp /home/opnfv/dovetail/dovetail/api/swagger.yaml /var/www/html/dovetail-api
+sed -i 's#url: "https://petstore.swagger.io/v2/swagger.json"#url: "swagger.yaml"#g' /var/www/html/dovetail-api/index.html
+sed -i '/deepLinking: true,/a\ validatorUrl: null,' /var/www/html/dovetail-api/index.html
+
+if [[ -n ${SWAGGER_HOST} ]]; then
+ sed -i "s/host: localhost:8888/host: ${SWAGGER_HOST}/g" /var/www/html/dovetail-api/swagger.yaml
+fi
+
+/etc/init.d/apache2 start
+
cd $(dirname $(readlink -f $0))
exec gunicorn -b :5000 --access-logfile - --error-logfile - app.routes:app