Skip to content
Snippets Groups Projects

update: add build.py run backend option

Merged Mingrui Zhang requested to merge UpdateBuildPy into main
2 files
+ 15
2
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 14
1
@@ -15,7 +15,8 @@ class RunType(Enum):
Server = 0
Web = 1
Sql = 2
All = 3
Backend = 3
All = 4
# General string const
@@ -131,6 +132,12 @@ def run(type):
process = subprocess.Popen(
["docker", "compose", "-f", docker_compose_file_path, "up", db_service_name, "--build"], stdout=sys.stdout)
outs, _ = process.communicate()
elif type == RunType.Backend:
# Run and publish server and sql process together
# Command: docker compose -f ./docker/docker-compose.yml up <service_name> --build
process = subprocess.Popen(
["docker", "compose", "-f", docker_compose_file_path, "up", server_service_name, db_service_name, "--build"], stdout=sys.stdout)
outs, _ = process.communicate()
def parse_args():
@@ -166,6 +173,9 @@ def parse_args():
run.add_argument(
'-rsql', '--runSQLProcess', default=False, action='store_true',
help='Run mysql process on docker container')
run.add_argument(
'-rbe', '--runBackendProcess', default=False, action='store_true',
help='Run server and mysql process together on docker container')
run.add_argument(
'-rall', '--runAllProcess', default=False, action='store_true',
help='Run all processes')
@@ -204,6 +214,9 @@ def main():
if parsed_args.runSQLProcess:
if parsed_args.local:
run(RunType.Sql)
if parsed_args.runBackendProcess:
if parsed_args.local:
run(RunType.Backend)
if __name__ == "__main__":
Loading