Exemplo 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'))
Exemplo 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')
Exemplo 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'))
Exemplo 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"')
Exemplo 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'))
Exemplo n.º 6
0
 def __audit_client():
     command_shell.run_shell_command(
         'cd ' + CoreUtils.get_option('main_directory') +
         '/oms-discussions && sudo npm audit')
Exemplo n.º 7
0
 def __audit_api():
     command_shell.run_shell_command(
         'cd ' + CoreUtils.get_option('main_directory') +
         '/api && sudo npm audit')
Exemplo 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'
     )