Example #1
0
 def _execute(self, ssh_session: SSHCommandExecutor) -> None:
     logging.info(f"[{self._configuration.node_ip}] EXECUTE RUN COMMAND")
     ssh_session.execute(
         f"cd {self._configuration.home_dir}/{self._configuration.project_root_dir}"
     )
     ssh_session.execute(
         f"screen -d -m -S {self._configuration.project_title} bash -c '{self._run_command}'"
     )
Example #2
0
    def run(self) -> None:
        ssh_executor: SSHCommandExecutor = SSHCommandExecutor(
            self._configuration.node_ip, self._configuration.username,
            self._configuration.password)
        self._execute(ssh_executor)
        ssh_executor.close()

        logging.info(f"[{self._configuration.node_ip}] SUCCESS")
Example #3
0
    def run(self) -> None:
        ssh_executor: SSHCommandExecutor = SSHCommandExecutor(
            self._configuration.node_ip, self._configuration.username,
            self._configuration.password)
        self._clean_up(ssh_executor)
        self._create_home_dir(ssh_executor)
        self._checkout_project(ssh_executor)
        self._build_project(ssh_executor)
        self._transfer_corpus()

        ssh_executor.close()

        logging.info(f"[{self._configuration.node_ip}] SUCCESS")
Example #4
0
 def _kill_screen(self, ssh_session: SSHCommandExecutor) -> None:
     logging.info(f"[{self._configuration.node_ip}] KILL SCREEN")
     ssh_session.execute(
         f"screen -X -S {self._configuration.project_title} quit")
Example #5
0
 def _build_project(self, ssh_session: SSHCommandExecutor) -> None:
     logging.info(f"[{self._configuration.node_ip}] BUILD")
     ssh_session.execute(self._build_command)
Example #6
0
 def _checkout_project(self, ssh_session: SSHCommandExecutor) -> None:
     logging.info(f"[{self._configuration.node_ip}] CHECKOUT")
     ssh_session.execute(f"git clone {self._github_source}")
     ssh_session.execute(f"cd {self._configuration.project_root_dir}")
Example #7
0
 def _create_home_dir(self, ssh_session: SSHCommandExecutor) -> None:
     logging.info(f"[{self._configuration.node_ip}] CREATE HOME DIR")
     ssh_session.execute(f"mkdir {self._configuration.home_dir}")
     ssh_session.execute(f"cd {self._configuration.home_dir}")
Example #8
0
 def _clean_up(self, ssh_session: SSHCommandExecutor) -> None:
     logging.info(f"[{self._configuration.node_ip}] CLEAN UP")
     ssh_session.execute(f"rm -rf {self._configuration.home_dir}")