From 52e72617362b8c747c4e0ec77485324b3d6331e8 Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Tue, 7 Jul 2020 11:49:29 +0200 Subject: [PATCH] Retry better, including a fail... --- templates/molecule-action.yml.j2 | 4 ++-- templates/travis.yml.j2 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/molecule-action.yml.j2 b/templates/molecule-action.yml.j2 index ce9e3d8..4789d61 100644 --- a/templates/molecule-action.yml.j2 +++ b/templates/molecule-action.yml.j2 @@ -21,7 +21,7 @@ jobs: path: {% raw %}"${{ github.repository }}"{% endraw %} - name: molecule - uses: robertdebock/molecule-action@2.5.0 + uses: robertdebock/molecule-action@2.5.1 with: command: lint test: @@ -51,7 +51,7 @@ jobs: - name: parse apparmor for mysql run: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld - name: molecule - uses: robertdebock/molecule-action@2.5.0 + uses: robertdebock/molecule-action@2.5.1 with: image: {% raw %}${{ matrix.config.image }}{% endraw %} diff --git a/templates/travis.yml.j2 b/templates/travis.yml.j2 index c867118..98ac650 100644 --- a/templates/travis.yml.j2 +++ b/templates/travis.yml.j2 @@ -29,9 +29,9 @@ install: script: {% if tox_parallel is defined and tox_parallel %} - - n=0 ; until [ "$n" = 3 ] ; do tox --parallel all && break ; n=$((n+1)) ; done + - function retry { counter=0 ; until "$@" ; do exit=$? ; counter=$(($counter + 1)) ; if [ $counter -ge 3 ] ; then return $exit ; fi ; done ; return 0; } ; retry tox --parallel all {% else %} - - n=0 ; until [ "$n" = 3 ] ; do tox && break ; n=$((n+1)) ; done + - function retry { counter=0 ; until "$@" ; do exit=$? ; counter=$(($counter + 1)) ; if [ $counter -ge 3 ] ; then return $exit ; fi ; done ; return 0; } ; retry tox {% endif %} notifications: