Sha256: 8508300cd0f5f566cdb5a35a237a97e8a621b6f267e749918ae2f54227411b12

Contents?: true

Size: 1.44 KB

Versions: 162

Compression:

Stored size: 1.44 KB

Contents

#!/usr/bin/env bash

# Build tools on Mac OS X host and in all vms

set -e

MAKE_TASK='all -j'

filters=()
for arg in "$@"; do
  if [[ "$arg" =~ ^([A-Z_]+)=(.*)$ ]]; then
    eval "$(printf %q=%q "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}")"
  else
    filters+=($arg)
  fi
done
filters=$(IFS='|'; echo "${filters[*]}")

passes-filter() {
  [[ '' = "$filters" ]] || [[ "$1" =~ $filters ]]
}

header() {
  printf '\033[1;7m######## %s ########\033[0m\n' "$1"
}

if [[ `uname -s` != 'Darwin' ]]; then
  echo 'expected to run on Mac OS X'
  exit 1
fi

for arch in i386 x86_64; do
  passes-filter "darwin-$arch" || continue
  header "darwin-$arch"

  make $MAKE_TASK ARCH=$arch
done

for vm in $(perl -pe "s/.*?'(.+?-.+?)'\s+=>\s+'.+?\/.+?'.*|.*/\$1/" Vagrantfile); do
  passes-filter "$vm" || continue
  header "$vm"

  [[ -n "$NO_UP" ]] || vagrant up $vm

  # create ssh config
  ssh_config=.vagrant/ssh_config.$vm
  vagrant ssh-config $vm > $ssh_config

  # rsync needed files to the box
  mkdir -p vendor/$vm
  rsync -e "ssh -F $ssh_config" -aR --del Makefile download vendor/$vm $vm:/vagrant

  # sync time and run make
  ssh -F $ssh_config $vm "
    set -e

    sudo ntpdate pool.ntp.org

    cd /vagrant
    if make -v 2>&1 | grep -q GNU\ Make; then
      make $MAKE_TASK
    else
      gmake $MAKE_TASK
    fi
  "

  # rsync files in vendor from the box
  rsync -e "ssh -F $ssh_config" -aR --del $vm:/vagrant/./vendor/$vm .

  [[ -n "$NO_HALT" ]] || vagrant halt $vm
done

Version data entries

162 entries across 162 versions & 1 rubygems

Version Path
image_optim_pack-0.5.0.20170830-x86-openbsd script/run
image_optim_pack-0.5.0.20170830-x86_64-linux script/run
image_optim_pack-0.5.0.20170830-x86-linux script/run
image_optim_pack-0.5.0.20170830-x86-freebsd script/run
image_optim_pack-0.5.0.20170830-amd64-freebsd script/run
image_optim_pack-0.5.0.20170830-x86_64-darwin script/run
image_optim_pack-0.5.0.20170830-x86-darwin script/run
image_optim_pack-0.5.0.20170830 script/run
image_optim_pack-0.5.0.20170815-x86_64-openbsd script/run
image_optim_pack-0.5.0.20170815-x86-openbsd script/run
image_optim_pack-0.5.0.20170815-x86_64-linux script/run
image_optim_pack-0.5.0.20170815-x86-linux script/run
image_optim_pack-0.5.0.20170815-x86-freebsd script/run
image_optim_pack-0.5.0.20170815-amd64-freebsd script/run
image_optim_pack-0.5.0.20170815-x86_64-darwin script/run
image_optim_pack-0.5.0.20170815-x86-darwin script/run
image_optim_pack-0.5.0.20170815 script/run
image_optim_pack-0.5.0.20170803-x86_64-openbsd script/run
image_optim_pack-0.5.0.20170803-x86-openbsd script/run
image_optim_pack-0.5.0.20170803-x86_64-linux script/run