1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
Ansible_Project/roles/ansistrano.deploy/tasks/update-code.yml

28 lines
961 B
YAML
Raw Permalink Normal View History

2022-05-02 17:37:08 +02:00
---
# Update code deployment step
- name: ANSISTRANO | Get release version
set_fact:
ansistrano_release_version: "{{ lookup('pipe', 'date -u +%Y%m%d%H%M%SZ') }}"
run_once: true
when: ansistrano_release_version is not defined
delegate_to: 127.0.0.1
- name: ANSISTRANO | Get release path
command: echo "{{ ansistrano_releases_path }}/{{ ansistrano_release_version }}"
check_mode: no
register: ansistrano_release_path
- include_tasks: "update-code/{{ ansistrano_deploy_via | default('rsync') }}.yml"
- name: ANSISTRANO | Copy release version into REVISION file
copy:
content: "{{ ansistrano_release_version }}"
dest: "{{ ansistrano_release_path.stdout }}/REVISION"
when: ansistrano_git_result is not defined
- name: ANSISTRANO | Copy git released version into REVISION file
copy:
content: "{{ ansistrano_git_result.after }}"
dest: "{{ ansistrano_release_path.stdout }}/REVISION"
when: ansistrano_git_result is defined