MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / _create_cmd_file

Method _create_cmd_file

class/projectModel/pythonModel.py:1076–1095  ·  view source on GitHub ↗
(cmd_file, v_ptah_bin, project_path, command, log_file, pid_file, env_file, activate_sh='', evn_name="")

Source from the content-addressed store, hash-verified

1074
1075 @staticmethod
1076 def _create_cmd_file(cmd_file, v_ptah_bin, project_path, command, log_file, pid_file, env_file, activate_sh='', evn_name=""):
1077 start_cmd = '''#!/bin/bash
1078PATH={v_ptah_bin}:{project_path}:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
1079export PATH
1080export BT_PYTHON_SERVICE_SID={sid}
1081{activate_sh}
1082source {env_file}
1083cd {project_path}
1084nohup {command} &>> {log_file} &
1085echo $! > {pid_file}'''.format(
1086 v_ptah_bin=v_ptah_bin,
1087 activate_sh=activate_sh,
1088 project_path=project_path,
1089 command=command,
1090 log_file=log_file,
1091 pid_file=pid_file,
1092 env_file=env_file,
1093 sid=evn_name,
1094 )
1095 public.writeFile(cmd_file, start_cmd)
1096
1097 def _get_cmd_file(self, project_conf):
1098 cmd_file_map = {

Calls 2

writeFileMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected