Files
rick-infra/roles/sigvild-gallery/tasks/deploy_backend.yml
Joakim ecbeb07ba2 Migrate sigvild-gallery to production environment
- Add multi-environment architecture (homelab + production)
- Create production environment (mini-vps) for client projects
- Create homelab playbook for arch-vps services
- Create production playbook for mini-vps services
- Move sigvild-gallery from homelab to production
- Restructure variables: group_vars/production + host_vars/arch-vps
- Add backup-sigvild.yml playbook with auto-restore functionality
- Fix restore logic to check for data before creating directories
- Add manual variable loading workaround for Ansible 2.20
- Update all documentation for multi-environment setup
- Add ADR-007 documenting multi-environment architecture decision
2025-12-15 16:33:33 +01:00

44 lines
1.1 KiB
YAML

---
# Backend Deployment Tasks
- name: Build Go binary locally
local_action:
module: shell
cmd: GOOS=linux GOARCH=amd64 go build -o sigvild-gallery .
chdir: "{{ sigvild_gallery_local_project_path }}"
become: no
tags: [backend, build]
- name: Check if binary was built successfully
local_action:
module: stat
path: "{{ sigvild_gallery_local_project_path }}/sigvild-gallery"
register: binary_stat
become: no
tags: [backend, build]
- name: Fail if binary doesn't exist
fail:
msg: "Failed to build sigvild-gallery binary"
when: not binary_stat.stat.exists
tags: [backend, build]
- name: Transfer Go binary
copy:
src: "{{ sigvild_gallery_local_project_path }}/sigvild-gallery"
dest: "{{ sigvild_gallery_binary }}"
owner: "{{ sigvild_gallery_user }}"
group: "{{ sigvild_gallery_user }}"
mode: '0755'
notify: restart sigvild-gallery
tags: [backend]
- name: Create data directory for PocketBase (if not created by restore)
file:
path: "{{ sigvild_gallery_data_dir }}"
state: directory
owner: "{{ sigvild_gallery_user }}"
group: "{{ sigvild_gallery_user }}"
mode: '0755'
tags: [backend]