forked from psuter/openwhisk-java-gradle
-
Notifications
You must be signed in to change notification settings - Fork 6
/
deploy.sh
executable file
·39 lines (33 loc) · 709 Bytes
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
WSK="$OPENWHISK_HOME/bin/wsk"
DOMAIN=${CUSTOM_DOMAIN:-false}
function deploy() {
set -e
gradle jar
$WSK package update qr
$WSK action update qr/generate build/libs/wsk-qr-1.0.jar --main qr.Generate -m 128 --web true
$WSK action update qr/ui src/main/js/qr/ui.js -m 128 -p domain $DOMAIN --web true
}
function teardown() {
$WSK action delete qr/ui
$WSK action delete qr/generate
$WSK package delete qr
}
function host() {
URL=`$WSK action get qr/ui --url | tail -1 | awk '{print $1".html"}'`
echo open $URL
}
case "$1" in
--deploy )
deploy
;;
--teardown )
teardown
;;
--host )
host
;;
* )
echo "Usage $0 [--deploy, --teardown, --host]"
;;
esac