Skip to content

Instantly share code, notes, and snippets.

@ubnt-intrepid
Last active March 21, 2017 10:46
Show Gist options
  • Select an option

  • Save ubnt-intrepid/010396728d2b5af711fc34b4acb9ad38 to your computer and use it in GitHub Desktop.

Select an option

Save ubnt-intrepid/010396728d2b5af711fc34b4acb9ad38 to your computer and use it in GitHub Desktop.

Instruction

  • Put files into:

    • Vagrantfile => ./Vagrantfile
    • exclude => ./git/info/exclude
  • Run provisioner:

    $ vagrant up
#!/bin/bash
if [ $# -lt 1 ]; then
echo "$0 <build> <command> [<args>...]"
echo ""
echo "example:"
echo " $0 clang ./install.sh"
exit 1
fi
BASE_DIR=$(cd $(dirname $0); pwd)
docker run \
--net=host \
-v $BASE_DIR:/var/work \
-v $BASE_DIR/../wandbox:/opt/wandbox \
-w /var/work/$1 \
"melpon/wandbox:$1" "$2" "${@:3}"
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
Vagrantfile
.vagrant/
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "boxcutter/ubuntu1604"
config.vm.box_check_update = false
if Vagrant.has_plugin?("vagrant-vbguest") then
config.vbguest.auto_update = false
end
config.vm.provider :virtualbox do |vb|
vb.memory = 4096
vb.cpus = 2
end
config.vm.synced_folder ".", "/vagrant",
type: "rsync",
rsync__args: ["-avtzL"],
rsync__exclude: [".git/"]
config.vm.provision :docker
config.vm.provision :shell, privileged:true, inline:<<-SHELL
set -e
set +x
which setenforce >/dev/null && setenforce 0 || true
# helper script
curl -L https://raw.githubusercontent.com/ubnt-intrepid/wandbox-vagrant/master/docker-exec.sh \
-o /vagrant/build/docker-exec.sh
chmod +x /vagrant/build/docker-exec.sh
# Build docker images
cd /vagrant/build
./docker-build.sh pony
./docker-build.sh pony-head
# Install
./docker-exec.sh cattleshed ./install.sh
./docker-exec.sh kennel ./install.sh
./docker-exec.sh pony-head ./install.sh
cat ./pony/VERSIONS | while read VERSION; do
./docker-exec.sh pony ./install.sh $VERSION
done
# Generate configuration
cd /vagrant/cattleshed-conf
mkdir -p /vagrant/wandbox/cattleshed-conf
./update.sh
# Run test
cd /vagrant/test
./run-test.sh 'pony-*'
echo "Done!"
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment