-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
38 lines (31 loc) · 1010 Bytes
/
setup.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import os
import time
import webbrowser
print("Beginning set-up")
os.system("pip3 install -r requirements.txt")
print("Step1-> setting clustername")
os.system("python3 settings.py")
print("Step2-> adding the git repository")
os.system("git add .")
print("Step 3->commit and pushing to hasura cluster")
os.system("git commit -m'Initial Commit'")
x=os.system("git push hasura master")
if(x!=0):
print("Remote server :EROR Redeploying it may take seconds...")
while(x!=0):
time.sleep(1)
x=os.system("git push hasura master")
import yaml
with open("clusters.yaml", 'r') as stream:
try:
clustername=yaml.load(stream)[0]['name']
print(clustername)
except yaml.YAMLError as exc:
print(exc)
print("Deployement succesfull!!")
print("Trying to open the url..Hold on.........")
time.sleep(10)
try:
webbrowser.open("https://ui."+clustername+".hasura-app.io/")
except:
print("Opening failed.Try "+"https://ui."+clustername+".hasura-app.io/"+" opening manually..")