summaryrefslogtreecommitdiffstats
path: root/dovetail/api/boot.sh
diff options
context:
space:
mode:
Diffstat (limited to 'dovetail/api/boot.sh')
-rwxr-xr-xdovetail/api/boot.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/dovetail/api/boot.sh b/dovetail/api/boot.sh
new file mode 100755
index 00000000..9fbb5484
--- /dev/null
+++ b/dovetail/api/boot.sh
@@ -0,0 +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