Skip to content

Commit

Permalink
Deploy on change only
Browse files Browse the repository at this point in the history
  • Loading branch information
pavetok committed Mar 30, 2024
1 parent 6d218ef commit 5c53135
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions orchestrator/ansible/images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
file: tasks/{{ inventory_hostname }}/build.yaml
when: hostvars[inventory_hostname].image_status is changed

# building everything without exception otherwise purely external libs will not be published
# TODO: build only changed apps and purely external libs which have no dependees
- import_playbook: binaries.yaml # noqa: name[play]
vars:
maven_phase: "{{ 'deploy' if repo_mode == 'rw' else 'install' }}"
maven_phase: "{{ 'deploy' if repo_mode == 'rw' and hostvars.app.image_status is changed else 'install' }}"
when: >-
hostvars.app.image_status is changed or
hostvars.binarier.image_status is changed
hostvars.builder.image_status is changed
- name: ALL IMAGES
hosts: images
Expand Down
2 changes: 1 addition & 1 deletion orchestrator/ansible/inventory/aliases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ stacks:
product:
tools:
hosts:
binarier:
builder:
stacker:
all:
vars:
Expand Down
2 changes: 1 addition & 1 deletion orchestrator/ansible/stacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
when: >-
hostvars.product.image_status is changed or
hostvars.stacker.image_status is changed or
hostvars.binarier.image_status is changed
hostvars.builder.image_status is changed
- name: ALL STACKS
hosts: stacks:tools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
tasks_from: clean
vars:
image_keys:
- "tool/binarier/{{ devenv }}"
- "tool/builder/{{ devenv }}"

- ansible.builtin.import_role: # noqa: name[missing]
name: image
tasks_from: build
vars:
image_home: "{{ project.dir }}/tool"
image_context: .
image_key: "tool/binarier/{{ devenv }}"
image_tag: "tool/binarier:{{ devenv }}"
image_key: "tool/builder/{{ devenv }}"
image_tag: "tool/builder:{{ devenv }}"
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
changed_when:
- image_status.rc != 0
loop:
- "tool/binarier:{{ package_tag }}"
- "tool/builder:{{ package_tag }}"
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
name: image
tasks_from: publish
vars:
image_source_tag: "tool/binarier:{{ devenv }}"
image_source_tag: "tool/builder:{{ devenv }}"
image_target_tags:
- "{{ image_ns }}/tool/binarier:{{ hostvars.binarier.package_tag }}"
- "{{ image_ns }}/tool/builder:{{ hostvars.builder.package_tag }}"

0 comments on commit 5c53135

Please sign in to comment.