Skip to content

Commit

Permalink
Check toolchain versions
Browse files Browse the repository at this point in the history
  • Loading branch information
pavetok committed Oct 8, 2023
1 parent 0775b26 commit 8e7aeb8
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 2 deletions.
1 change: 1 addition & 0 deletions .dx/codebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
# list all top level playbooks
cmd: >
ansible-lint
toolchain.yaml
codebase.yml
stacks.yml
strip_empty_ends: false
Expand Down
8 changes: 8 additions & 0 deletions .dx/envs/dev/church/vars.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
maven_version:
min: 3.8.0
max: 3.10.0

docker_version:
min: 24.0.0
max: 25.0.0
8 changes: 8 additions & 0 deletions .dx/envs/dev/turing/vars.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
maven_version:
min: 3.8.0
max: 3.10.0

docker_version:
min: 24.0.0
max: 25.0.0
34 changes: 34 additions & 0 deletions .dx/toolchain.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
- name: Toolchain
hosts: toolchain
tasks:
- name: Capture dev env
ansible.builtin.include_vars:
file: envs/dev/{{ devenv }}/vars.yaml
name: dev

- name: Capture maven version
ansible.builtin.command:
cmd: mvn --version --quiet
register: maven_version
changed_when: false
- name: Check maven version
ansible.builtin.assert:
quiet: true
that:
- maven_version.stdout is version(dev.maven_version.min, '>=', version_type='semver')
- maven_version.stdout is version(dev.maven_version.max, '<', version_type='semver')
msg: "{{ dev.maven_version.min }} <= maven < {{ dev.maven_version.max }}"

- 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(dev.docker_version.min, '>=', version_type='semver')
- docker_version.stdout is version(dev.docker_version.max, '<', version_type='semver')
msg: "{{ dev.docker_version.min }} <= docker < {{ dev.docker_version.max }}"
7 changes: 5 additions & 2 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Prepare tools
description: Tools preparation action for specific environment
description: Tools preparation for specific environment
inputs:
name:
description: Environment name
description: Env name
required: true
default: turing
tools:
Expand Down Expand Up @@ -33,6 +33,9 @@ runs:
distribution: 'temurin'
java-version: ${{ steps.dotenv.outputs.java_version }}
cache: 'maven'
- shell: bash
run: ansible-playbook toolchain.yml
working-directory: .dx
- uses: docker/[email protected]
if: ${{ contains(inputs.tools, 'docker') }}
with:
Expand Down

0 comments on commit 8e7aeb8

Please sign in to comment.