-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_remote.sh
More file actions
48 lines (38 loc) · 999 Bytes
/
deploy_remote.sh
File metadata and controls
48 lines (38 loc) · 999 Bytes
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
#!/bin/bash
set -e
# Install System Deps
sudo apt-get update
sudo apt-get install -y python3-pip python3-venv unzip git
# Unzip (Push Install)
if [ -f "deployment_package.zip" ]; then
echo "Unzipping deployment package..."
unzip -o deployment_package.zip -d BPMN_experiments
rm deployment_package.zip
fi
cd BPMN_experiments
# Python Env
if [ ! -d "venv" ]; then
python3 -m venv venv
fi
venv/bin/pip install -r requirements.txt
# Keys (Populate .env)
cat <<EOF > .env
POLICYENGINE_CLIENT_ID=YOUR_CLIENT_ID_HERE
POLICYENGINE_CLIENT_SECRET=YOUR_CLIENT_SECRET_HERE
EOF
# Start Infrastructure
sudo docker compose up -d
# Wait for Zeebe
echo "Waiting 30s for Zeebe..."
sleep 30
# Deploy Rules
echo "Deploying Rules..."
venv/bin/python3 deploy_master_system.py
# Update Start Script to use venv
sed -i 's|python3|venv/bin/python3|g' start.sh
# Stop any existing
pkill -f public_app.py || true
pkill -f aggregation_worker.py || true
# Run Start Script
chmod +x start.sh
./start.sh