mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-10-31 18:29:21 +00:00 
			
		
		
		
	Refactor: remove Python-based Listmonk upgrade logic and implement upgrade as Ansible task
Details: - Removed upgrade_listmonk() function and related calls from update-docker script - Added dedicated Ansible task in web-app-listmonk role to run non-interactive DB/schema upgrade - Conditional execution via MODE_UPDATE Ref: https://chatgpt.com/share/68bbeff1-27a0-800f-bef3-03ab597595fd
This commit is contained in:
		| @@ -144,14 +144,6 @@ def update_discourse(directory): | ||||
|     else: | ||||
|         print("Discourse update skipped. No changes in git repository.") | ||||
|  | ||||
| def upgrade_listmonk(): | ||||
|     """ | ||||
|     Runs the upgrade for Listmonk | ||||
|     """ | ||||
|     print("Starting Listmonk upgrade.") | ||||
|     run_command('echo "y" | docker compose run -T application ./listmonk --upgrade') | ||||
|     print("Upgrade complete.") | ||||
|  | ||||
| def update_procedure(command): | ||||
|     """ | ||||
|     Attempts to execute a command up to a maximum number of retries. | ||||
| @@ -210,8 +202,6 @@ if __name__ == "__main__": | ||||
|                 # The following instances need additional update and upgrade procedures | ||||
|                 if os.path.basename(dir_path) == "discourse": | ||||
|                     update_discourse(dir_path) | ||||
|                 elif os.path.basename(dir_path) == "listmonk": | ||||
|                     upgrade_listmonk() | ||||
|                      | ||||
|  | ||||
|                 # @todo implement dedicated procedure for bluesky | ||||
|                 # @todo implement dedicated procedure for taiga | ||||
|   | ||||
| @@ -30,6 +30,14 @@ | ||||
|     chdir: "{{ docker_compose.directories.instance }}" | ||||
|   when: "'No relations found.' in db_tables.stdout" | ||||
|  | ||||
| - name: "Listmonk | run DB/schema upgrade (non-interactive)" | ||||
|   ansible.builtin.shell: | | ||||
|     set -o pipefail | ||||
|     echo "y" | docker compose run -T application ./listmonk --upgrade | ||||
|   args: | ||||
|     chdir: "{{ docker_compose.directories.instance }}" | ||||
|   when: MODE_UPDATE | bool | ||||
|  | ||||
| - name: Build OIDC settings JSON | ||||
|   set_fact: | ||||
|     oidc_settings_json: >- | ||||
| @@ -73,3 +81,4 @@ | ||||
|   no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}" | ||||
|   async: "{{ ASYNC_TIME if ASYNC_ENABLED | bool else omit }}" | ||||
|   poll:  "{{ ASYNC_POLL if ASYNC_ENABLED | bool else omit }}" | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user