diff options
| author | Aron Griffis <aron@arongriffis.com> | 2016-06-07 12:41:55 -0400 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2016-06-07 12:41:55 -0400 |
| commit | fd454e5b74bc0a87effd755986ce33bf05b4d27c (patch) | |
| tree | 85b87c39891403b12ac56dbd551ad8d4dc32dbb8 /Vagrantfile | |
| parent | 6b8b332f77e6e7413d2ebb9d47093bc93255958e (diff) | |
| download | qmk_firmware-fd454e5b74bc0a87effd755986ce33bf05b4d27c.tar.gz qmk_firmware-fd454e5b74bc0a87effd755986ce33bf05b4d27c.zip | |
Add support for vagrant-docker (#389)
* clean trailing ws in Vagrantfile and util/avr_setup.sh
* replace triple quotes with heredoc.
Ruby doesn't have triple quotes; that's a Python thing. This was just being
parsed as multiple strings concatenated.
* add docker support to Vagrantfile
* make wants to find dfu-programmer in vagrant guest
Diffstat (limited to 'Vagrantfile')
| -rw-r--r-- | Vagrantfile | 186 |
1 files changed, 98 insertions, 88 deletions
diff --git a/Vagrantfile b/Vagrantfile index c44eaf2d6..a6c3afd38 100644 --- a/Vagrantfile +++ b/Vagrantfile | |||
| @@ -1,88 +1,98 @@ | |||
| 1 | # -*- mode: ruby -*- | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : | 2 | # vi: set ft=ruby : |
| 3 | 3 | ||
| 4 | Vagrant.configure(2) do |config| | 4 | Vagrant.configure(2) do |config| |
| 5 | # You can only have one config.vm.box uncommented at a time | 5 | # You can only have one config.vm.box uncommented at a time |
| 6 | 6 | ||
| 7 | # Comment this and uncomment another if you don't want to use the minimal Arch box | 7 | # Comment this and uncomment another if you don't want to use the minimal Arch box |
| 8 | config.vm.box = "dragon788/arch-ala-elasticdog" | 8 | config.vm.box = "dragon788/arch-ala-elasticdog" |
| 9 | 9 | ||
| 10 | # VMware/Virtualbox 64 bit | 10 | # VMware/Virtualbox 64 bit |
| 11 | # config.vm.box = "phusion/ubuntu-14.04-amd64" | 11 | # config.vm.box = "phusion/ubuntu-14.04-amd64" |
| 12 | # | 12 | # |
| 13 | # VMware/Virtualbox 64 bit | 13 | # VMware/Virtualbox 64 bit |
| 14 | #config.vm.box = "puphpet/centos65-x64" | 14 | #config.vm.box = "puphpet/centos65-x64" |
| 15 | # | 15 | # |
| 16 | # The opensuse boxes don't have dfu-util in their default repositories | 16 | # The opensuse boxes don't have dfu-util in their default repositories |
| 17 | # | 17 | # |
| 18 | # The virtualbox version has tools issues | 18 | # The virtualbox version has tools issues |
| 19 | # VMware/Virtualbox 64 bit | 19 | # VMware/Virtualbox 64 bit |
| 20 | #config.vm.box = "bento/opensuse-13.2-x86_64" | 20 | #config.vm.box = "bento/opensuse-13.2-x86_64" |
| 21 | # | 21 | # |
| 22 | # Virtualbox only | 22 | # Virtualbox only |
| 23 | #config.vm.box = "bento/opensuse-13.2-i386" | 23 | #config.vm.box = "bento/opensuse-13.2-i386" |
| 24 | # config.vm.box = "" | 24 | # config.vm.box = "" |
| 25 | # config.vm.box = "" | 25 | # config.vm.box = "" |
| 26 | 26 | ||
| 27 | # This section allows you to customize the Virtualbox VM | 27 | # This section allows you to customize the Virtualbox VM |
| 28 | # settings, ie showing the GUI or upping the memory | 28 | # settings, ie showing the GUI or upping the memory |
| 29 | # or cores if desired | 29 | # or cores if desired |
| 30 | config.vm.provider "virtualbox" do |vb| | 30 | config.vm.provider "virtualbox" do |vb| |
| 31 | # Hide the VirtualBox GUI when booting the machine | 31 | # Hide the VirtualBox GUI when booting the machine |
| 32 | vb.gui = false | 32 | vb.gui = false |
| 33 | # Uncomment the below lines if you want to program | 33 | # Uncomment the below lines if you want to program |
| 34 | # your Teensy via the VM rather than your host OS | 34 | # your Teensy via the VM rather than your host OS |
| 35 | #vb.customize ['modifyvm', :id, '--usb', 'on'] | 35 | #vb.customize ['modifyvm', :id, '--usb', 'on'] |
| 36 | #vb.customize ['usbfilter', 'add', '0', | 36 | #vb.customize ['usbfilter', 'add', '0', |
| 37 | # '--target', :id, | 37 | # '--target', :id, |
| 38 | # '--name', 'teensy', | 38 | # '--name', 'teensy', |
| 39 | # '--vendorid', '0x16c0', | 39 | # '--vendorid', '0x16c0', |
| 40 | # '--productid','0x0478' | 40 | # '--productid','0x0478' |
| 41 | # ] | 41 | # ] |
| 42 | # Customize the amount of memory on the VM: | 42 | # Customize the amount of memory on the VM: |
| 43 | vb.memory = "512" | 43 | vb.memory = "512" |
| 44 | end | 44 | end |
| 45 | 45 | ||
| 46 | # This section allows you to customize the VMware VM | 46 | # This section allows you to customize the VMware VM |
| 47 | # settings, ie showing the GUI or upping the memory | 47 | # settings, ie showing the GUI or upping the memory |
| 48 | # or cores if desired | 48 | # or cores if desired |
| 49 | config.vm.provider "vmware_workstation" do |vmw| | 49 | config.vm.provider "vmware_workstation" do |vmw| |
| 50 | # Hide the VMware GUI when booting the machine | 50 | # Hide the VMware GUI when booting the machine |
| 51 | vmw.gui = false | 51 | vmw.gui = false |
| 52 | 52 | ||
| 53 | # Customize the amount of memory on the VM: | 53 | # Customize the amount of memory on the VM: |
| 54 | vmw.memory = "512" | 54 | vmw.memory = "512" |
| 55 | end | 55 | end |
| 56 | 56 | ||
| 57 | config.vm.provider "vmware_fusion" do |vmf| | 57 | config.vm.provider "vmware_fusion" do |vmf| |
| 58 | # Hide the vmfare GUI when booting the machine | 58 | # Hide the vmfare GUI when booting the machine |
| 59 | vmf.gui = false | 59 | vmf.gui = false |
| 60 | 60 | ||
| 61 | # Customize the amount of memory on the VM: | 61 | # Customize the amount of memory on the VM: |
| 62 | vmf.memory = "512" | 62 | vmf.memory = "512" |
| 63 | end | 63 | end |
| 64 | 64 | ||
| 65 | # This script ensures the required packages for AVR programming are installed | 65 | # Docker provider pulls from hub.docker.com respecting docker.image if |
| 66 | # It also ensures the system always gets the latest updates when powered on | 66 | # config.vm.box is nil. Note that this bind-mounts from the current dir to |
| 67 | # If this causes issues you can run a 'vagrant destroy' and then | 67 | # /vagrant in the guest, so unless your UID is 1000 to match vagrant in the |
| 68 | # add a # before ,args: and run 'vagrant up' to get a working | 68 | # image, you'll need to: chmod -R a+rw . |
| 69 | # non-updated box and then attempt to troubleshoot or open a Github issue | 69 | config.vm.provider "docker" do |docker, override| |
| 70 | 70 | override.vm.box = nil | |
| 71 | config.vm.provision "shell", run: "always", path: "./util/avr_setup.sh", args: "-update" | 71 | docker.image = "jesselang/debian-vagrant:jessie" |
| 72 | 72 | docker.has_ssh = true | |
| 73 | config.vm.post_up_message = """ | 73 | end |
| 74 | Log into the VM using 'vagrant ssh' on OSX or from Git Bash (Win) | 74 | |
| 75 | or 'vagrant ssh-config' and Putty or Bitvise SSH or another SSH tool | 75 | # This script ensures the required packages for AVR programming are installed |
| 76 | 76 | # It also ensures the system always gets the latest updates when powered on | |
| 77 | Change directory (cd) to the keyboard you wish to program | 77 | # If this causes issues you can run a 'vagrant destroy' and then |
| 78 | (Optionally) modify your layout, | 78 | # add a # before ,args: and run 'vagrant up' to get a working |
| 79 | then run 'make clean' | 79 | # non-updated box and then attempt to troubleshoot or open a Github issue |
| 80 | and then 'make' to compile the .eep and .hex files. | 80 | |
| 81 | 81 | config.vm.provision "shell", run: "always", path: "./util/avr_setup.sh", args: "-update" | |
| 82 | Or you can copy and paste the example line below. | 82 | |
| 83 | 83 | config.vm.post_up_message = <<-EOT | |
| 84 | cd /vagrant; cd keyboard; cd ergodox_ez; make clean; make | 84 | Log into the VM using 'vagrant ssh' on OSX or from Git Bash (Win) |
| 85 | 85 | or 'vagrant ssh-config' and Putty or Bitvise SSH or another SSH tool | |
| 86 | 86 | ||
| 87 | """ | 87 | Change directory (cd) to the keyboard you wish to program |
| 88 | end | 88 | (Optionally) modify your layout, |
| 89 | then run 'make clean' | ||
| 90 | and then 'make' to compile the .eep and .hex files. | ||
| 91 | |||
| 92 | Or you can copy and paste the example line below. | ||
| 93 | |||
| 94 | cd /vagrant; cd keyboard; cd ergodox_ez; make clean; make | ||
| 95 | |||
| 96 | |||
| 97 | EOT | ||
| 98 | end | ||
