diff options
author | Daniil Baturin <daniil@vyos.io> | 2021-04-24 21:49:06 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-24 21:49:06 +0700 |
commit | 2ca0f5c34288bf7f7639a69b3f559f9c60b3879e (patch) | |
tree | 4cedb9d908fab49ceb6467ea3ec403a0068fd093 /build-tools/macos-build/Vagrantfile | |
parent | 2ea0ce02d9454cee14d1d5a96280615d88ba9b8c (diff) | |
parent | 5d838aa8a216e0c474294302a2f805df9655d813 (diff) | |
download | vyos-utils-misc-master.tar.gz vyos-utils-misc-master.zip |
T3485: Add macos support
Diffstat (limited to 'build-tools/macos-build/Vagrantfile')
-rw-r--r-- | build-tools/macos-build/Vagrantfile | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/build-tools/macos-build/Vagrantfile b/build-tools/macos-build/Vagrantfile new file mode 100644 index 0000000..f1b86a4 --- /dev/null +++ b/build-tools/macos-build/Vagrantfile @@ -0,0 +1,39 @@ +PROVISION = <<-SCRIPT +sudo apt-get update -y +sudo apt-get install apt-transport-https \ + ca-certificates \ + curl \ + gnupg2 \ + git \ + software-properties-common \ + rsync -y +curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - +sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" +sudo apt-get update -y +sudo apt-get install -y docker-ce +[ -d /home/vagrant/.ssh ] && echo '%{public_key}' >> /home/vagrant/.ssh/authorized_keys; true +[ -d /home/vagrant/.ssh ] && chmod 600 /home/vagrant/.ssh/authorized_keys; true +sudo usermod -aG docker vagrant +git clone -b #{ENV['BRANCH']} --single-branch https://github.com/vyos/vyos-build /opt/vyos-build +docker run --rm -t --privileged -v /opt/vyos-build:/vyos -w /vyos vyos/vyos-build:#{ENV['BRANCH']} \ + /bin/bash -c './configure #{ENV['CONFIGUREOPT']} && make #{ENV['MAKEOPT']}' +SCRIPT + +def define_vm(config, hostname, ip) + public_key_path = File.join(Dir.home, ".ssh", "id_rsa.pub") + public_key = IO.read(public_key_path) + + config.vm.define hostname do |vm| + vm.vm.box = "debian/#{ENV['OS']}" + vm.vm.hostname = hostname + vm.vm.network 'private_network', ip: ip + + vm.vm.provision :shell, inline: (PROVISION % { public_key: public_key }) + + end +end + +Vagrant.configure("2") do |config| + define_vm(config, "vyos", "10.1.1.254") + config.vm.synced_folder ".", "/vagrant", disabled: true +end |