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"
|
||||
|
||||
include:
|
||||
- volumes.yaml
|
||||
- networks.yaml
|
||||
- secrets.yaml
|
||||
|
||||
services:
|
||||
###~~~~~~ First, we should plan our network management services ~~~~~~###
|
||||
# Obviously, we should add the portainer agent service for managing swarm resources
|
||||
|
||||
17
deploy
17
deploy
@@ -33,21 +33,24 @@ def portainer_deploy_stack(stack_file: str, stacks: portainer.api.stacks_api.Sta
|
||||
else:
|
||||
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
|
||||
repository_url = fetch_repository_url()
|
||||
print(f"Deploying stack {stack_name} from {stack_path} @ {repository_url}")
|
||||
|
||||
stacks.stack_create_docker_swarm_repository(
|
||||
endpoint_id=endpoint_id,
|
||||
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),
|
||||
"repository_url": repository_url,
|
||||
}
|
||||
scoped_kwargs.update(kwargs)
|
||||
stacks.stack_create_docker_swarm_repository(
|
||||
endpoint_id=endpoint_id,
|
||||
body = portainer.StacksSwarmStackFromGitRepositoryPayload(
|
||||
**scoped_kwargs,
|
||||
)
|
||||
)
|
||||
print(f"Stack {stack_name} deployed")
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
version: "3.8"
|
||||
|
||||
include:
|
||||
- volumes.yaml
|
||||
- networks.yaml
|
||||
- secrets.yaml
|
||||
|
||||
services:
|
||||
# This service runs a grafana instance for hosting dashboards
|
||||
grafana:
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
version: "3.8"
|
||||
|
||||
networks:
|
||||
i-form_research_server_stack:
|
||||
driver: overlay
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
version: "3.8"
|
||||
|
||||
secrets:
|
||||
elabftw_sql_key:
|
||||
external: true
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
version: "3.8"
|
||||
|
||||
# This defines the NFS volumes for persistence
|
||||
#! This requires nodes to be IP whitelisted in the NAS
|
||||
volumes:
|
||||
|
||||
Reference in New Issue
Block a user