summaryrefslogtreecommitdiffstats
path: root/storage/mroonga/packages/yum/Vagrantfile
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--storage/mroonga/packages/yum/Vagrantfile42
1 files changed, 42 insertions, 0 deletions
diff --git a/storage/mroonga/packages/yum/Vagrantfile b/storage/mroonga/packages/yum/Vagrantfile
new file mode 100644
index 00000000..af14bc9a
--- /dev/null
+++ b/storage/mroonga/packages/yum/Vagrantfile
@@ -0,0 +1,42 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
+VAGRANTFILE_API_VERSION = "2"
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+ vms = [
+ {
+ :id => "centos-6-i386",
+ :box => "bento/centos-6.9-i386",
+ },
+ {
+ :id => "centos-6-x86_64",
+ :box => "bento/centos-6.9",
+ },
+ {
+ :id => "centos-7-x86_64",
+ :box => "bento/centos-7.4",
+ },
+ ]
+
+ vms.each do |vm|
+ config.vm.define(vm[:id]) do |node|
+ node.vm.box = vm[:box]
+ node.vm.provision(:shell, :path => "build-rpm.sh")
+ node.vm.provider("virtualbox") do |virtual_box|
+ system_n_cpus = 1
+ if File.exist?("/proc/cpuinfo")
+ system_n_cpus = File.readlines("/proc/cpuinfo").grep(/^processor/).size
+ end
+ if system_n_cpus > 1
+ vm_n_cpus = system_n_cpus / 2
+ else
+ vm_n_cpus = 1
+ end
+ virtual_box.cpus = vm_n_cpus
+ virtual_box.memory = (ENV["VM_MEMORY"] || 1024).to_i
+ end
+ end
+ end
+end