36 lines
1.1 KiB
YAML
36 lines
1.1 KiB
YAML
---
|
|
- name: Clone or update Gitvana repository
|
|
ansible.builtin.git:
|
|
repo: "{{ gitvana_repo_url }}"
|
|
dest: "{{ gitvana_app_root }}"
|
|
version: "{{ gitvana_repo_version }}"
|
|
update: true
|
|
key_file: "{{ gitvana_git_key_file | default(omit) }}"
|
|
accept_hostkey: true
|
|
become: true
|
|
become_user: "{{ gitvana_app_user }}"
|
|
register: gitvana_repo_sync
|
|
|
|
- name: Ensure repository ownership is correct
|
|
ansible.builtin.file:
|
|
path: "{{ gitvana_app_root }}"
|
|
state: directory
|
|
recurse: true
|
|
owner: "{{ gitvana_app_user }}"
|
|
group: "{{ gitvana_app_group }}"
|
|
|
|
- name: Check if dependencies directory exists
|
|
ansible.builtin.stat:
|
|
path: "{{ gitvana_app_root }}/node_modules"
|
|
register: gitvana_node_modules
|
|
|
|
- name: Install application dependencies with Bun
|
|
ansible.builtin.command:
|
|
cmd: /usr/local/bin/bun install --frozen-lockfile
|
|
chdir: "{{ gitvana_app_root }}"
|
|
become: true
|
|
become_user: "{{ gitvana_app_user }}"
|
|
when: gitvana_repo_sync.changed or not gitvana_node_modules.stat.exists
|
|
changed_when: true
|
|
notify: Restart Gitvana service
|