summaryrefslogtreecommitdiff
path: root/contrib/scripts
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2013-10-18 21:51:01 +0000
committerDavid M. Lee <dlee@digium.com>2013-10-18 21:51:01 +0000
commit14dc5776d2c2d3512f59f29a72cec8adaac1c638 (patch)
tree1247fb3975ed7c1f0ea2c4bd889662da780a0d4e /contrib/scripts
parentc30170d9a22255e35606a8c506e398f817a5c15c (diff)
This is just a quick script for dumping swagger-ui into static-http,
so that it can be served by the Asterisk web server. I had to change the Makefile in order to recursively install content from the static-http directory, hence the code review instead of just putting it in. Review: https://reviewboard.asterisk.org/r/2924/ ........ Merged revisions 401261 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'contrib/scripts')
-rwxr-xr-xcontrib/scripts/get_swagger_ui.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/contrib/scripts/get_swagger_ui.sh b/contrib/scripts/get_swagger_ui.sh
new file mode 100755
index 000000000..f6e9cedf2
--- /dev/null
+++ b/contrib/scripts/get_swagger_ui.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+#
+# Downloads Swagger-UI to put in static-http.
+#
+# Swagger-UI is a Swagger compliant HTML+JavaScript web app, which can be used
+# to browse ARI (Asterisk REST Interface).
+#
+
+PROGNAME=$(basename $0)
+
+: ${GIT:=git}
+: ${REPO:=https://github.com/leedm777/swagger-ui.git}
+: ${BRANCH:=asterisk}
+
+if ! test -d static-http; then
+ echo "${PROGNAME}: Must run from Asterisk source directory" >&2
+ exit 1
+fi
+
+set -ex
+
+CLONE_DIR=$(mktemp -d /tmp/swagger-ui.XXXXXX) || exit 1
+trap "rm -rf ${CLONE_DIR}" EXIT
+
+${GIT} clone -q -b ${BRANCH} ${REPO} ${CLONE_DIR}
+
+rm -rf static-http/swagger-ui
+cp -a ${CLONE_DIR}/dist static-http/swagger-ui
+
+cat <<EOF
+Swagger-UI downloaded. Install using 'make install'.
+
+To use, enable ARI (ari.conf), the HTTP server (http.conf) and static
+content (also http.conf).
+EOF