26 lines
715 B
Bash
Executable File
26 lines
715 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
VM="root@95.179.252.111"
|
|
SSH="ssh -i ~/.ssh/vultr_openssh -o StrictHostKeyChecking=no"
|
|
|
|
echo "=== build ==="
|
|
~/lang/.venv/bin/python3 ~/lang/build.sh
|
|
|
|
echo "=== inject API key ==="
|
|
KEY=$(cat ~/lang/token_ru.txt)
|
|
python3 -c "
|
|
h = open('$HOME/lang/dist/index.html').read()
|
|
h = h.replace(\"const GROQ_API_KEY = '';\", \"const GROQ_API_KEY = '$KEY';\")
|
|
open('$HOME/lang/dist/index.html', 'w').write(h)
|
|
"
|
|
echo " done"
|
|
|
|
echo "=== rsync -> VM ==="
|
|
rsync -az -e "$SSH" /home/naeel/lang/dist/ ${VM}:/var/www/lyngvo/
|
|
|
|
echo "=== update server ==="
|
|
rsync -az -e "$SSH" /home/naeel/lang/server/ ${VM}:/opt/groq-proxy/
|
|
$SSH $VM 'systemctl restart groq-proxy && echo OK'
|
|
|
|
echo "=== https://lang.kube5s.ru ==="
|