mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-02-22 20:39:40 +01:00
Solved discourse update bug
This commit is contained in:
parent
c5de205e87
commit
3a6fc106a8
@ -42,6 +42,7 @@ defaults_applications:
|
|||||||
|
|
||||||
## Discourse:
|
## Discourse:
|
||||||
discourse:
|
discourse:
|
||||||
|
network: "discourse_default" # Name of the docker network
|
||||||
container: "discourse_application" # Name of the container application
|
container: "discourse_application" # Name of the container application
|
||||||
repository: "discourse_repository" # Name of the repository folder
|
repository: "discourse_repository" # Name of the repository folder
|
||||||
# database_password: # Needs to be defined in inventory file
|
# database_password: # Needs to be defined in inventory file
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
- name: "add central database temporary to {{application_id}}_default"
|
- name: "add central database temporary to {{application_id}}_default"
|
||||||
command:
|
command:
|
||||||
cmd: "docker network connect discourse_default central-{{ database_type }}"
|
cmd: "docker network connect {{applications.discourse.network}} central-{{ database_type }}"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
when: enable_central_database | bool
|
when: enable_central_database | bool
|
||||||
listen: recreate discourse
|
listen: recreate discourse
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
- name: "cleanup central database from {{application_id}}_default network"
|
- name: "cleanup central database from {{application_id}}_default network"
|
||||||
command:
|
command:
|
||||||
cmd: "docker network disconnect discourse_default central-{{ database_type }}"
|
cmd: "docker network disconnect {{applications.discourse.network}} central-{{ database_type }}"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
when: mode_reset | bool
|
when: mode_reset | bool
|
||||||
|
|
||||||
@ -68,6 +68,6 @@
|
|||||||
|
|
||||||
- name: "remove central database from {{application_id}}_default"
|
- name: "remove central database from {{application_id}}_default"
|
||||||
command:
|
command:
|
||||||
cmd: "docker network disconnect discourse_default central-{{ database_type }}"
|
cmd: "docker network disconnect {{applications.discourse.network}} central-{{ database_type }}"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
when: enable_central_database | bool
|
when: enable_central_database | bool
|
||||||
|
@ -130,7 +130,15 @@ def update_discourse(directory):
|
|||||||
if git_pull():
|
if git_pull():
|
||||||
print("Start Discourse update procedure.")
|
print("Start Discourse update procedure.")
|
||||||
update_procedure("docker stop {{applications.discourse.container}}")
|
update_procedure("docker stop {{applications.discourse.container}}")
|
||||||
update_procedure("docker network connect discourse_default central-postgres")
|
update_procedure("docker rm {{applications.discourse.container}}")
|
||||||
|
try:
|
||||||
|
update_procedure("docker network connect {{applications.discourse.network}} central-postgres")
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
error_message = e.output.decode()
|
||||||
|
if "already exists" in error_message or "is already connected" in error_message:
|
||||||
|
print("Network connection already exists. Skipping...")
|
||||||
|
else:
|
||||||
|
raise
|
||||||
update_procedure("./launcher rebuild {{applications.discourse.container}}")
|
update_procedure("./launcher rebuild {{applications.discourse.container}}")
|
||||||
else:
|
else:
|
||||||
print("Discourse update skipped. No changes in git repository.")
|
print("Discourse update skipped. No changes in git repository.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user