Files
ouranos/ansible/kernos/stage.yml
2026-04-11 07:32:40 -04:00

47 lines
1.3 KiB
YAML

---
- name: Stage Kernos release tarball
hosts: localhost
gather_facts: false
vars:
archive_path: "{{rel_dir}}/kernos_{{kernos_rel}}.tar"
kernos_repo_url: "ssh://git@git.helu.ca:22022/r/kernos.git"
kernos_repo_dir: "{{repo_dir}}/kernos"
tasks:
- name: Ensure release directory exists
file:
path: "{{rel_dir}}"
state: directory
mode: '755'
- name: Ensure repo directory exists
file:
path: "{{repo_dir}}"
state: directory
mode: '755'
- name: Clone Kernos repository if not present
ansible.builtin.git:
repo: "{{kernos_repo_url}}"
dest: "{{kernos_repo_dir}}"
version: "{{kernos_rel}}"
accept_hostkey: true
register: git_clone
ignore_errors: true
- name: Fetch all remote branches and tags
ansible.builtin.command: git fetch --all
args:
chdir: "{{kernos_repo_dir}}"
when: git_clone is not changed
- name: Pull latest changes
ansible.builtin.command: git pull
args:
chdir: "{{kernos_repo_dir}}"
when: git_clone is not changed
- name: Create Kernos archive for specified release
ansible.builtin.command: git archive -o "{{archive_path}}" "{{kernos_rel}}"
args:
chdir: "{{kernos_repo_dir}}"