This repository has been archived by the owner on Mar 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathTaskfile.yml
114 lines (98 loc) · 3.07 KB
/
Taskfile.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
version: '3'
dotenv:
- .env
vars:
DRY: ""
SKIP: ""
FLAGS: ""
tasks:
default: task -l
build:venv:
requires: { vars: [A] }
cmds:
- >
bash util/build-venv.sh
$(pwd)/packages/{{.A}}/requirements.txt
$(pwd)/packages/{{.A}}.zip
- task: build:action
sources:
- "packages/{{.A}}/requirements.txt"
generates:
- "packages/{{.A}}.zip"
build:action:
aliases: [b]
requires: { vars: [A] }
cmds:
- |
FILE=$(basename "{{.A}}")
cd packages/{{.A}}
zip ../$FILE.zip * -x requirements.txt
sources:
- packages/{{.A}}/*
generates:
- packages/{{.A}}.zip
clean:
ignore_error: true
cmds:
- rm -v packages/*/*.zip
setup:
desc: setup Nuvolaris MastroGPT
cmds:
- |
nuv -version
task config
cli: |
for i in packages/*/*/requirements.txt
do pip install -r $i
done
ipython -i util/init.ipy
serve:
aliases: [s]
ignore_error: true
cmds:
- bash util/http-serve.sh
- echo "Terminated or another server started..."
deploy:
desc: deploy actions
cmds:
- python -m util.deploy {{.FLAGS}}
- nuv web upload web
- echo "Deployed on:" "$NUVDEV_HOST"
undeploy:
ignore_error: true
desc: undeploy actions
cmds:
- task: clean
- >
nuv action list | awk 'NR>1 t{ print $1}' | xargs -L1 -r nuv action delete
- >
nuv package list | awk 'NR>1 t{ print $1}' | xargs -L1 -r nuv package delete
devel:
desc: incremental interactive development mode
cmds:
- task: undeploy
- python -m util.deploy -w {{.FLAGS}}
config:
desc: configure Nuvolaris MastroGPT
silent: true
cmds:
- |
clear
while ! test -e ~/.wskprops
do
echo "*** Configuring Access to nuvolaris.dev with OpenAI ***"
echo -n "Enter Username: "
read NUVDEV_USERNAME
if nuv -login https://nuvolaris.dev "$NUVDEV_USERNAME"
then
source ~/.wskprops
echo "NUVDEV_USERNAME=$NUVDEV_USERNAME" >.env
echo "NUVDEV_HOST=https://$NUVDEV_USERNAME.nuvolaris.dev" >>.env
echo "OPENAI_API_HOST=https://openai.nuvolaris.io" >>.env
echo "$AUTH" | awk -F: '{print "OPENAI_API_KEY=" $1 }' >>.env
fi
done
echo "**************************************************************************************"
echo "*** Type 'deploy' to deploy your app to https://$NUVDEV_USERNAME.nuvolaris.dev"
echo "*** Type 'devel' to enter incremental development mode"
echo "**************************************************************************************"