mirror of
https://github.com/Cian-H/I-Form_Research_Server_Stack.git
synced 2025-12-23 14:42:02 +00:00
Added autogenerated portainer api
This commit is contained in:
29
deploy
Executable file
29
deploy
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env poetry run python
|
||||
|
||||
from typing import Optional
|
||||
import typer # type: ignore
|
||||
import subprocess
|
||||
import portainer # type: ignore
|
||||
|
||||
|
||||
def docker_deploy_core(stack_name: Optional[str] = "core"):
|
||||
"""Simply deploys the core services"""
|
||||
subprocess.run(["docker", "stack", "deploy", "-c", "docker-compose.yaml", stack_name])
|
||||
|
||||
|
||||
def docker_deploy_stack(username: str, password: str, stack_name: Optional[str] = "stack"):
|
||||
"""Deploys the stack using the portainer api, to allow for complete control over the stack"""
|
||||
breakpoint() #! TODO: Implement way of using portainer api to deploy stack
|
||||
# subprocess.run(["docker", "stack", "deploy", "-c", "stack.yaml", stack_name])
|
||||
|
||||
|
||||
def docker_deploy_all(core_name: Optional[str] = "core", stack_name: Optional[str] = "stack"):
|
||||
"""Deploys the core services and the stack"""
|
||||
docker_deploy_core(core_name)
|
||||
docker_deploy_stack(stack_name)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# typer.run(docker_deploy_all)
|
||||
# docker_deploy_core("core")
|
||||
typer.run(docker_deploy_stack)
|
||||
Reference in New Issue
Block a user