-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathTaskfileDev.yml
97 lines (80 loc) · 3.19 KB
/
TaskfileDev.yml
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# 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
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 pameters
- 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
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