【发布时间】:2018-10-25 14:29:11
【问题描述】:
对于作业自动化,我需要从远程存储库中提取数据并在之后执行一些任务。但是只有在数据更改时才应该运行任务。
换句话说:只有在更改源时才从 repo 中提取源并重建应用程序
【问题讨论】:
对于作业自动化,我需要从远程存储库中提取数据并在之后执行一些任务。但是只有在数据更改时才应该运行任务。
换句话说:只有在更改源时才从 repo 中提取源并重建应用程序
【问题讨论】:
- name: Get data from repo
git:
repo: "{{ repo }}"
dest: ""{{ local_path }}""
clone: yes
force: yes
version: "{{ branch }}"
register: data_changed
- name: build changes if changed
shell: |
bash -c "any shell script here"
when: data_changed.before != data_changed.after
when: data_changed.before != data_changed.after 仅当数据在第一个任务期间发生变化时为真
【讨论】: