mirror of
https://github.com/Cian-H/I-Form_Research_Server_Stack.git
synced 2025-12-23 06:32:07 +00:00
Added versions and fixed kwargs in deploy
This commit is contained in:
@@ -1,10 +1,5 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
|
|
||||||
include:
|
|
||||||
- volumes.yaml
|
|
||||||
- networks.yaml
|
|
||||||
- secrets.yaml
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
###~~~~~~ First, we should plan our network management services ~~~~~~###
|
###~~~~~~ First, we should plan our network management services ~~~~~~###
|
||||||
# Obviously, we should add the portainer agent service for managing swarm resources
|
# Obviously, we should add the portainer agent service for managing swarm resources
|
||||||
|
|||||||
23
deploy
23
deploy
@@ -33,21 +33,24 @@ def portainer_deploy_stack(stack_file: str, stacks: portainer.api.stacks_api.Sta
|
|||||||
else:
|
else:
|
||||||
raise FileNotFoundError(f"Could not find stack file {stack_file}")
|
raise FileNotFoundError(f"Could not find stack file {stack_file}")
|
||||||
|
|
||||||
print(f"Deploying stack {stack_name} from {stack_path}")
|
|
||||||
stack_name = stack_name or stack_path.stem
|
stack_name = stack_name or stack_path.stem
|
||||||
|
repository_url = fetch_repository_url()
|
||||||
|
print(f"Deploying stack {stack_name} from {stack_path} @ {repository_url}")
|
||||||
|
|
||||||
|
scoped_kwargs = {
|
||||||
|
# "auto_update": portainer.PortainerAutoUpdateSettings(
|
||||||
|
# interval="60m",
|
||||||
|
# ),
|
||||||
|
"name": stack_name,
|
||||||
|
"compose_file": str(stack_path),
|
||||||
|
"swarm_id": docker.from_env().swarm.id,
|
||||||
|
"repository_url": repository_url,
|
||||||
|
}
|
||||||
|
scoped_kwargs.update(kwargs)
|
||||||
stacks.stack_create_docker_swarm_repository(
|
stacks.stack_create_docker_swarm_repository(
|
||||||
endpoint_id=endpoint_id,
|
endpoint_id=endpoint_id,
|
||||||
body = portainer.StacksSwarmStackFromGitRepositoryPayload(
|
body = portainer.StacksSwarmStackFromGitRepositoryPayload(
|
||||||
**{
|
**scoped_kwargs,
|
||||||
# "auto_update": portainer.PortainerAutoUpdateSettings(
|
|
||||||
# interval="60m",
|
|
||||||
# ),
|
|
||||||
"name": stack_name,
|
|
||||||
"compose_file": str(stack_path),
|
|
||||||
"swarm_id": docker.from_env().swarm.id,
|
|
||||||
"repository_url": fetch_repository_url(),
|
|
||||||
}.update(kwargs),
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
print(f"Stack {stack_name} deployed")
|
print(f"Stack {stack_name} deployed")
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
|
|
||||||
include:
|
|
||||||
- volumes.yaml
|
|
||||||
- networks.yaml
|
|
||||||
- secrets.yaml
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# This service runs a grafana instance for hosting dashboards
|
# This service runs a grafana instance for hosting dashboards
|
||||||
grafana:
|
grafana:
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
version: "3.8"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
i-form_research_server_stack:
|
i-form_research_server_stack:
|
||||||
driver: overlay
|
driver: overlay
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
version: "3.8"
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
elabftw_sql_key:
|
elabftw_sql_key:
|
||||||
external: true
|
external: true
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
version: "3.8"
|
||||||
|
|
||||||
# This defines the NFS volumes for persistence
|
# This defines the NFS volumes for persistence
|
||||||
#! This requires nodes to be IP whitelisted in the NAS
|
#! This requires nodes to be IP whitelisted in the NAS
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
Reference in New Issue
Block a user