diff --git a/README.adoc b/README.adoc index 5b1bc6c5..6657b44f 100644 --- a/README.adoc +++ b/README.adoc @@ -75,7 +75,7 @@ ansible-playbook stacks.yaml - Новый инструмент сборки бинарников. Сейчас только Apache Maven. - Новый инструмент управления образами. Сейчас только Docker Engine. - Новый инструмент раскатки стеков. Сейчас только Docker Compose. -- Новое целевое использование (purpose) решения (solution) или инструментария (toolchain). +- Новое целевое использование (purpose) решения (solution) или снаряжения (gear). - Новая обвязка построения дерева хешей. Сейчас связка Git и Ansible. === Непредсказуемая сложность diff --git a/bakers/ansible/codebase.yaml b/bakers/ansible/codebase.yaml index 49dca23e..26eea269 100644 --- a/bakers/ansible/codebase.yaml +++ b/bakers/ansible/codebase.yaml @@ -28,7 +28,6 @@ # list all top level playbooks cmd: >- ansible-lint - toolchain.yaml codebase.yaml stacks.yaml strip_empty_ends: false diff --git a/bakers/ansible/inventory/aliases.yaml b/bakers/ansible/inventory/aliases.yaml index 208a96b9..678100dc 100644 --- a/bakers/ansible/inventory/aliases.yaml +++ b/bakers/ansible/inventory/aliases.yaml @@ -7,7 +7,7 @@ codebase: stack: hosts: solution: - toolchain: + gear: all: hosts: db: diff --git a/bakers/ansible/inventory/group_vars/all/stacks.yaml b/bakers/ansible/inventory/group_vars/all/stacks.yaml index 36a7d5e4..6e52263e 100644 --- a/bakers/ansible/inventory/group_vars/all/stacks.yaml +++ b/bakers/ansible/inventory/group_vars/all/stacks.yaml @@ -1,6 +1,6 @@ --- -toolchain: - image: stack/toolchain +gear: + image: stack/gear solution: name: "{{ project.name }}" diff --git a/bakers/ansible/stacks.yaml b/bakers/ansible/stacks.yaml index d33d9106..f2c31e15 100644 --- a/bakers/ansible/stacks.yaml +++ b/bakers/ansible/stacks.yaml @@ -11,11 +11,11 @@ tags: [always] - name: Capturing - hosts: toolchain + hosts: gear run_once: true tasks: - ansible.builtin.import_tasks: # noqa: name[missing] - file: tasks/toolchain/status.yaml + file: tasks/gear/status.yaml tags: [always] - name: Testing @@ -29,13 +29,13 @@ tags: [build] when: >- hostvars.solution.stack_status is changed or - hostvars.toolchain.stack_status is changed + hostvars.gear.stack_status is changed - ansible.builtin.import_tasks: # noqa: name[missing] file: tasks/solution/test.yaml tags: [test] when: >- hostvars.solution.stack_status is changed or - hostvars.toolchain.stack_status is changed + hostvars.gear.stack_status is changed - name: Packaging hosts: solution @@ -47,10 +47,10 @@ when: stack_status is changed - name: Packaging - hosts: toolchain + hosts: gear run_once: true tasks: - ansible.builtin.import_tasks: # noqa: name[missing] - file: tasks/toolchain/package.yaml + file: tasks/gear/package.yaml tags: [package] when: stack_status is changed diff --git a/bakers/ansible/tasks/toolchain/build.yaml b/bakers/ansible/tasks/gear/build.yaml similarity index 69% rename from bakers/ansible/tasks/toolchain/build.yaml rename to bakers/ansible/tasks/gear/build.yaml index e9909793..23885c3b 100644 --- a/bakers/ansible/tasks/toolchain/build.yaml +++ b/bakers/ansible/tasks/gear/build.yaml @@ -2,10 +2,10 @@ - ansible.builtin.import_role: # noqa: name[missing] name: image vars: - image_tag: "{{ toolchain_tag }}" - image_name: "{{ image_repo }}/{{ toolchain.image }}" + image_tag: "{{ gear_tag }}" + image_name: "{{ image_repo }}/{{ gear.image }}" image_home: "{{ project.dir }}/stack/gear/{{ devenv }}" - image_key: "{{ toolchain.image }}:{{ devenv }}" + image_key: "{{ gear.image }}:{{ devenv }}" image_push: false image_args: DOCKER_VERSION: "{{ lookup('ansible.builtin.pipe', 'docker version --format {% raw %}{{.Client.Version}}{% endraw %}') }}" # noqa: yaml[line-length] diff --git a/bakers/ansible/tasks/toolchain/package.yaml b/bakers/ansible/tasks/gear/package.yaml similarity index 56% rename from bakers/ansible/tasks/toolchain/package.yaml rename to bakers/ansible/tasks/gear/package.yaml index f068419d..3281a026 100644 --- a/bakers/ansible/tasks/toolchain/package.yaml +++ b/bakers/ansible/tasks/gear/package.yaml @@ -2,8 +2,8 @@ - ansible.builtin.import_role: # noqa: name[missing] name: image vars: - image_tag: "{{ toolchain_tag }}" - image_name: "{{ image_repo }}/{{ toolchain.image }}" + image_tag: "{{ gear_tag }}" + image_name: "{{ image_repo }}/{{ gear.image }}" image_home: "{{ project.dir }}/stack/gear/{{ devenv }}" - image_key: "{{ toolchain.image }}:{{ devenv }}" + image_key: "{{ gear.image }}:{{ devenv }}" image_push: "{{ image_storage != 'local' }}" diff --git a/bakers/ansible/tasks/toolchain/status.yaml b/bakers/ansible/tasks/gear/status.yaml similarity index 89% rename from bakers/ansible/tasks/toolchain/status.yaml rename to bakers/ansible/tasks/gear/status.yaml index 6e290063..a186cd14 100644 --- a/bakers/ansible/tasks/toolchain/status.yaml +++ b/bakers/ansible/tasks/gear/status.yaml @@ -12,11 +12,11 @@ - name: Declare tag ansible.builtin.set_fact: - toolchain_tag: "{{ devenv }}-{{ stack_cid.stdout[:7] }}" + gear_tag: "{{ devenv }}-{{ stack_cid.stdout[:7] }}" - name: Capture status ansible.builtin.command: - cmd: docker {{ docker_entity }} inspect {{ image_repo }}/{{ toolchain.image }}:{{ toolchain_tag }} + cmd: docker {{ docker_entity }} inspect {{ image_repo }}/{{ gear.image }}:{{ gear_tag }} register: stack_status changed_when: - stack_status.rc != 0 diff --git a/bakers/ansible/toolchain.yaml b/bakers/ansible/toolchain.yaml deleted file mode 100644 index debc4b5f..00000000 --- a/bakers/ansible/toolchain.yaml +++ /dev/null @@ -1,38 +0,0 @@ ---- -- name: Toolchain - hosts: toolchain - run_once: true - vars: - docker: "{{ dev[devenv].docker|default(dev.anyone.docker) }}" - tasks: - - name: Capture docker version - ansible.builtin.command: - cmd: docker version --format {{'{{.Server.Version}}'}} - register: docker_version - changed_when: false - - name: Check docker version - ansible.builtin.assert: - quiet: true - that: - - docker_version.stdout is version(docker.min, '>=', version_type='semver') - - docker_version.stdout is version(docker.max, '<', version_type='semver') - msg: "{{ docker.min }} <= docker < {{ docker.max }}" - -- name: Capturing - hosts: toolchain - run_once: true - tasks: - - ansible.builtin.import_tasks: # noqa: name[missing] - file: tasks/toolchain/status.yaml - tags: [always] - -- name: Building - hosts: toolchain - run_once: true - vars: - stack_dir: "{{ project.dir }}/stack/gear" - tasks: - - ansible.builtin.import_tasks: # noqa: name[missing] - file: tasks/toolchain/build.yaml - tags: [build] - when: stack_status is changed diff --git a/docs/toolchain.adoc b/docs/toolchain.adoc index 262b7696..fb7b42e4 100644 --- a/docs/toolchain.adoc +++ b/docs/toolchain.adoc @@ -1,4 +1,4 @@ -= Инструментарий (Toolchain) += Снаряжение (Gear) Система, реализуемая для разработчиков.