Loop over all versions until a stable version is found
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

Signed-off-by: Noah Knegt <git@noahknegt.com>
This commit is contained in:
2023-03-31 12:14:57 +02:00
parent 1385f93fb1
commit d538d7de7d

View File

@@ -18,11 +18,14 @@
name: jq name: jq
state: present state: present
- name: Fetch versions from github
shell: curl -s https://api.github.com/repos/docker/cli/tags
register: docker_versions
- name: Check if latest version is stable - name: Check if latest version is stable
shell: "curl -s https://api.github.com/repos/docker/cli/tags | jq -r '.[{{ item }}].name' | grep -E -o '[0-9]+\\.[0-9]+\\.[0-9]+\\-?'" shell: "{{ docker_versions }} | jq -r '.[{{ item }}].name' | grep -E -o '[0-9]+\\.[0-9]+\\.[0-9]+\\-?'"
register: docker_latest_version register: docker_latest_version
loop: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] until: docker_latest_version.stdout is not search('-')
until: docker_latest_version.stdout.find('-') == -1
- name: Compare versions - name: Compare versions
set_fact: set_fact: