Update 'hertzner.py'

This commit is contained in:
Patryk Gałka 2024-02-08 05:14:35 +01:00
parent 415abc7c8b
commit ef5f109964

View File

@ -6,7 +6,6 @@ from hcloud.server_types import ServerType
from hcloud._exceptions import APIException from hcloud._exceptions import APIException
from hcloud.servers.domain import ServerCreatePublicNetwork from hcloud.servers.domain import ServerCreatePublicNetwork
from time import sleep
YOUR_API_TOKEN = "" YOUR_API_TOKEN = ""
@ -98,15 +97,15 @@ runcmd:
- apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin - apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
- systemctl enable docker - systemctl enable docker
- systemctl start docker - systemctl start docker
- git clone https://git.wmi.amu.edu.pl/s434686/zpzc-3 - git clone https://git.wmi.amu.edu.pl/s434686/zpzc-3.git /zpzc-3
- docker compose -f /zpzc-3/db.yml up -d
- echo 'Done'
bootcmd:
- docker compose -f /zpzc-3/db.yml up -d
final_message: "The system is finally up, after $UPTIME seconds" final_message: "The system is finally up, after $UPTIME seconds"
bootcmd: """
- cd zpzc-3
- docker compose -f db.yml up -d
"""
) )
db_server = response.server db_server = response.server
print(f"{db_server.id=} {db_server.name=} {db_server.status=}") print(f"{db_server.id=} {db_server.name=} {db_server.status=}")
@ -150,18 +149,16 @@ runcmd:
- apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin - apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
- systemctl enable docker - systemctl enable docker
- systemctl start docker - systemctl start docker
- git clone https://git.wmi.amu.edu.pl/s434686/zpzc-3 - git clone https://git.wmi.amu.edu.pl/s434686/zpzc-3.git /zpzc-3
- cd zpzc-3 - docker compose -f /zpzc-3/gitea.yml up -d
- docker compose -f db.yml up -d - echo 'Done'
bootcmd:
- docker compose -f /zpzc-3/gitea.yml up -d
final_message: "The system is finally up, after $UPTIME seconds" final_message: "The system is finally up, after $UPTIME seconds"
bootcmd: """
- cd zpzc-3
- docker compose -f db.yml up -d
""",
) )
_gitea_server = gitea_server.server _gitea_server = gitea_server.server
print(f"{_gitea_server.id=} {_gitea_server.name=} {_gitea_server.status=}, {gitea_server.root_password} ") print(f"{_gitea_server.id=} {_gitea_server.name=} {_gitea_server.status=}, {gitea_server.root_password} ")