blob: 17f05c47a7b1785c5047993513a043a20f993bf5 [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
version: '3'
vars:
WHISK: '{{default "whisk" .WHISK}}'
CONFIG: "tests/{{.KUBE}}/{{.WHISK}}.yaml"
# taken from the tag
OPERATOR_TAG:
sh: git describe --tags --abbrev=0 2>/dev/null || git rev-parse --short HEAD
# taken from the Dockerfile - ovveridable with MY_OPERATOR_IMAGE
OPERATOR_IMAGE:
sh: awk -F= '/ARG OPERATOR_IMAGE_DEFAULT=/ { print $2 ; exit }' Dockerfile
# taken from the Dockerfile
CONTROLLER_TAG:
sh: awk -F= '/ENV CONTROLLER_TAG=/ { print $2 ; exit }' Dockerfile
CONTROLLER_IMAGE:
sh: awk -F= '/ENV CONTROLLER_IMAGE=/ { print $2 ; exit }' Dockerfile
# taken from the Dockerfile
INVOKER_TAG:
sh: awk -F= '/ENV INVOKER_TAG=/ { print $2 ; exit }' Dockerfile
INVOKER_IMAGE:
sh: awk -F= '/ENV INVOKER_IMAGE=/ { print $2 ; exit }' Dockerfile
APIKUBE:
sh: kubectl config view -o json | jq -r '.clusters[0].cluster.server'
env:
APIHOST:
sh: echo {{.APIKUBE}} | sed -e 's|^.*//\(.*\):.*$|\1|'
APIHOST_OSH:
sh: echo {{.APIKUBE}} | sed -e 's|^.*//\(.*\):.*$|\1|' | sed -e 's/^api./nuvolaris.apps./'
tasks:
env: env
cli:
cmds:
- env OPERATOR_IMAGE="${MY_OPERATOR_IMAGE:-{{.OPERATOR_IMAGE}}}" poetry run ipython -i profile.ipy
env:
CONTROLLER_IMAGE: "{{.CONTROLLER_IMAGE}}"
CONTROLLER_TAG: "{{.CONTROLLER_TAG}}"
OPERATOR_TAG: "{{.OPERATOR_TAG}}"
run:
cmds:
# note that the .env is loaded after the env parameters
- env OPERATOR_IMAGE="${MY_OPERATOR_IMAGE:-{{.OPERATOR_IMAGE}}}" ./run.sh
env:
CONTROLLER_IMAGE: "{{.CONTROLLER_IMAGE}}"
CONTROLLER_TAG: "{{.CONTROLLER_TAG}}"
OPERATOR_TAG: "{{.OPERATOR_TAG}}"
COUCHDB_SERVICE_HOST: "localhost"
MINIO_API_HOST: "localhost"
OW_CONTROLLER_HOST : "localhost"
OW_CONTROLLER_PORT : 3233
INVOKER_IMAGE: "{{.INVOKER_IMAGE}}"
INVOKER_TAG: "{{.INVOKER_TAG}}"
instance:
- envsubst <{{.CONFIG}} | kubectl -n nuvolaris apply -f -
show:
- echo "*** {{.CONFIG}}"
- envsubst <{{.CONFIG}}
destroy: kubectl -n nuvolaris delete wsk/controller
couchdb:
- rm -f deploy/*/kustomization.yaml deploy/*/__*
- task: permission
- kubectl apply -f deploy/couchdb
couchdb-forward:
- kubectl -n nuvolaris port-forward svc/couchdb 5985:5984
mongodb:
- kubectl apply -f deploy/mongodb-operator
- kubectl apply -f deploy/mongodb
defin: >
kubectl -n nuvolaris patch wsk/controller --type=merge --patch '{"metadata": {"finalizers":[] } }'
defin2: kubectl -n nuvolaris get wsk/controller -o yaml | grep -v Final | kubectl apply -f -
killpy: ps auwwx | grep python | awk '{print $2}' | xargs kill -9
enter: kubectl exec -ti nuvolaris-operator -- bash