Skip to content

Instantly share code, notes, and snippets.

@razikallayi
Last active February 22, 2019 05:44
Show Gist options
  • Save razikallayi/ca1fb7af85fd9d36d378dee66c883339 to your computer and use it in GitHub Desktop.
Save razikallayi/ca1fb7af85fd9d36d378dee66c883339 to your computer and use it in GitHub Desktop.
run hcg services
import os
runnable = [
'acm-api',
'authorization',
'clients-api',
'cportal-api',
'dashboard',
'documents-api',
'eportal-api',
'helpcenter-api',
'hrm',
'hrm-api-gateway',
'logger',
'mailer',
'notifications',
'pdf-service',
'pmr-api',
'reminder',
'report',
'settings-api',
'task-api',
'cron-jobs',
'workflow-api',
]
hcgFolder = os.getcwd()
RED='\033[0;31m'
NC='\033[0m'
# hcgFolder = '~/go/src/github.com/hcghq'
for filename in os.listdir(hcgFolder):
if not os.path.isdir(filename):
continue
if filename in runnable:
branch = 'git rev-parse --abbrev-ref HEAD'
commandString = 'echo '+ filename +' && cd '+ filename + ' && '+ branch +' && git pull && cd ../ && echo "----------------" '
# command = "gnome-terminal --title="+filename+" --tab -- 'bash -c \""+commandString+"; exec bash\"'"
os.system(commandString)
import os
runnable = [
'acm-api',
'authorization',
'clients-api',
# 'cportal-api',
# 'dashboard',
# 'documents-api',
# 'eportal-api',
# 'helpcenter-api',
# 'hrm',
'hrm-api-gateway',
'logger',
'mailer',
'notifications',
# 'pdf-service',
# 'pmr-api',
# 'reminder',
# 'reports',
# 'settings-api',
# 'task-api',
# 'cron-jobs',
# 'workflow-api',
# 'backupmanager',
]
hcgFolder = os.getcwd()
# hcgFolder = '~/go/src/github.com/hcghq'
for filename in os.listdir(hcgFolder):
if not os.path.isdir(filename):
continue
if filename in runnable:
if filename == '2fauth':
commandString = ' echo '+ filename + ' && cd '+ filename + ' && make run '
else:
commandString = ' echo '+ filename + ' && cd '+ filename + ' && go run *.go '
command = "gnome-terminal --title="+filename+" --tab -e 'bash -c \""+commandString+"; exec bash\"'"
os.system(command)
auth = ' cd ~/go/src/github.com/hcghq/2fauth && make run '
command = "gnome-terminal --title=2fauth --tab -e 'bash -c \""+auth+"; exec bash\"'"
os.system(command)
robo3t = ' /usr/local/bin/robo3t/bin/robo3t'
command = "gnome-terminal --title=robo3t --tab -e 'bash -c \""+robo3t+"; exec bash\"'"
os.system(command)
runpull = 'python pull.py'
os.system(runpull)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment