Skip to content

Commit

Permalink
Rename plural to singular (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavetok authored Feb 17, 2024
1 parent cee7e2a commit 76ffcbe
Show file tree
Hide file tree
Showing 211 changed files with 157 additions and 158 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup-maven/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
cache: 'maven'
cache-dependency-path: |
pom.xml
libs/pom.xml
tools/pom.xml
lib/pom.xml
tool/pom.xml
- shell: bash
run: cat ~/.m2/settings.xml
13 changes: 6 additions & 7 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "maven"
directory: "/"
open-pull-requests-limit: 10
Expand All @@ -17,8 +13,12 @@ updates:
junit-platform:
patterns:
- "org.junit*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "docker"
directory: "/dbs/postgres"
directory: "/db/postgres"
schedule:
interval: "weekly"
- package-ecosystem: "docker"
Expand All @@ -34,10 +34,9 @@ updates:
schedule:
interval: "weekly"
ignore:
- dependency-name: "ansible-core"
- dependency-name: "*"
update-types:
- version-update:semver-major
- version-update:semver-minor
- package-ecosystem: "pip"
directory: "/stack/gear/godel"
schedule:
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/beyond-doubt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
docker run --rm
--volume $(pwd):$(pwd)
--volume ~/.m2:/root/.m2
--workdir $(pwd)/bakers/ansible
--workdir $(pwd)/baker/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook sources.yaml
-e devenv=${{ matrix.env.dev }}
Expand All @@ -55,7 +55,7 @@ jobs:
--volume ~/.docker/config.json:/root/.docker/config.json:ro
--env GITHUB_ACTOR=${{ github.actor }}
--env GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
--workdir $(pwd)/bakers/ansible
--workdir $(pwd)/baker/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook images.yaml -v
-e devenv=${{ matrix.env.dev }}
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
run: >-
docker run --rm
--volume $(pwd):$(pwd)
--workdir $(pwd)/bakers/ansible
--workdir $(pwd)/baker/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook stacks.yaml -t build
-e image_repo=${{ env.IMAGE_REPO }}
Expand All @@ -116,8 +116,8 @@ jobs:
-e opsenv=${{ matrix.env.ops }}
- uses: actions/[email protected]
with:
name: solution-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: stack/solution/target/image-context
name: product-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: stack/product/target/image-context
if-no-files-found: ignore

stack-testing:
Expand Down Expand Up @@ -149,8 +149,8 @@ jobs:
- uses: actions/[email protected]
continue-on-error: true # it's ok because stack building can be skipped
with:
name: solution-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: stack/solution/target/image-context
name: product-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: stack/product/target/image-context
- name: Run setup-maven
uses: ./.github/actions/setup-maven
- name: Run ansible-playbook stacks.yaml -t test
Expand All @@ -159,7 +159,7 @@ jobs:
--volume $(pwd):$(pwd)
--volume ~/.m2:/root/.m2
--volume /var/run/docker.sock:/var/run/docker.sock
--workdir $(pwd)/bakers/ansible
--workdir $(pwd)/baker/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook stacks.yaml -t test
-e image_repo=${{ env.IMAGE_REPO }}
Expand All @@ -172,7 +172,7 @@ jobs:
if: ${{ !cancelled() }}
with:
name: e2e-test-report-${{ matrix.shard }}-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: tests/e2e/target/surefire-reports/*.xml
path: test/e2e/target/surefire-reports/*.xml
if-no-files-found: ignore

stack-publishing:
Expand Down Expand Up @@ -205,15 +205,15 @@ jobs:
- uses: actions/[email protected]
continue-on-error: true # it's ok because stack building can be skipped
with:
name: solution-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: stack/solution/target/image-context
name: product-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: stack/product/target/image-context
- name: Run ansible-playbook stacks.yaml -t package
run: >-
docker run --rm
--volume $(pwd):$(pwd)
--volume /var/run/docker.sock:/var/run/docker.sock
--volume ~/.docker/config.json:/root/.docker/config.json:ro
--workdir $(pwd)/bakers/ansible
--workdir $(pwd)/baker/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook stacks.yaml -t package -v
-e image_repo=${{ env.IMAGE_REPO }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/convincing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
docker run --rm
--volume $(pwd):$(pwd)
--volume ~/.m2:/root/.m2
--workdir $(pwd)/bakers/ansible
--workdir $(pwd)/baker/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook sources.yaml
-e devenv=${{ matrix.env.dev }}
Expand All @@ -51,7 +51,7 @@ jobs:
--volume ~/.docker/config.json:/root/.docker/config.json:ro
--env GITHUB_ACTOR=${{ github.actor }}
--env GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
--workdir $(pwd)/bakers/ansible
--workdir $(pwd)/baker/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook images.yaml -v
-e devenv=${{ matrix.env.dev }}
Expand All @@ -77,7 +77,7 @@ jobs:
if: ${{ !cancelled() }}
with:
name: test-coverage-report
path: tools/target/coverage
path: tool/target/coverage
if-no-files-found: ignore

everything-is-fine:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sanity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
docker run --rm
--volume $(pwd):$(pwd)
--volume ~/.m2:/root/.m2
--workdir $(pwd)/bakers/ansible
--workdir $(pwd)/baker/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook sources.yaml
-e devenv=${{ matrix.env.dev }}
Expand All @@ -47,7 +47,7 @@ jobs:
docker run --rm
--volume $(pwd):$(pwd)
--volume ~/.m2:/root/.m2
--workdir $(pwd)/bakers/ansible
--workdir $(pwd)/baker/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook binaries.yaml
-e devenv=${{ matrix.env.dev }}
Expand Down
8 changes: 4 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@
== Как нанести пользу

. Заводим тикет и описываем идею доработки (можно воспользоваться готовыми из <<идеи,списка>>).
. Настраиваем одно из link:envs/dev[поддерживаемых] окружений разработки и фиксируем его в `bakers/ansible/group_vars/all.yaml`.
. Настраиваем одну из link:stack/gear[поддерживаемых] сред разработки и фиксируем её в `baker/ansible/group_vars/all.yaml`.
+
[source,yaml]
----
# for example
devenv: church
devenv: turing
----
. Выполняем доработку на <<ветки,отдельной>> ветке.
. Добиваемся успешного прохождения проверок на локальной машине.
+
[source,bash]
----
cd bakers/ansible
cd baker/ansible
ansible-playbook sources.yaml
ansible-playbook stacks.yaml
----
Expand Down Expand Up @@ -75,7 +75,7 @@ ansible-playbook stacks.yaml
- Новый инструмент сборки бинарников. Сейчас только Apache Maven.
- Новый инструмент управления образами. Сейчас только Docker Engine.
- Новый инструмент раскатки стеков. Сейчас только Docker Compose.
- Новое целевое использование (purpose) решения (solution) или снаряжения (gear).
- Новое целевое использование (purpose) продукта (product) или снаряжения (gear).
- Новая обвязка построения дерева хешей. Сейчас связка Git и Ansible.

=== Непредсказуемая сложность
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions apps/pom.xml → app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<version>latest</version>
</parent>

<artifactId>apps</artifactId>
<artifactId>app</artifactId>
<version>${revision}</version>
<packaging>pom</packaging>

Expand All @@ -23,7 +23,7 @@
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>libs</artifactId>
<artifactId>lib</artifactId>
<version>${revision}</version>
<scope>import</scope>
<type>pom</type>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion apps/sepuling-java/pom.xml → app/sepuling-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<parent>
<groupId>smecalculus.bezmen</groupId>
<artifactId>apps</artifactId>
<artifactId>app</artifactId>
<version>${revision}</version>
</parent>

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<parent>
<groupId>smecalculus.bezmen</groupId>
<artifactId>apps</artifactId>
<artifactId>app</artifactId>
<version>${revision}</version>
</parent>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions bakers/ansible/binaries.yaml → baker/ansible/binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
ansible.builtin.command:
cmd: git hash-object --stdin
stdin: |
{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=libs') }}
{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=apps/' ~ app) }}
{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=lib') }}
{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=app/' ~ app) }}
register: image_cid
changed_when: false
loop: "{{ solution.apps.values()|flatten|map(attribute='binary') }}"
loop: "{{ product.apps.values()|flatten|map(attribute='binary') }}"
loop_control:
loop_var: app
tags: [always]
Expand All @@ -33,7 +33,7 @@
changed_when:
- image_status.rc != 0
failed_when: false
loop: "{{ solution.apps.values()|flatten }}"
loop: "{{ product.apps.values()|flatten }}"
loop_control:
loop_var: app
label: "{{ app.binary }}"
Expand Down
16 changes: 8 additions & 8 deletions bakers/ansible/images.yaml → baker/ansible/images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
ansible.builtin.command:
cmd: >-
docker {{ docker_entity }} inspect
{{ image_ns }}/{{ solution.databases[storage].image }}:{{ solution.databases[storage].cid }}
{{ image_ns }}/{{ product.databases[storage].image }}:{{ product.databases[storage].cid }}
register: image_status
changed_when: image_status.rc != 0
failed_when: false
loop: "{{ solution.schemas.keys() }}"
loop: "{{ product.schemas.keys() }}"
loop_control:
loop_var: storage
- name: Status commands
Expand All @@ -27,10 +27,10 @@
ansible.builtin.include_role:
name: image
vars:
image_tag: "{{ solution.databases[storage].cid }}"
image_name: "{{ image_ns }}/{{ solution.databases[storage].image }}"
image_home: "{{ project.dir }}/dbs/{{ storage }}"
image_key: "{{ solution.databases[storage].image }}"
image_tag: "{{ product.databases[storage].cid }}"
image_name: "{{ image_ns }}/{{ product.databases[storage].image }}"
image_home: "{{ project.dir }}/db/{{ storage }}"
image_key: "{{ product.databases[storage].image }}"
image_push: "{{ image_repo != 'local' }}"
loop: "{{ image_status.results|select('changed')|map(attribute='storage') }}"
loop_control:
Expand All @@ -46,7 +46,7 @@
mvn
--no-snapshot-updates
--batch-mode
--projects tools
--projects tool
clean
antrun:run@coverage
chdir: "{{ project.dir }}"
Expand All @@ -59,7 +59,7 @@
vars:
image_tag: "{{ image_tags[app.binary] }}"
image_name: "{{ image_ns }}/{{ app.image }}"
image_home: "{{ project.dir }}/apps/{{ app.binary }}"
image_home: "{{ project.dir }}/app/{{ app.binary }}"
image_context: target/image-context
image_key: "{{ app.image }}"
image_push: "{{ image_repo != 'local' }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ sources:
github:
stack:
hosts:
solution:
gear:
product:
all:
hosts:
db:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
gear:
image: stack/gear

solution:
product:
name: "{{ project.name }}"
image: stack/solution
image: stack/product
config:
file_name: "application.{{ config_exts[ops[opsenv].config.mapping_mode] }}"
mapping_mode: "{{ ops[opsenv].config.mapping_mode }}"
Expand All @@ -20,7 +20,7 @@ solution:
databases:
postgres:
name: "{{ project.name }}"
cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=dbs/postgres')[:7] }}"
cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=db/postgres')[:7] }}"
image: database/postgres
schemas:
postgres:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
purpose: toy
usage:
usages:
toy:
storage: postgres
apps:
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 76ffcbe

Please sign in to comment.