Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLOC 3596] Added retries to brew in Jenkins #2294

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |
Expand All @@ -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 |
Expand Down Expand Up @@ -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,
Expand Down