-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Isolate solution and pipeline changes (#110)
- Loading branch information
Showing
33 changed files
with
264 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,42 @@ | ||
--- | ||
usage: toy | ||
prefs: turing | ||
|
||
lib_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=libs')[:7] }}" | ||
app_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=apps')[:7] }}" | ||
schema_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=schemas')[:7] }}" | ||
solution_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=solutions')[:7] }}" | ||
|
||
environ: green | ||
lib_version: 0.1.0-{{ lib_cid }} | ||
app_version: 0.1.0-{{ app_cid }} | ||
|
||
dx_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=.dx')[:7] }}" | ||
env_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=.env/' ~ environ)[:7] }}" | ||
test_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=tests')[:7] }}" | ||
|
||
lib_version: 0.1.0-{{ lib_cid }} | ||
app_version: 0.1.0-{{ app_cid }} | ||
environ: green | ||
|
||
usage: toy | ||
prefs: turing | ||
dx_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=.dx')[:7] }}" | ||
tool_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=.tools')[:7] }}" | ||
environ_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=.environs/' ~ environ)[:7] }}" | ||
pipeline_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=.github')[:7] }}" | ||
|
||
# How to work with private remote repositories? | ||
# offline - no pull, nor push packages | ||
# read_only - can pull packages | ||
# read_write - can pull and push packages | ||
repository_mode: offline | ||
# solution - focus on solution changes | ||
# pipeline - focus on pipeline changes | ||
# none - without any particular focus | ||
focus: none | ||
|
||
docker_registry: ghcr.io | ||
docker_repo: smecalculus | ||
binary_repo: local | ||
image_repo: local | ||
|
||
docker_entity: "{{ 'image' if repository_mode == 'offline' else 'manifest' }}" | ||
image_group: smecalculus | ||
|
||
schema_images: | ||
postgres: "{{ docker_registry }}/{{ docker_repo }}/schema-postgres" | ||
app_images: | ||
foo: "{{ docker_registry }}/{{ docker_repo }}/app-foo" | ||
solution_image: "{{ docker_registry }}/{{ docker_repo }}/solution-{{ usage }}-{{ prefs }}" | ||
pipeline_image: "{{ docker_registry }}/{{ docker_repo }}/pipeline-{{ environ }}" | ||
foo: "{{ image_repo }}/{{ image_group }}/app-foo" | ||
|
||
schema_images: | ||
postgres: "{{ image_repo }}/{{ image_group }}/schema-postgres" | ||
|
||
stack_images: | ||
solution: "{{ image_repo }}/{{ image_group }}/solution-{{ usage }}-{{ prefs }}" | ||
pipeline: "{{ image_repo }}/{{ image_group }}/pipeline-{{ environ }}" | ||
|
||
capture_solution: true | ||
capture_pipeline: true | ||
docker_entity: "{{ 'image' if image_repo == 'local' else 'manifest' }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--- | ||
image_tag: latest | ||
image_context: . | ||
image_push: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
- import_playbook: images.yml # noqa: name[play] | ||
tags: [images, deps] | ||
|
||
- name: Capturing | ||
hosts: solution | ||
run_once: true | ||
tasks: | ||
- ansible.builtin.import_tasks: # noqa: name[missing] | ||
file: tasks/solution/status.yml | ||
tags: [always] | ||
|
||
- name: Capturing | ||
hosts: pipeline | ||
run_once: true | ||
tasks: | ||
- ansible.builtin.import_tasks: # noqa: name[missing] | ||
file: tasks/pipeline/status.yml | ||
tags: [always] | ||
|
||
- name: Testing | ||
hosts: stack | ||
run_once: true | ||
tasks: | ||
- ansible.builtin.import_tasks: # noqa: name[missing] | ||
file: tasks/solution/compile.yml | ||
tags: [compile] | ||
when: > | ||
hostvars.solution.stack_status is changed or | ||
hostvars.pipeline.stack_status is changed | ||
- ansible.builtin.import_tasks: # noqa: name[missing] | ||
file: tasks/solution/test.yml | ||
tags: [test] | ||
when: > | ||
hostvars.solution.stack_status is changed or | ||
hostvars.pipeline.stack_status is changed | ||
- name: Packaging | ||
hosts: solution | ||
run_once: true | ||
tasks: | ||
- ansible.builtin.import_tasks: # noqa: name[missing] | ||
file: tasks/solution/package.yml | ||
tags: [package] | ||
when: stack_status is changed | ||
|
||
- name: Packaging | ||
hosts: pipeline | ||
run_once: true | ||
tasks: | ||
- ansible.builtin.import_tasks: # noqa: name[missing] | ||
file: tasks/pipeline/package.yml | ||
tags: [package] | ||
when: stack_status is changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
--- | ||
- name: Capture pipeline tag | ||
- name: Capture cid | ||
ansible.builtin.command: | ||
cmd: git hash-object --stdin | ||
stdin: | | ||
{{ dx_cid }} | ||
{{ env_cid }} | ||
{{ tool_cid }} | ||
{{ environ_cid }} | ||
{{ test_cid }} | ||
register: pipeline_tag | ||
register: stack_cid | ||
changed_when: false | ||
|
||
- name: Capture pipeline status | ||
- name: Capture status | ||
ansible.builtin.command: | ||
cmd: docker {{ docker_entity }} inspect {{ pipeline_image }}:{{ pipeline_tag.stdout[:7] }} | ||
register: pipeline_status | ||
cmd: docker {{ docker_entity }} inspect {{ stack_images.pipeline }}:{{ stack_cid.stdout[:7] }} | ||
register: stack_status | ||
changed_when: | ||
- capture_pipeline|bool | ||
- pipeline_status.rc != 0 | ||
- stack_status.rc != 0 | ||
failed_when: false | ||
|
||
- name: Pipeline status command | ||
- name: Status command | ||
ansible.builtin.debug: | ||
msg: "{{ pipeline_status.cmd|join(' ') }}" | ||
when: pipeline_status is changed | ||
msg: "{{ stack_status.cmd|join(' ') }}" | ||
when: stack_status is changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.