diff --git a/setup/docopts.md b/setup/docopts.md index 926ce40..55e412a 100644 --- a/setup/docopts.md +++ b/setup/docopts.md @@ -24,19 +24,18 @@ Manage installation ```text Usage: - setup mini + setup mini [] setup devcluster [--uninstall|--status|[--skip-check-ports] [--skip-preload-images]] setup cluster [] [--uninstall|--status] setup server [] [--uninstall|--status] setup status setup uninstall - setup prereq ``` ## Commands ``` - setup mini deploy mini Apache OpenServerless, slim local installation available as http://devel.miniops.me + setup mini deploy mini Apache OpenServerless, slim local installation available as http://devel.miniops.me (or your local domain) setup cluster deploy Apache OpenServerless in the Kubernetes cluster using the , default the current setup devcluster deploy Apache OpenServerless in a devcluster created locally you need Docker Desktop available with at least 6G of memory assigned @@ -44,7 +43,6 @@ Usage: the server must be accessible with ssh using the with sudo power, default root setup status show the status of the last installation setup uninstall uninstall the last installation - setup prereq validate current configuration ``` ## Options diff --git a/setup/nuvolaris/system-api/opsfile.yml b/setup/nuvolaris/system-api/opsfile.yml index f217aac..fa9e15d 100644 --- a/setup/nuvolaris/system-api/opsfile.yml +++ b/setup/nuvolaris/system-api/opsfile.yml @@ -36,19 +36,19 @@ env: SYS_API_CDB_HOST: couchdb SYS_API_CDB_USER: - sh: kubectl -n nuvolaris get wsk/controller -o jsonpath='{.spec.couchdb.admin.user}' + sh: ops util kubectl -- -n nuvolaris get wsk/controller -o jsonpath='{.spec.couchdb.admin.user}' SYS_API_CDB_PASSWORD: - sh: kubectl -n nuvolaris get wsk/controller -o jsonpath='{.spec.couchdb.admin.password}' + sh: ops util kubectl -- -n nuvolaris get wsk/controller -o jsonpath='{.spec.couchdb.admin.password}' SYS_API_HOSTNAME: - sh: kubectl -n nuvolaris get ingress/apihost -o jsonpath='{.spec.rules[0].host}' + sh: ops util kubectl -- -n nuvolaris get ingress/apihost -o jsonpath='{.spec.rules[0].host}' + + REGISTRY_PASS: + sh: ops util kubectl -- -n nuvolaris get cm/config -o jsonpath='{.metadata.annotations.registry_password}' INGRESS_TYPE: sh: ops util ingress-type - - REGISTRY_PASS: - sh: kubectl -n nuvolaris get cm/config -o jsonpath='{.metadata.annotations.registry_password}' tasks: install-toml: diff --git a/setup/opsfile.yml b/setup/opsfile.yml index 1033cf1..2586d8c 100644 --- a/setup/opsfile.yml +++ b/setup/opsfile.yml @@ -76,26 +76,38 @@ tasks: done {{end}} - prereq: - silent: true - cmds: - - exit 0 mini: - silent: true desc: install miniops + vars: + APIHOST: '{{or ._apihost_ "http://miniops.me"}}' + cmds: + - echo '{{.APIHOST}}' | rg 'https?://(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]+/?' >/dev/null || die "please spefify an accessibile http://host" + - task: _mini + vars: + APIHOST: '{{.APIHOST}}' + PROTO: + sh: echo '{{.APIHOST}}' | rg -o '(https?)://' -r '$1' + DOMAIN: + sh: echo '{{.APIHOST}}' | rg -o 'https?://((?:[a-zA-Z0-9-]+\.)+[a-zA-Z]+)/?' -r '$1' + + _mini: + silent: true cmds: + - echo APIHOST={{.APIHOST}} + - echo PROTO={{.PROTO}} + - echo DOMAIN={{.DOMAIN}} - docker -v || die "Docker is not installed. Please install Docker Desktop first." - docker info 2>/dev/null >/dev/null || die "Docker is not running. Please start Docker Desktop first." - | if test -z {{.__skip_check_cluster}} then - if curl -sL http://miniops.me >/dev/null 2>/dev/null + if curl -sL {{.APIHOST}} >/dev/null 2>/dev/null then - if curl -sL http://miniops.me/api/info 2>/dev/null | jq -r .description 2>/dev/null | rg OpenWhisk >/dev/null 2>/dev/null + if curl -sL {{.APIHOST}}/api/info 2>/dev/null | jq -r .description 2>/dev/null | rg OpenWhisk >/dev/null 2>/dev/null then echo "*** Apache OpenServerless mini is already installed." - echo "*** Login with: ops ide login devel http://miniops.me" + echo "*** Login with: ops ide login devel {{.APIHOST}}" echo "*** You can find the password in .ops/devel.password in your home directory" echo "*** You can can uninstall and restart with: ops setup docker delete" exit 1 @@ -109,7 +121,7 @@ tasks: fi - ops setup docker check-space - ops config slim - - ops config apihost miniops.me --protocol=http + - ops config apihost '{{.DOMAIN}}' --protocol={{.PROTO}} - ops setup devcluster - ops setup nuvolaris streamer deploy - ops setup nuvolaris system-api deploy