|
| 1 | +# -*- mode: ruby -*- |
| 2 | +# vi: set ft=ruby : |
| 3 | + |
| 4 | +# All Vagrant configuration is done below. The "2" in Vagrant.configure |
| 5 | +# configures the configuration version (we support older styles for |
| 6 | +# backwards compatibility). Please don't change it unless you know what |
| 7 | +# you're doing. |
| 8 | +Vagrant.configure("2") do |config| |
| 9 | + # The most common configuration options are documented and commented below. |
| 10 | + # For a complete reference, please see the online documentation at |
| 11 | + # https://docs.vagrantup.com. |
| 12 | + |
| 13 | + # Every Vagrant development environment requires a box. You can search for |
| 14 | + # boxes at https://vagrantcloud.com/search. |
| 15 | + config.vm.guest = :hardenedbsd |
| 16 | + config.vm.box = "generic/hardenedbsd13" |
| 17 | + config.vm.box_version = "4.3.12" |
| 18 | + config.vm.provider "virtualbox" do |v| |
| 19 | + v.name = "ci_hardenedbsd" |
| 20 | + end |
| 21 | + config.ssh.shell = "sh" |
| 22 | + |
| 23 | + # Disable automatic box update checking. If you disable this, then |
| 24 | + # boxes will only be checked for updates when the user runs |
| 25 | + # `vagrant box outdated`. This is not recommended. |
| 26 | + # config.vm.box_check_update = false |
| 27 | + |
| 28 | + # Create a forwarded port mapping which allows access to a specific port |
| 29 | + # within the machine from a port on the host machine. In the example below, |
| 30 | + # accessing "localhost:8080" will access port 80 on the guest machine. |
| 31 | + # NOTE: This will enable public access to the opened port |
| 32 | + # config.vm.network "forwarded_port", guest: 80, host: 8080 |
| 33 | + |
| 34 | + # Create a forwarded port mapping which allows access to a specific port |
| 35 | + # within the machine from a port on the host machine and only allow access |
| 36 | + # via 127.0.0.1 to disable public access |
| 37 | + # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" |
| 38 | + |
| 39 | + # Create a private network, which allows host-only access to the machine |
| 40 | + # using a specific IP. |
| 41 | + # config.vm.network "private_network", ip: "192.168.33.10" |
| 42 | + |
| 43 | + # Create a public network, which generally matched to bridged network. |
| 44 | + # Bridged networks make the machine appear as another physical device on |
| 45 | + # your network. |
| 46 | + # config.vm.network "public_network" |
| 47 | + |
| 48 | + # Share an additional folder to the guest VM. The first argument is |
| 49 | + # the path on the host to the actual folder. The second argument is |
| 50 | + # the path on the guest to mount the folder. And the optional third |
| 51 | + # argument is a set of non-required options. |
| 52 | + # config.vm.synced_folder "../data", "/vagrant_data" |
| 53 | + |
| 54 | + # Disable the default share of the current code directory. Doing this |
| 55 | + # provides improved isolation between the vagrant box and your host |
| 56 | + # by making sure your Vagrantfile isn't accessible to the vagrant box. |
| 57 | + # If you use this you may want to enable additional shared subfolders as |
| 58 | + # shown above. |
| 59 | + # config.vm.synced_folder ".", "/vagrant", disabled: true |
| 60 | + |
| 61 | + # Provider-specific configuration so you can fine-tune various |
| 62 | + # backing providers for Vagrant. These expose provider-specific options. |
| 63 | + # Example for VirtualBox: |
| 64 | + # |
| 65 | + # config.vm.provider "virtualbox" do |vb| |
| 66 | + # # Display the VirtualBox GUI when booting the machine |
| 67 | + # vb.gui = true |
| 68 | + # |
| 69 | + # # Customize the amount of memory on the VM: |
| 70 | + # vb.memory = "1024" |
| 71 | + # end |
| 72 | + # |
| 73 | + # View the documentation for the provider you are using for more |
| 74 | + # information on available options. |
| 75 | + |
| 76 | + # Enable provisioning with a shell script. Additional provisioners such as |
| 77 | + # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the |
| 78 | + # documentation for more information about their specific syntax and use. |
| 79 | + # note: clang installed by default |
| 80 | + config.vm.provision "env", type: "shell", inline:<<-SHELL |
| 81 | + set -x |
| 82 | + pkg update -f |
| 83 | + pkg install -y git cmake |
| 84 | + SHELL |
| 85 | + |
| 86 | + config.vm.provision "file", source: "../../../CMakeLists.txt", destination: "$HOME/project/" |
| 87 | + config.vm.provision "file", source: "../../../cmake", destination: "$HOME/project/" |
| 88 | + config.vm.provision "file", source: "../../../Foo", destination: "$HOME/project/" |
| 89 | + config.vm.provision "file", source: "../../../Bar", destination: "$HOME/project/" |
| 90 | + config.vm.provision "file", source: "../../../FooBar", destination: "$HOME/project/" |
| 91 | + config.vm.provision "file", source: "../../../FooBarApp", destination: "$HOME/project/" |
| 92 | + config.vm.provision "file", source: "../../../examples", destination: "$HOME/project/" |
| 93 | + |
| 94 | + config.vm.provision "devel", type: "shell", inline:<<-SHELL |
| 95 | + set -x |
| 96 | + cd project |
| 97 | + ls |
| 98 | + SHELL |
| 99 | + |
| 100 | + config.vm.provision "configure", type: "shell", inline:<<-SHELL |
| 101 | + set -x |
| 102 | + cd project |
| 103 | + cmake -S. -Bbuild |
| 104 | + SHELL |
| 105 | + |
| 106 | + config.vm.provision "build", type: "shell", inline:<<-SHELL |
| 107 | + set -x |
| 108 | + cd project |
| 109 | + cmake --build build -v |
| 110 | + SHELL |
| 111 | + |
| 112 | + config.vm.provision "test", type: "shell", inline:<<-SHELL |
| 113 | + set -x |
| 114 | + cd project |
| 115 | + cmake --build build --target test -v |
| 116 | + SHELL |
| 117 | +end |
0 commit comments