From a7866a9e5a7a73c817d43f9e7d1b0f1b48b56de3 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Sat, 5 Dec 2015 17:54:43 -0500 Subject: [PATCH] Revert "Revert "[FLOC 3596] Added retries to brew in Jenkins"" --- build.yaml | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/build.yaml b/build.yaml index b55660567d..4702883721 100644 --- a/build.yaml +++ b/build.yaml @@ -166,6 +166,21 @@ common_cli: fi } + # Retries a command if it fails, using the exponential backoff algorithm. + # It will retry forever, we rely on Jenkins to kill it if it takes too long + # Usage: retry 'command' + function retry { + let delay=2 + while true; do + if (\$1); then + break + fi + echo Command failed, waiting \$delay... + sleep \$delay + let delay=delay*2 + done + } + # TODO: do we need to clean up old files on ubuntu and centos or # does the pre-scm plugin does this correctly for us ? # https://clusterhq.atlassian.net/browse/FLOC-3139 @@ -447,9 +462,9 @@ common_cli: # make sure we're no longer in our virtualenv deactivate # install the new freshly baked package - brew update - brew tap ClusterHQ/tap - brew install \${RECIPE_FILE} + retry "brew update" + retry "brew tap ClusterHQ/tap" + retry "brew install \${RECIPE_FILE}" brew test \${RECIPE_FILE} build_repo_metadata: &build_repo_metadata | @@ -653,11 +668,11 @@ common_cli: softwareupdate -i "\${PROD}" -v # the basebox we use for OSX is missing quite a number of software pieces. - brew update - brew install rsync - brew install python - pip install virtualenv - brew install libffi + retry "brew update" + retry "brew install rsync" + retry "brew install python" + retry "pip install virtualenv" + retry "brew install libffi" export PKG_CONFIG_PATH=/usr/local/Cellar/libffi/3.0.13/lib/pkgconfig/; pip install bcrypt package_jenkins_osx_yosemite_box: &package_jenkins_osx_yosemite_box | @@ -676,6 +691,7 @@ common_cli: # gather the vanilla Vagrantfile from upstream and do a vagrant up rm -f Vagrantfile wget https://raw.githubusercontent.com/AndrewDryga/vagrant-box-osx/master/Vagrantfile + VAGRANT_LOG=debug vagrant up install_aws_cli: &install_aws_cli | @@ -1177,6 +1193,7 @@ job_type: *do_not_abort_on_errors, *start_vanilla_osx_yosemite_vagrant_box, *begin_build_sh_EOF, + *add_shell_functions, *install_pkgs_on_vanilla_osx_yosemite_box, *end_build_sh_EOF, *copy_files_to_osx_yosemite_box,