Last active
June 3, 2016 19:54
-
-
Save stevekuznetsov/5f6973aa03280fe3908943f1de60c425 to your computer and use it in GitHub Desktop.
docker scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
tmp_root="/home/skuznets/vagrant-boxes" | |
rm -rf "${tmp_root}" | |
mkdir -p "${tmp_root}" | |
logfile="${tmp_root}/progress.log" | |
touch "${logfile}" | |
tmp_prefixes=( "skuznets-conformance-docker-upstream-" "skuznets-conformance-docker-old-" ) | |
vagrant_root="/home/skuznets/Documents/go/src/github.com/openshift/vagrant-openshift" | |
vagrant_branches=( "skuznets/docker-upstream" "skuznets/docker-old" ) | |
cd "${vagrant_root}" | |
for (( i = 0; i < 2; i++ )); do | |
prefix="${tmp_prefixes[$i]}" | |
branch="${vagrant_branches[$i]}" | |
{ | |
git checkout "${branch}" | |
echo "[INFO] [parent] Starting build of plugin: ${branch}..." | tee -a "${logfile}" | |
bundle | |
bundle install | |
bundle exec rake | |
vagrant plugin install pkg/vagrant-openshift-3.0.8.gem | |
} >"${tmp_root}/${prefix}bundler.log" 2>&1 | |
for (( j = 0; j < 1; j++ )); do | |
instance_name="${prefix}${j}" | |
tmp_dir="${tmp_root}/${instance_name}" | |
mkdir "${tmp_dir}" | |
cd "${tmp_dir}" | |
( | |
echo "[INFO] [${instance_name}] Starting..." | tee -a "${logfile}" | |
export GOPATH="${tmp_dir}" | |
vagrant origin-local-checkout | |
cd "${tmp_dir}/src/github.com/openshift/origin" | |
echo "[INFO] [${instance_name}] Building base AMI..." | tee -a "${logfile}" | |
vagrant origin-init --stage os --os rhel7 --instance-type m4.large "${instance_name}" | |
for (( k = 0; k < 3; k++ )); do | |
if vagrant up --provider aws ; then break ; fi | |
echo "'vagrant up' failed - retrying" | |
vagrant destroy -f | |
done | |
vagrant build-origin-base | |
vagrant clone-upstream-repos --clean | |
vagrant checkout-repos | |
vagrant build-origin-base-images | |
vagrant install-origin-assets-base | |
echo "[INFO] [${instance_name}] Building devenv AMI..." | tee -a "${logfile}" | |
vagrant build-origin --images | |
vagrant build-sti --binary-only | |
echo "[INFO] [${instance_name}] Running conformance tests..." | tee -a "${logfile}" | |
vagrant ssh -c "sudo mkdir /tmp || true" | |
vagrant ssh -c "sudo mount -t tmpfs -o size=2048m tmpfs /tmp" | |
vagrant ssh -c "go version" | |
vagrant ssh -c "sudo docker version" | |
vagrant test-origin --extended "conformance" \ | |
--artifacts \ | |
--skip-check \ | |
--skip-image-cleanup \ | |
--image-registry ci.dev.openshift.redhat.com:5000 | |
) >"${tmp_dir}/vagrant.log" 2>&1 & | |
if (( (j + 1) % 5 == 0 )); then | |
echo "[INFO] [parent] Waiting to start more threads..." | tee -a "${logfile}" | |
sleep 2m | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment