-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcli.sh
More file actions
128 lines (113 loc) · 3.15 KB
/
Copy pathcli.sh
File metadata and controls
128 lines (113 loc) · 3.15 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
PROJECT_PATH="/src/app"
# PROJECT_PATH=/home/amir/apps/wqdms/monotremata-interface
cmd_update(){
cd $PROJECT_PATH
# . ./cli.sh
. ~/.bashrc
cd -
}
cmd_set_git_uer(){
git config --global user.name "$USER:$HOSTNAME"
git config --global user.email "$USER@$HOSTNAME.local"
git config --global http.sslVerify "false"
}
cmd_pre(){
cd $PROJECT_PATH
# python3 manage.py dumpdata monotremata > presets.json
rm ./db.sqlite3 || true
rm -drf ./monotremata/migrations || true
mkdir -p ./monotremata/migrations
touch ./monotremata/migrations/__init__.py
python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py loaddata user.json
# python3 manage.py loaddata presets.json
python3 manage.py runserver 0.0.0.0:8000
}
cmd_after(){
cd $PROJECT_PATH
python3 manage.py makemigrations
python3 manage.py migrate
# python3 manage.py loaddata user.json
# python3 manage.py loaddata presets.json
python3 manage.py runserver 0.0.0.0:8000
}
cmd_package(){
cd $PROJECT_PATH
rm -rdf ./packaged
mkdir -p ./packaged
cd $PROJECT_PATH/packaged
u1='/?id=&name=wqdms&tag=&label=&applications__name=&applications__tag=&applications__label='
u2='http://192.168.179.6:8000/project/?format=download&name=wqdms&id='
curl $u2 --output mono.zip
unzip ./mono.zip -d ./
cd wqdms
python manage.py makemigrations
python manage.py migrate
DJANGO_PORT=8002 python manage.py setup -s
}
cmd_clean_package(){
cd $PROJECT_PATH
rm -rdf ./packaged
mkdir -p ./packaged
}
cmd_clean_app(){
cd $PROJECT_PATH
rm -rdf ./monotremata/migrations
mkdir -p ./monotremata/migrations
touch ./monotremata/migrations/__init__.py
rm -drf ./interface/__pycache__
rm -drf ./monotremata/__pycache__
rm ./db.sqlite3
}
cmd_debug(){
cmd_set_git_uer
. .venv/bin/activate && uv sync
cd ${PROJECT_PATH}
uv run debugpy --listen 0.0.0.0:${DEBUGPY_PORT} manage.py runserver 0.0.0.0:${DJANGO_PORT}
}
cmd_jupyter(){
cmd_set_git_uer
. .venv/bin/activate && uv sync
cd ${PROJECT_PATH}
uv run manage.py shell_plus --lab
}
cmd_debug_shell(){
cd ${PROJECT_PATH}
# . .venv/bin/activate && \
sleep 4
uv run debugpy --listen 0.0.0.0:${DEBUGPY_PORT} \
manage.py git \
-a delete \
-t token \
-u amir \
-p admin1234 \
-o 1 \
-g http://192.168.179.3:3000
}
cmd_debug_shell_create_organization(){
cd ${PROJECT_PATH}
# . .venv/bin/activate && \
sleep 4
uv run debugpy --listen 0.0.0.0:${DEBUGPY_PORT} \
manage.py git \
-a create \
-t organization \
-u amir \
-p admin1234 \
-o TestDemoOrg \
-d TestDemoOrg \
-g http://192.168.179.3:3000
}
cmd_build_dockerimage_cluster(){
podman build -f ./Dockerfile.cluster --tag cluster.local:32000/mono:latest .
podman push cluster.local:32000/mono:latest
}
cmd_demonstartion_wqdms(){
cd /tmp/
. /src/.venv/bin/activate
git clone http://192.168.179.3:3000/unep/wqdms.git
cd wqdms
python manage.py setup -s
python manage.py runserver 0.0.0.0:8002
}