Ejemplo n.º 1
0
 def __runmaintenance(self, args):
     if args == 'db':
         print('run DB Maintenance')
     elif args == 'manage_script_upgrade':
         self.__runmanagementscriptupdate()
     elif args == 'logs':
         print('Logs Maintenance')
     elif args == 'system_upgrades':
         command_shell.run_shell_command(
             'sudo apt-get update -y && sudo apt-get upgrade -y')
     else:
         print(CoreUtils.get_help('do maintenance'))
Ejemplo n.º 2
0
 def __runmanagementscriptupdate():
     command_shell.run_shell_command(
         'git config --global credential.helper \"cache --timeout=3600\"')
     command_shell.run_shell_command(
         'cd \\oms-discussions\\build && sudo git reset --hard HEAD')
     command_shell.run_shell_command('sudo git clean -f')
     command_shell.run_shell_command('sudo git pull')
Ejemplo n.º 3
0
 def runcommand(self):
     if self.__command__ == 'nginx':
         command_shell.run_shell_command("sudo service nginx restart")
     elif self.__command__ == 'postgresql':
         command_shell.run_shell_command("sudo service ")
     elif self.__command__ == 'api-dev':
         print('place holder')
     elif self.__command__ == 'client-dev':
         print('place holder')
     elif self.__command__ == 'api-prod':
         print('place holder')
     elif self.__command__ == 'client-prod':
         print('place holder')
     else:
         print(CoreUtils.get_help('restart'))
Ejemplo n.º 4
0
 def __installproject():
     command_shell.run_shell_command(
         'git config --global credential.helper \"cache --timeout=3600\"')
     command_shell.run_shell_command(
         'git clone https://github.gatech.edu/wking6/oms-discussions.git ' +
         CoreUtils.get_option('main_directory'))
     command_shell.run_shell_command(
         'cd ' + CoreUtils.get_option('main_directory') + '/ansible')
     command_shell.run_shell_command(
         'ansible-playbook -c local omsdiscussions.yml -i "localhost"')
Ejemplo n.º 5
0
 def build(self):
     if self.__command == 'api-dev':
         command_shell.run_shell_command(
             'cd ' + CoreUtils.get_option('main_directory') + '/api')
         command_shell.run_shell_command('npm install')
     elif self.__command == 'client-dev':
         command_shell.run_shell_command(
             'cd ' + CoreUtils.get_option('main_directory') +
             '/client && sudo npm install && sudo ng build')
     elif self.__command == 'api-prod':
         command_shell.run_shell_command(
             'cd ' + CoreUtils.get_option('main_directory') +
             '/api && sudo npm install')
     elif self.__command == 'client-prod':
         command_shell.run_shell_command(
             'cd ' + CoreUtils.get_option('main_directory') +
             '/client && sudo npm install && sudo ng build --dist --prod --build-optimizer'
         )
     else:
         print(CoreUtils.get_help('show'))
Ejemplo n.º 6
0
 def __audit_client():
     command_shell.run_shell_command(
         'cd ' + CoreUtils.get_option('main_directory') +
         '/oms-discussions && sudo npm audit')
Ejemplo n.º 7
0
 def __audit_api():
     command_shell.run_shell_command(
         'cd ' + CoreUtils.get_option('main_directory') +
         '/api && sudo npm audit')
Ejemplo n.º 8
0
 def __installpreqs():
     command_shell.run_shell_command(
         'sudo apt-add-repository ppa:ansible/ansible-2.6 && sudo apt-get update && sudo apt-get install -y ansible git'
     )