-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.py
24 lines (18 loc) · 815 Bytes
/
deploy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os
import subprocess
import time
deploy_dir = 'deployment'
images = [('client-gateway', 'client_gateway'), ('market-data-publisher', 'market_data_publisher'), ('order-manager', 'order_manager')]
for image, folder in images:
subprocess.run(['docker', 'build', '-t', image, folder], check=True)
subprocess.run(['minikube', 'image', 'load', image], check=True)
first_deployment = ['redis.yaml', 'postgres.yaml']
for file in first_deployment:
full_file_path = os.path.join(deploy_dir, file)
subprocess.run(['kubectl', 'apply', '-f', full_file_path], check=True)
time.sleep(20)
for file in os.listdir(deploy_dir):
if file in first_deployment:
continue
full_file_path = os.path.join(deploy_dir, file)
subprocess.run(['kubectl', 'apply', '-f', full_file_path], check=True)