deploy-git/tasks/act.yaml
Knut Ahlers 3edef4fb6a
Use includes to bundle tasks
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2018-03-19 14:54:50 +01:00

24 lines
652 B
YAML

---
- name: Execute pre-commands
command: '{{ item.pre_command.command }}'
args:
chdir: '{{ item.pre_command.chdir | default(item.dest) }}'
when: '{{ item.pre_command is defined }}'
- name: Checkout git repo
git:
repo: '{{ item.repo }}'
dest: '{{ item.dest }}'
force: 'yes'
key_file: '{{ item.key_file | default(omit) }}'
version: '{{ item.version | default("HEAD") }}'
register: git_checkout
- name: Execute post-commands
command: '{{ item.post_command.command }}'
args:
chdir: '{{ item.post_command.chdir | default(item.dest) }}'
when: '{{ item.post_command is defined and git_checkout.changed }}'
...