veewee 0.3.0.alpha4 → 0.3.0.alpha5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/.rvmrc +3 -2
- data/Gemfile +1 -1
- data/License +1 -1
- data/README.md +30 -174
- data/Rakefile +4 -2
- data/doc/README-changes.txt +19 -0
- data/doc/TODO +60 -0
- data/doc/definition.md +58 -0
- data/doc/fusion.md +2 -0
- data/doc/install.md +16 -0
- data/doc/installation.md +24 -0
- data/doc/kvm.md +2 -0
- data/doc/providers.md +23 -0
- data/doc/requirements.md +1 -0
- data/doc/running.md +83 -0
- data/doc/template.md +102 -0
- data/doc/vagrant.md +119 -0
- data/doc/vbox.md +2 -0
- data/lib/net/vnc/vnc.rb +1 -1
- data/lib/python/parallels_sdk_check.py +19 -0
- data/lib/python/parallels_send_key.py +73 -0
- data/lib/veewee/command.rb +2 -1
- data/lib/veewee/command/kvm.rb +55 -15
- data/lib/veewee/command/parallels.rb +124 -0
- data/lib/veewee/command/vagrant.rb +2 -106
- data/lib/veewee/command/vagrant/basebox.rb +82 -0
- data/lib/veewee/command/vagrant/build.rb +64 -0
- data/lib/veewee/command/vagrant/define.rb +48 -0
- data/lib/veewee/command/vagrant/destroy.rb +47 -0
- data/lib/veewee/command/vagrant/export.rb +44 -0
- data/lib/veewee/command/vagrant/halt.rb +43 -0
- data/lib/veewee/command/vagrant/list.rb +38 -0
- data/lib/veewee/command/vagrant/ostypes.rb +38 -0
- data/lib/veewee/command/vagrant/ssh.rb +39 -0
- data/lib/veewee/command/vagrant/templates.rb +39 -0
- data/lib/veewee/command/vagrant/undefine.rb +41 -0
- data/lib/veewee/command/vagrant/up.rb +44 -0
- data/lib/veewee/command/virtualbox.rb +61 -14
- data/lib/veewee/command/vmfusion.rb +44 -21
- data/lib/veewee/config.rb +0 -27
- data/lib/veewee/config/ostypes.yml +179 -43
- data/lib/veewee/config/vmfusion-ostypes.txt +1 -0
- data/lib/veewee/definition.rb +91 -35
- data/lib/veewee/definitions.rb +156 -0
- data/lib/veewee/environment.rb +80 -244
- data/lib/veewee/error.rb +12 -0
- data/lib/veewee/provider/core/box.rb +52 -0
- data/lib/veewee/provider/core/box/build.rb +229 -0
- data/lib/veewee/provider/core/box/exec.rb +34 -0
- data/lib/veewee/provider/core/box/floppy.rb +31 -0
- data/lib/veewee/provider/core/box/halt.rb +24 -0
- data/lib/veewee/provider/core/box/issh.rb +15 -0
- data/lib/veewee/provider/core/box/poweroff.rb +12 -0
- data/lib/veewee/provider/core/box/scp.rb +29 -0
- data/lib/veewee/provider/core/box/ssh.rb +95 -0
- data/lib/veewee/provider/core/box/sudo.rb +21 -0
- data/lib/veewee/{builder → provider}/core/box/vnc.rb +4 -4
- data/lib/veewee/provider/core/helper/iso.rb +142 -0
- data/lib/veewee/provider/core/helper/scancode.rb +114 -0
- data/lib/veewee/provider/core/helper/shell.rb +55 -0
- data/lib/veewee/provider/core/helper/ssh.rb +162 -0
- data/lib/veewee/provider/core/helper/tcp.rb +96 -0
- data/lib/veewee/provider/core/helper/web.rb +67 -0
- data/lib/veewee/{builder/core/builder.rb → provider/core/provider.rb} +8 -25
- data/lib/veewee/{builder/core/builder → provider/core/provider}/transaction.rb +0 -0
- data/lib/veewee/{builder/core/builder → provider/core/provider}/tunnel.rb +2 -2
- data/lib/veewee/provider/kvm/box.rb +46 -0
- data/lib/veewee/provider/kvm/box/build.rb +11 -0
- data/lib/veewee/provider/kvm/box/create.rb +76 -0
- data/lib/veewee/provider/kvm/box/destroy.rb +33 -0
- data/lib/veewee/provider/kvm/box/halt.rb +19 -0
- data/lib/veewee/provider/kvm/box/helper/console_type.rb +20 -0
- data/lib/veewee/provider/kvm/box/helper/ip.rb +14 -0
- data/lib/veewee/provider/kvm/box/helper/ssh_options.rb +19 -0
- data/lib/veewee/provider/kvm/box/helper/status.rb +28 -0
- data/lib/veewee/provider/kvm/box/poweroff.rb +14 -0
- data/lib/veewee/provider/kvm/box/up.rb +14 -0
- data/lib/veewee/provider/kvm/box/validate_kvm.rb +47 -0
- data/lib/veewee/provider/kvm/provider.rb +70 -0
- data/lib/veewee/provider/parallels/box.rb +35 -0
- data/lib/veewee/provider/parallels/box/build.rb +13 -0
- data/lib/veewee/provider/parallels/box/create.rb +63 -0
- data/lib/veewee/provider/parallels/box/destroy.rb +24 -0
- data/lib/veewee/provider/parallels/box/halt.rb +14 -0
- data/lib/veewee/provider/parallels/box/helper/buildinfo.rb +45 -0
- data/lib/veewee/provider/parallels/box/helper/console_type.rb +198 -0
- data/lib/veewee/provider/parallels/box/helper/ip.rb +23 -0
- data/lib/veewee/provider/parallels/box/helper/ssh_options.rb +20 -0
- data/lib/veewee/provider/parallels/box/helper/status.rb +28 -0
- data/lib/veewee/provider/parallels/box/poweroff.rb +14 -0
- data/lib/veewee/provider/parallels/box/ssh.rb +12 -0
- data/lib/veewee/provider/parallels/box/up.rb +15 -0
- data/lib/veewee/provider/parallels/box/validate_parallels.rb +47 -0
- data/lib/veewee/provider/parallels/notes/parallels-sdk.txt +116 -0
- data/lib/veewee/provider/parallels/provider.rb +33 -0
- data/lib/veewee/provider/virtualbox/box.rb +46 -0
- data/lib/veewee/provider/virtualbox/box/build.rb +20 -0
- data/lib/veewee/provider/virtualbox/box/create.rb +58 -0
- data/lib/veewee/provider/virtualbox/box/destroy.rb +66 -0
- data/lib/veewee/provider/virtualbox/box/export_vagrant.rb +99 -0
- data/lib/veewee/provider/virtualbox/box/halt.rb +13 -0
- data/lib/veewee/provider/virtualbox/box/helper/buildinfo.rb +25 -0
- data/lib/veewee/provider/virtualbox/box/helper/console_type.rb +62 -0
- data/lib/veewee/provider/virtualbox/box/helper/create.rb +176 -0
- data/lib/veewee/provider/virtualbox/box/helper/forwarding.rb +38 -0
- data/lib/veewee/provider/virtualbox/box/helper/guest_additions.rb +17 -0
- data/lib/veewee/provider/virtualbox/box/helper/ip.rb +19 -0
- data/lib/veewee/provider/virtualbox/box/helper/natinterface.rb +17 -0
- data/lib/veewee/provider/virtualbox/box/helper/ssh_options.rb +28 -0
- data/lib/veewee/provider/virtualbox/box/helper/status.rb +27 -0
- data/lib/veewee/provider/virtualbox/box/helper/version.rb +18 -0
- data/lib/veewee/provider/virtualbox/box/poweroff.rb +19 -0
- data/lib/veewee/provider/virtualbox/box/ssh.rb +13 -0
- data/lib/veewee/provider/virtualbox/box/up.rb +48 -0
- data/lib/veewee/provider/virtualbox/box/validate_vagrant.rb +53 -0
- data/lib/veewee/provider/virtualbox/provider.rb +19 -0
- data/lib/veewee/provider/vmfusion/box.rb +67 -0
- data/lib/veewee/provider/vmfusion/box/build.rb +13 -0
- data/lib/veewee/{builder/vmfusion/helper → provider/vmfusion/box}/create.rb +15 -24
- data/lib/veewee/provider/vmfusion/box/destroy.rb +20 -0
- data/lib/veewee/provider/vmfusion/box/export_ova.rb +49 -0
- data/lib/veewee/provider/vmfusion/box/halt.rb +13 -0
- data/lib/veewee/provider/vmfusion/box/helper/buildinfo.rb +43 -0
- data/lib/veewee/provider/vmfusion/box/helper/console_type.rb +18 -0
- data/lib/veewee/provider/vmfusion/box/helper/ip.rb +19 -0
- data/lib/veewee/provider/vmfusion/box/helper/ssh_options.rb +20 -0
- data/lib/veewee/provider/vmfusion/box/helper/status.rb +20 -0
- data/lib/veewee/provider/vmfusion/box/helper/vnc.rb +61 -0
- data/lib/veewee/provider/vmfusion/box/poweroff.rb +13 -0
- data/lib/veewee/provider/vmfusion/box/ssh.rb +12 -0
- data/lib/veewee/{builder/vmfusion/helper → provider/vmfusion/box}/template.rb +9 -4
- data/lib/veewee/{builder/vmfusion/helper → provider/vmfusion/box}/template.vmx.erb +5 -2
- data/lib/veewee/provider/vmfusion/box/up.rb +18 -0
- data/lib/veewee/provider/vmfusion/box/validate_vmfusion.rb +47 -0
- data/lib/veewee/{builder → provider}/vmfusion/info/export_ovf.info +0 -0
- data/lib/veewee/provider/vmfusion/provider.rb +20 -0
- data/lib/veewee/providers.rb +31 -0
- data/lib/veewee/template.rb +26 -0
- data/lib/veewee/templates.rb +71 -0
- data/lib/veewee/ui.rb +6 -4
- data/lib/veewee/version.rb +1 -1
- data/templates/CentOS-4.8-i386/postinstall.sh +1 -1
- data/templates/CentOS-5.5-i386-netboot/definition.rb +16 -0
- data/templates/CentOS-5.5-i386-netboot/ks.cfg +46 -0
- data/templates/CentOS-5.5-i386-netboot/postinstall.sh +60 -0
- data/templates/CentOS-5.5-x86_64-netboot/definition.rb +1 -1
- data/templates/CentOS-5.5-x86_64-netboot/postinstall.sh +1 -1
- data/templates/CentOS-5.6-i386-netboot/definition.rb +1 -1
- data/templates/CentOS-5.6-i386-netboot/ks.cfg +2 -2
- data/templates/CentOS-5.6-i386-netboot/postinstall.sh +21 -9
- data/templates/CentOS-5.6-i386/postinstall.sh +1 -1
- data/templates/CentOS-5.6-x86_64-netboot/definition.rb +1 -1
- data/templates/CentOS-5.6-x86_64-netboot/ks.cfg +1 -1
- data/templates/CentOS-5.6-x86_64-netboot/postinstall.sh +1 -1
- data/templates/CentOS-5.7-i386-netboot/postinstall.sh +3 -3
- data/templates/CentOS-5.7-x86_64-netboot/postinstall.sh +1 -1
- data/templates/CentOS-6.0-i386-netboot/ks.cfg +3 -2
- data/templates/CentOS-6.0-i386-netboot/postinstall.sh +1 -1
- data/templates/CentOS-6.0-i386/ks.cfg +2 -1
- data/templates/CentOS-6.0-i386/postinstall.sh +1 -1
- data/templates/CentOS-6.0-x86_64-minimal/definition.rb +2 -2
- data/templates/CentOS-6.0-x86_64-minimal/ks.cfg +2 -1
- data/templates/CentOS-6.0-x86_64-minimal/postinstall.sh +17 -4
- data/templates/CentOS-6.0-x86_64-netboot/ks.cfg +4 -2
- data/templates/CentOS-6.0-x86_64-netboot/postinstall.sh +1 -1
- data/templates/CentOS-6.0-x86_64/base.sh +12 -0
- data/templates/CentOS-6.0-x86_64/chef.sh +2 -0
- data/templates/CentOS-6.0-x86_64/cleanup.sh +4 -0
- data/templates/CentOS-6.0-x86_64/definition.rb +22 -8
- data/templates/CentOS-6.0-x86_64/ks.cfg +2 -1
- data/templates/CentOS-6.0-x86_64/postinstall.sh +1 -1
- data/templates/CentOS-6.0-x86_64/puppet.sh +11 -0
- data/templates/CentOS-6.0-x86_64/ruby.sh +2 -0
- data/templates/CentOS-6.0-x86_64/vagrant.sh +9 -0
- data/templates/CentOS-6.0-x86_64/virtualbox.sh +8 -0
- data/templates/CentOS-6.1-x86_64-minimal/base.sh +13 -0
- data/templates/CentOS-6.1-x86_64-minimal/chef.sh +2 -0
- data/templates/CentOS-6.1-x86_64-minimal/cleanup.sh +4 -0
- data/templates/CentOS-6.1-x86_64-minimal/definition.rb +39 -0
- data/templates/CentOS-6.1-x86_64-minimal/ks.cfg +47 -0
- data/templates/CentOS-6.1-x86_64-minimal/puppet.sh +11 -0
- data/templates/CentOS-6.1-x86_64-minimal/ruby.sh +2 -0
- data/templates/CentOS-6.1-x86_64-minimal/vagrant.sh +16 -0
- data/templates/CentOS-6.1-x86_64-minimal/virtualbox.sh +8 -0
- data/templates/CentOS-6.1-x86_64-netboot/base.sh +13 -0
- data/templates/CentOS-6.1-x86_64-netboot/chef.sh +2 -0
- data/templates/CentOS-6.1-x86_64-netboot/cleanup.sh +4 -0
- data/templates/CentOS-6.1-x86_64-netboot/definition.rb +39 -0
- data/templates/CentOS-6.1-x86_64-netboot/ks.cfg +46 -0
- data/templates/CentOS-6.1-x86_64-netboot/postinstall.sh +48 -0
- data/templates/CentOS-6.1-x86_64-netboot/puppet.sh +11 -0
- data/templates/CentOS-6.1-x86_64-netboot/ruby.sh +2 -0
- data/templates/CentOS-6.1-x86_64-netboot/vagrant.sh +16 -0
- data/templates/CentOS-6.1-x86_64-netboot/virtualbox.sh +8 -0
- data/templates/CentOS-6.2-x86_64-minimal/base.sh +14 -0
- data/templates/CentOS-6.2-x86_64-minimal/chef.sh +3 -0
- data/templates/CentOS-6.2-x86_64-minimal/cleanup.sh +5 -0
- data/templates/CentOS-6.2-x86_64-minimal/definition.rb +39 -0
- data/templates/CentOS-6.2-x86_64-minimal/ks.cfg +39 -0
- data/templates/CentOS-6.2-x86_64-minimal/puppet.sh +12 -0
- data/templates/CentOS-6.2-x86_64-minimal/ruby.sh +3 -0
- data/templates/CentOS-6.2-x86_64-minimal/vagrant.sh +17 -0
- data/templates/CentOS-6.2-x86_64-minimal/virtualbox.sh +8 -0
- data/templates/CentOS-6.2-x86_64-netboot/base.sh +13 -0
- data/templates/CentOS-6.2-x86_64-netboot/chef.sh +2 -0
- data/templates/CentOS-6.2-x86_64-netboot/cleanup.sh +4 -0
- data/templates/CentOS-6.2-x86_64-netboot/definition.rb +39 -0
- data/templates/CentOS-6.2-x86_64-netboot/ks.cfg +46 -0
- data/templates/CentOS-6.2-x86_64-netboot/postinstall.sh +48 -0
- data/templates/CentOS-6.2-x86_64-netboot/puppet.sh +11 -0
- data/templates/CentOS-6.2-x86_64-netboot/ruby.sh +2 -0
- data/templates/CentOS-6.2-x86_64-netboot/vagrant.sh +16 -0
- data/templates/CentOS-6.2-x86_64-netboot/virtualbox.sh +8 -0
- data/templates/Debian-5.0.8-amd64-netboot/base.sh +9 -0
- data/templates/Debian-5.0.8-amd64-netboot/chef.sh +2 -0
- data/templates/Debian-5.0.8-amd64-netboot/cleanup.sh +10 -0
- data/templates/Debian-5.0.8-amd64-netboot/postinstall.sh +1 -1
- data/templates/Debian-5.0.8-amd64-netboot/puppet.sh +2 -0
- data/templates/Debian-5.0.8-amd64-netboot/ruby.sh +11 -0
- data/templates/Debian-5.0.8-amd64-netboot/vagrant.sh +14 -0
- data/templates/Debian-5.0.8-amd64-netboot/virtualbox.sh +15 -0
- data/templates/Debian-5.0.8-i386-netboot/base.sh +9 -0
- data/templates/Debian-5.0.8-i386-netboot/chef.sh +2 -0
- data/templates/Debian-5.0.8-i386-netboot/cleanup.sh +10 -0
- data/templates/Debian-5.0.8-i386-netboot/postinstall.sh +1 -1
- data/templates/Debian-5.0.8-i386-netboot/puppet.sh +2 -0
- data/templates/Debian-5.0.8-i386-netboot/ruby.sh +11 -0
- data/templates/Debian-5.0.8-i386-netboot/vagrant.sh +14 -0
- data/templates/Debian-5.0.8-i386-netboot/virtualbox.sh +15 -0
- data/templates/Debian-6.0.3-amd64-netboot/base.sh +13 -0
- data/templates/Debian-6.0.3-amd64-netboot/chef.sh +2 -0
- data/templates/Debian-6.0.3-amd64-netboot/cleanup-virtualbox.sh +2 -0
- data/templates/Debian-6.0.3-amd64-netboot/cleanup.sh +18 -0
- data/templates/{Debian-6.0.2-amd64-netboot → Debian-6.0.3-amd64-netboot}/definition.rb +5 -4
- data/templates/Debian-6.0.3-amd64-netboot/postinstall.sh +80 -0
- data/templates/{Debian-6.0.2-amd64-netboot → Debian-6.0.3-amd64-netboot}/preseed.cfg +0 -0
- data/templates/Debian-6.0.3-amd64-netboot/puppet.sh +2 -0
- data/templates/Debian-6.0.3-amd64-netboot/ruby.sh +10 -0
- data/templates/Debian-6.0.3-amd64-netboot/vagrant.sh +25 -0
- data/templates/Debian-6.0.3-amd64-netboot/virtualbox.sh +15 -0
- data/templates/Debian-6.0.3-amd64-netboot/zerodisk.sh +3 -0
- data/templates/Debian-6.0.3-i386-netboot/base.sh +13 -0
- data/templates/Debian-6.0.3-i386-netboot/chef.sh +2 -0
- data/templates/Debian-6.0.3-i386-netboot/cleanup-virtualbox.sh +2 -0
- data/templates/Debian-6.0.3-i386-netboot/cleanup.sh +18 -0
- data/templates/{Debian-6.0.2-i386-netboot → Debian-6.0.3-i386-netboot}/definition.rb +3 -3
- data/templates/{Debian-6.0.2-i386-netboot → Debian-6.0.3-i386-netboot}/postinstall.sh +1 -4
- data/templates/{Debian-6.0.2-i386-netboot → Debian-6.0.3-i386-netboot}/preseed.cfg +0 -0
- data/templates/Debian-6.0.3-i386-netboot/puppet.sh +2 -0
- data/templates/Debian-6.0.3-i386-netboot/ruby.sh +10 -0
- data/templates/Debian-6.0.3-i386-netboot/vagrant.sh +25 -0
- data/templates/Debian-6.0.3-i386-netboot/virtualbox.sh +15 -0
- data/templates/Debian-6.0.3-i386-netboot/zerodisk.sh +3 -0
- data/templates/Debian-6.0.4-amd64-netboot/base.sh +13 -0
- data/templates/Debian-6.0.4-amd64-netboot/chef.sh +2 -0
- data/templates/Debian-6.0.4-amd64-netboot/cleanup-virtualbox.sh +4 -0
- data/templates/Debian-6.0.4-amd64-netboot/cleanup.sh +17 -0
- data/templates/Debian-6.0.4-amd64-netboot/definition.rb +49 -0
- data/templates/Debian-6.0.4-amd64-netboot/preseed.cfg +315 -0
- data/templates/Debian-6.0.4-amd64-netboot/puppet.sh +2 -0
- data/templates/Debian-6.0.4-amd64-netboot/ruby.sh +10 -0
- data/templates/Debian-6.0.4-amd64-netboot/vagrant.sh +21 -0
- data/templates/Debian-6.0.4-amd64-netboot/virtualbox.sh +13 -0
- data/templates/Debian-6.0.4-amd64-netboot/zerodisk.sh +3 -0
- data/templates/Debian-6.0.4-i386-netboot/base.sh +13 -0
- data/templates/Debian-6.0.4-i386-netboot/chef.sh +2 -0
- data/templates/Debian-6.0.4-i386-netboot/cleanup-virtualbox.sh +4 -0
- data/templates/Debian-6.0.4-i386-netboot/cleanup.sh +17 -0
- data/templates/Debian-6.0.4-i386-netboot/definition.rb +51 -0
- data/templates/Debian-6.0.4-i386-netboot/preseed.cfg +315 -0
- data/templates/Debian-6.0.4-i386-netboot/puppet.sh +2 -0
- data/templates/Debian-6.0.4-i386-netboot/ruby.sh +10 -0
- data/templates/Debian-6.0.4-i386-netboot/vagrant.sh +21 -0
- data/templates/Debian-6.0.4-i386-netboot/virtualbox.sh +13 -0
- data/templates/Debian-6.0.4-i386-netboot/zerodisk.sh +3 -0
- data/templates/Fedora-14-amd64-netboot/postinstall.sh +1 -1
- data/templates/Fedora-14-amd64/postinstall.sh +1 -1
- data/templates/Fedora-14-i386-netboot/postinstall.sh +1 -1
- data/templates/Fedora-14-i386/postinstall.sh +1 -1
- data/templates/Fedora-15-x86_64-netboot/definition.rb +29 -0
- data/templates/Fedora-15-x86_64-netboot/ks.cfg +64 -0
- data/templates/Fedora-15-x86_64-netboot/postinstall.sh +33 -0
- data/templates/Fedora-16-i386/definition.rb +17 -0
- data/templates/Fedora-16-i386/ks.cfg +72 -0
- data/templates/Fedora-16-i386/postinstall.sh +35 -0
- data/templates/Fedora-16-x86_64/definition.rb +17 -0
- data/templates/Fedora-16-x86_64/ks.cfg +72 -0
- data/templates/Fedora-16-x86_64/postinstall.sh +35 -0
- data/templates/SLES-11-SP1-DVD-i586-GM/autoinst_de.xml +1127 -0
- data/templates/SLES-11-SP1-DVD-i586-GM/autoinst_en.xml +1127 -0
- data/templates/SLES-11-SP1-DVD-i586-GM/definition.rb +37 -0
- data/templates/SLES-11-SP1-DVD-i586-GM/postinstall.sh +43 -0
- data/templates/SLES-11-SP1-DVD-x86_64-GM/autoinst_de.xml +1171 -0
- data/templates/SLES-11-SP1-DVD-x86_64-GM/autoinst_en.xml +1171 -0
- data/templates/SLES-11-SP1-DVD-x86_64-GM/definition.rb +37 -0
- data/templates/SLES-11-SP1-DVD-x86_64-GM/postinstall.sh +43 -0
- data/templates/archlinux-i386-netboot/aif.cfg +8 -14
- data/templates/archlinux-i386-netboot/definition.rb +4 -7
- data/templates/archlinux-i386-netboot/postinstall.sh +5 -17
- data/templates/archlinux-i386-netboot/postinstall2.sh +3 -1
- data/templates/archlinux-i386/postinstall.sh +1 -1
- data/templates/archlinux-x86_64-netboot/aif.cfg +8 -14
- data/templates/archlinux-x86_64-netboot/definition.rb +4 -7
- data/templates/archlinux-x86_64-netboot/postinstall.sh +1 -16
- data/templates/archlinux-x86_64-netboot/postinstall2.sh +3 -1
- data/templates/archlinux-x86_64/postinstall.sh +1 -1
- data/templates/freebsd-8.2-pcbsd-i386-netboot/definition.rb +5 -3
- data/templates/freebsd-8.2-pcbsd-i386-netboot/postinstall.sh +1 -1
- data/templates/freebsd-8.2-pcbsd-i386/definition.rb +3 -2
- data/templates/freebsd-8.2-pcbsd-i386/postinstall.sh +1 -1
- data/templates/funtoo-latest-generic_64-stable/definition.rb +34 -0
- data/templates/funtoo-latest-generic_64-stable/postinstall.sh +177 -0
- data/templates/funtoo-latest-generic_64-stable/postinstall2.sh +83 -0
- data/templates/gentoo-latest-i386-experimental/definition.rb +6 -6
- data/templates/gentoo-latest-i386-experimental/postinstall.sh +1 -1
- data/templates/gentoo-latest-x86_64-experimental/definition.rb +34 -0
- data/templates/gentoo-latest-x86_64-experimental/postinstall.sh +214 -0
- data/templates/openSUSE-11.4-DVD-i586/postinstall.sh +6 -1
- data/templates/openSUSE-11.4-DVD-x86_64/postinstall.sh +6 -1
- data/templates/openSUSE-11.4-NET-i586/postinstall.sh +6 -1
- data/templates/openSUSE-11.4-NET-x86_64/postinstall.sh +6 -1
- data/templates/openSUSE-12.1-DVD+NET-i586/autoinst_de.xml +1483 -0
- data/templates/openSUSE-12.1-DVD+NET-i586/autoinst_en.xml +1483 -0
- data/templates/openSUSE-12.1-DVD+NET-i586/definition.rb +44 -0
- data/templates/openSUSE-12.1-DVD+NET-i586/postinstall.sh +48 -0
- data/templates/openSUSE-12.1-DVD+NET-x86_64/autoinst_de.xml +1727 -0
- data/templates/openSUSE-12.1-DVD+NET-x86_64/autoinst_en.xml +1727 -0
- data/templates/openSUSE-12.1-DVD+NET-x86_64/definition.rb +44 -0
- data/templates/openSUSE-12.1-DVD+NET-x86_64/postinstall.sh +48 -0
- data/templates/openbsd50_amd64/README +28 -0
- data/templates/openbsd50_amd64/definition.rb +84 -0
- data/templates/openbsd50_amd64/postinstall.sh +81 -0
- data/templates/openbsd50_i386/README +28 -0
- data/templates/openbsd50_i386/definition.rb +84 -0
- data/templates/openbsd50_i386/postinstall.sh +80 -0
- data/templates/openindiana-148-ai-x86/definition.rb +1 -1
- data/templates/openindiana-148-ai-x86/postinstall.sh +1 -1
- data/templates/opensuse-11.4-i386-experimental/postinstall.sh +1 -1
- data/templates/scientificlinux-6.1-i386-netboot/base.sh +1 -0
- data/templates/scientificlinux-6.1-i386-netboot/chef.sh +1 -0
- data/templates/scientificlinux-6.1-i386-netboot/cleanup.sh +4 -0
- data/templates/scientificlinux-6.1-i386-netboot/definition.rb +35 -0
- data/templates/scientificlinux-6.1-i386-netboot/ks.cfg +53 -0
- data/templates/scientificlinux-6.1-i386-netboot/postinstall.sh +30 -0
- data/templates/scientificlinux-6.1-i386-netboot/puppet.sh +1 -0
- data/templates/scientificlinux-6.1-i386-netboot/vagrant.sh +8 -0
- data/templates/scientificlinux-6.1-i386-netboot/virtualbox.sh +8 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/base.sh +1 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/chef.sh +1 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/cleanup.sh +4 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/definition.rb +35 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/ks.cfg +53 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/postinstall.sh +30 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/puppet.sh +1 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/vagrant.sh +8 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/virtualbox.sh +8 -0
- data/templates/solaris-11-express-i386/definition.rb +1 -1
- data/templates/solaris-11-express-i386/postinstall.sh +1 -1
- data/templates/ubuntu-10.04.2-amd64-netboot/postinstall.sh +12 -11
- data/templates/ubuntu-10.04.2-server-i386-netboot/postinstall.sh +12 -11
- data/templates/ubuntu-10.04.3-server-amd64-alt/definition.rb +2 -2
- data/templates/ubuntu-10.04.3-server-amd64-alt/postinstall.sh +12 -11
- data/templates/ubuntu-10.04.3-server-amd64/vagrant.sh +1 -1
- data/templates/ubuntu-10.04.3-server-i386/postinstall.sh +12 -11
- data/templates/ubuntu-10.04.4-server-amd64/definition.rb +24 -0
- data/templates/ubuntu-10.04.4-server-amd64/postinstall.sh +92 -0
- data/templates/ubuntu-10.04.4-server-amd64/preseed.cfg +87 -0
- data/templates/ubuntu-10.04.4-server-i386/definition.rb +24 -0
- data/templates/ubuntu-10.04.4-server-i386/postinstall.sh +92 -0
- data/templates/ubuntu-10.04.4-server-i386/preseed.cfg +87 -0
- data/templates/ubuntu-10.10-server-amd64-netboot/postinstall.sh +12 -11
- data/templates/ubuntu-10.10-server-amd64/postinstall.sh +12 -11
- data/templates/ubuntu-10.10-server-i386-netboot/postinstall.sh +12 -11
- data/templates/ubuntu-10.10-server-i386/postinstall.sh +12 -11
- data/templates/ubuntu-11.04-server-amd64/ssh-keys.sh +1 -1
- data/templates/ubuntu-11.04-server-i386/definition.rb +1 -1
- data/templates/ubuntu-11.04-server-i386/postinstall.sh +12 -11
- data/templates/ubuntu-11.10-server-amd64-ishaya/definition.rb +24 -0
- data/templates/ubuntu-11.10-server-amd64-ishaya/postinstall.sh +91 -0
- data/templates/ubuntu-11.10-server-amd64-ishaya/preseed.cfg +87 -0
- data/templates/ubuntu-11.10-server-amd64-ruby192/definition.rb +24 -0
- data/templates/ubuntu-11.10-server-amd64-ruby192/postinstall.sh +91 -0
- data/templates/ubuntu-11.10-server-amd64-ruby192/preseed.cfg +87 -0
- data/templates/ubuntu-11.10-server-amd64-rvm/definition.rb +35 -0
- data/templates/ubuntu-11.10-server-amd64-rvm/postinstall.sh +85 -0
- data/templates/ubuntu-11.10-server-amd64-rvm/preseed.cfg +93 -0
- data/templates/ubuntu-11.10-server-amd64/definition.rb +35 -0
- data/templates/ubuntu-11.10-server-amd64/postinstall.sh +89 -0
- data/templates/ubuntu-11.10-server-amd64/preseed.cfg +87 -0
- data/templates/ubuntu-11.10-server-i386/definition.rb +35 -0
- data/templates/ubuntu-11.10-server-i386/postinstall.sh +89 -0
- data/templates/ubuntu-11.10-server-i386/preseed.cfg +87 -0
- data/templates/ubuntu-12.04-server-amd64-packages/definition.rb +37 -0
- data/templates/{Debian-6.0.2-amd64-netboot → ubuntu-12.04-server-amd64-packages}/postinstall.sh +33 -32
- data/templates/ubuntu-12.04-server-amd64-packages/preseed.cfg +87 -0
- data/templates/ubuntu-12.04-server-amd64/definition.rb +37 -0
- data/templates/ubuntu-12.04-server-amd64/postinstall.sh +92 -0
- data/templates/ubuntu-12.04-server-amd64/preseed.cfg +87 -0
- data/templates/ubuntu-8.04.4-server-amd64/definition.rb +1 -0
- data/templates/ubuntu-8.04.4-server-amd64/postinstall.sh +19 -17
- data/templates/ubuntu-8.04.4-server-amd64/preseed.cfg +0 -1
- data/templates/ubuntu-8.04.4-server-i386/definition.rb +1 -1
- data/templates/ubuntu-8.04.4-server-i386/postinstall.sh +34 -11
- data/templates/windows-2008R1-serverstandard-amd64/Autounattend.xml +146 -0
- data/templates/windows-2008R1-serverstandard-amd64/README.md +134 -0
- data/templates/windows-2008R1-serverstandard-amd64/cygwin-setup.exe +0 -0
- data/templates/windows-2008R1-serverstandard-amd64/definition.rb +114 -0
- data/templates/windows-2008R1-serverstandard-amd64/install-cygwin-sshd.bat +41 -0
- data/templates/windows-2008R1-serverstandard-amd64/install-guest-additions.bat +5 -0
- data/templates/windows-2008R1-serverstandard-amd64/install-winrm.bat +16 -0
- data/templates/windows-2008R1-serverstandard-amd64/oracle-cert.cer +0 -0
- data/templates/windows-2008R1-serverstandard-amd64/postinstall.sh +75 -0
- data/templates/windows-2008R1-serverstandard-amd64/sudo +2 -0
- data/templates/windows-2008R1-serverstandard-amd64/winrm.rb +8 -0
- data/templates/windows-2008R1-serverweb-amd64/Autounattend.xml +162 -0
- data/templates/windows-2008R1-serverweb-amd64/README.md +134 -0
- data/templates/windows-2008R1-serverweb-amd64/cygwin-setup.exe +0 -0
- data/templates/windows-2008R1-serverweb-amd64/definition.rb +131 -0
- data/templates/windows-2008R1-serverweb-amd64/install-cygwin-sshd.bat +40 -0
- data/templates/windows-2008R1-serverweb-amd64/install-guest-additions.bat +5 -0
- data/templates/windows-2008R1-serverweb-amd64/install-vbox-guest.bat +2 -0
- data/templates/windows-2008R1-serverweb-amd64/install-winrm.bat +16 -0
- data/templates/windows-2008R1-serverweb-amd64/oracle-cert.cer +0 -0
- data/templates/windows-2008R1-serverweb-amd64/postinstall.sh +74 -0
- data/templates/windows-2008R1-serverweb-amd64/sudo +2 -0
- data/templates/windows-2008R1-serverweb-amd64/winrm.rb +8 -0
- data/templates/windows-2008R1-serverweb-i386/Autounattend.xml +142 -0
- data/templates/windows-2008R1-serverweb-i386/README.md +136 -0
- data/templates/windows-2008R1-serverweb-i386/cygwin-setup.exe +0 -0
- data/templates/windows-2008R1-serverweb-i386/definition.rb +132 -0
- data/templates/windows-2008R1-serverweb-i386/install-cygwin-sshd.bat +40 -0
- data/templates/windows-2008R1-serverweb-i386/install-vbox-guest.bat +2 -0
- data/templates/windows-2008R1-serverweb-i386/install-winrm.bat +14 -0
- data/templates/windows-2008R1-serverweb-i386/oracle-cert.cer +0 -0
- data/templates/windows-2008R1-serverweb-i386/postinstall.sh +74 -0
- data/templates/windows-2008R1-serverweb-i386/sudo +2 -0
- data/templates/windows-2008R1-serverweb-i386/winrm.rb +8 -0
- data/templates/windows-2008R1-serverwebcore-amd64/Autounattend.xml +162 -0
- data/templates/windows-2008R1-serverwebcore-amd64/README.md +134 -0
- data/templates/windows-2008R1-serverwebcore-amd64/cygwin-setup.exe +0 -0
- data/templates/windows-2008R1-serverwebcore-amd64/definition.rb +132 -0
- data/templates/windows-2008R1-serverwebcore-amd64/install-cygwin-sshd.bat +41 -0
- data/templates/windows-2008R1-serverwebcore-amd64/install-vbox-guest.bat +2 -0
- data/templates/windows-2008R1-serverwebcore-amd64/install-winrm.bat +14 -0
- data/templates/windows-2008R1-serverwebcore-amd64/oracle-cert.cer +0 -0
- data/templates/windows-2008R1-serverwebcore-amd64/postinstall.sh +74 -0
- data/templates/windows-2008R1-serverwebcore-amd64/sudo +2 -0
- data/templates/windows-2008R1-serverwebcore-amd64/winrm.rb +8 -0
- data/templates/windows-2008R2-amd64/cygwin-setup.exe +0 -0
- data/templates/windows-2008R2-amd64/install-winrm.bat +2 -0
- data/templates/windows-2008R2-amd64/postinstall.sh +1 -1
- data/templates/windows-2008R2-serverstandard-amd64/Autounattend.xml +147 -0
- data/templates/windows-2008R2-serverstandard-amd64/README.md +142 -0
- data/templates/windows-2008R2-serverstandard-amd64/definition.rb +43 -0
- data/templates/windows-2008R2-serverstandard-amd64/install-cygwin-sshd.bat +41 -0
- data/templates/windows-2008R2-serverstandard-amd64/install-winrm.bat +11 -0
- data/templates/windows-2008R2-serverstandard-amd64/oracle-cert.cer +0 -0
- data/templates/windows-2008R2-serverstandard-amd64/postinstall.sh +74 -0
- data/templates/windows-2008R2-serverweb-amd64/Autounattend.xml +151 -0
- data/templates/windows-2008R2-serverweb-amd64/README.md +142 -0
- data/templates/windows-2008R2-serverweb-amd64/definition.rb +38 -0
- data/templates/windows-2008R2-serverweb-amd64/install-cygwin-sshd.bat +40 -0
- data/templates/windows-2008R2-serverweb-amd64/install-vbox-guest.bat +2 -0
- data/templates/windows-2008R2-serverweb-amd64/install-winrm.bat +11 -0
- data/templates/windows-2008R2-serverweb-amd64/oracle-cert.cer +0 -0
- data/templates/windows-2008R2-serverweb-amd64/postinstall.sh +74 -0
- data/templates/windows-2008R2-serverwebcore-amd64/Autounattend.xml +145 -0
- data/templates/windows-2008R2-serverwebcore-amd64/README.md +142 -0
- data/templates/windows-2008R2-serverwebcore-amd64/cygwin-setup.exe +0 -0
- data/templates/windows-2008R2-serverwebcore-amd64/definition.rb +46 -0
- data/templates/windows-2008R2-serverwebcore-amd64/install-cygwin-sshd.bat +41 -0
- data/templates/windows-2008R2-serverwebcore-amd64/install-vbox-guest.bat +2 -0
- data/templates/windows-2008R2-serverwebcore-amd64/install-winrm.bat +11 -0
- data/templates/windows-2008R2-serverwebcore-amd64/oracle-cert.cer +0 -0
- data/templates/windows-2008R2-serverwebcore-amd64/postinstall.sh +74 -0
- data/templates/windows-7-enterprise-amd64/Autounattend.xml +155 -0
- data/templates/windows-7-enterprise-amd64/README.md +52 -0
- data/templates/windows-7-enterprise-amd64/definition.rb +40 -0
- data/templates/windows-7-enterprise-amd64/install-cygwin-sshd.bat +40 -0
- data/templates/windows-7-enterprise-amd64/install-vbox-guest.bat +2 -0
- data/templates/windows-7-enterprise-amd64/install-winrm.bat +14 -0
- data/templates/windows-7-enterprise-amd64/oracle-cert.cer +0 -0
- data/templates/windows-7-enterprise-amd64/postinstall.sh +74 -0
- data/templates/windows-7-enterprise-i386/Autounattend.xml +151 -0
- data/templates/windows-7-enterprise-i386/README.md +169 -0
- data/templates/windows-7-enterprise-i386/definition.rb +40 -0
- data/templates/windows-7-enterprise-i386/install-cygwin-sshd.bat +40 -0
- data/templates/windows-7-enterprise-i386/install-winrm.bat +14 -0
- data/templates/windows-7-enterprise-i386/oracle-cert.cer +0 -0
- data/templates/windows-7-enterprise-i386/postinstall.sh +74 -0
- data/templates/windows-7-premium-amd64/Autounattend.xml +152 -0
- data/templates/windows-7-premium-amd64/README.md +171 -0
- data/templates/windows-7-premium-amd64/definition.rb +38 -0
- data/templates/windows-7-premium-amd64/install-chefclient.bat +44 -0
- data/templates/windows-7-premium-amd64/install-winrm.bat +11 -0
- data/templates/windows-7-premium-amd64/oracle-cert.cer +0 -0
- data/templates/windows-7-premium-amd64/postinstall.sh +124 -0
- data/templates/windows-7-premium-amd64/winrm.rb +8 -0
- data/templates/windows-7-professional-amd64/Autounattend.xml +152 -0
- data/templates/windows-7-professional-amd64/README.md +171 -0
- data/templates/windows-7-professional-amd64/definition.rb +41 -0
- data/templates/windows-7-professional-amd64/install-cygwin-sshd.bat +40 -0
- data/templates/windows-7-professional-amd64/install-winrm.bat +14 -0
- data/templates/windows-7-professional-amd64/oracle-cert.cer +0 -0
- data/templates/windows-7-professional-amd64/postinstall.sh +74 -0
- data/templates/windows-7-ultimate-amd64/Autounattend.xml +152 -0
- data/templates/windows-7-ultimate-amd64/README.md +89 -0
- data/templates/windows-7-ultimate-amd64/definition.rb +41 -0
- data/templates/windows-7-ultimate-amd64/install-cygwin-sshd.bat +40 -0
- data/templates/windows-7-ultimate-amd64/install-winrm.bat +14 -0
- data/templates/windows-7-ultimate-amd64/oracle-cert.cer +0 -0
- data/templates/windows-7-ultimate-amd64/postinstall.sh +74 -0
- data/templates/windows-7sp1-ultimate-amd64/Autounattend.xml +149 -0
- data/templates/windows-7sp1-ultimate-amd64/README.md +89 -0
- data/templates/windows-7sp1-ultimate-amd64/definition.rb +42 -0
- data/templates/windows-7sp1-ultimate-amd64/install-cygwin-sshd.bat +40 -0
- data/templates/windows-7sp1-ultimate-amd64/install-winrm.bat +14 -0
- data/templates/windows-7sp1-ultimate-amd64/oracle-cert.cer +0 -0
- data/templates/windows-7sp1-ultimate-amd64/postinstall.sh +74 -0
- data/templates/windows-8-preview-dev-amd64/Autounattend.xml +140 -0
- data/templates/windows-8-preview-dev-amd64/README.md +134 -0
- data/templates/windows-8-preview-dev-amd64/cygwin-setup.exe +0 -0
- data/templates/windows-8-preview-dev-amd64/definition.rb +114 -0
- data/templates/windows-8-preview-dev-amd64/install-cygwin-sshd.bat +38 -0
- data/templates/windows-8-preview-dev-amd64/install-winrm.bat +11 -0
- data/templates/windows-8-preview-dev-amd64/oracle-cert.cer +0 -0
- data/templates/windows-8-preview-dev-amd64/postinstall.sh +122 -0
- data/templates/windows-8-preview-dev-amd64/winrm.rb +8 -0
- data/test/build_realtest.rb +71 -0
- data/test/definition_test.rb +3 -3
- data/test/definitions/test_definition/_disabled_postinstall.sh +1 -0
- data/test/definitions/test_definition/definition.rb +14 -17
- data/test/definitions/test_definition/enabled_postinstall.sh +1 -0
- data/test/environment_test.rb +4 -4
- data/validation/features/steps/{ssh_steps.rb → ssh_steps.old} +0 -0
- data/validation/features/steps/veewee_steps.rb +27 -0
- data/validation/veewee.feature +45 -0
- data/veewee.gemspec +18 -11
- metadata +500 -175
- data/Gemfile.lock +0 -98
- data/README-LIB.md +0 -2
- data/lib/veewee/builder/core/box.rb +0 -32
- data/lib/veewee/builder/core/builder/build.rb +0 -250
- data/lib/veewee/builder/core/builder/iso.rb +0 -120
- data/lib/veewee/builder/kvm/box.rb +0 -130
- data/lib/veewee/builder/kvm/builder.rb +0 -38
- data/lib/veewee/builder/virtualbox/box.rb +0 -121
- data/lib/veewee/builder/virtualbox/builder.rb +0 -48
- data/lib/veewee/builder/virtualbox/helper/_snapshots.rb +0 -105
- data/lib/veewee/builder/virtualbox/helper/_transaction.rb +0 -135
- data/lib/veewee/builder/virtualbox/helper/console_type.rb +0 -62
- data/lib/veewee/builder/virtualbox/helper/create.rb +0 -210
- data/lib/veewee/builder/virtualbox/helper/destroy.rb +0 -79
- data/lib/veewee/builder/virtualbox/helper/export_vagrant.rb +0 -87
- data/lib/veewee/builder/virtualbox/helper/validate_vagrant.rb +0 -35
- data/lib/veewee/builder/vmfusion/box.rb +0 -137
- data/lib/veewee/builder/vmfusion/builder.rb +0 -78
- data/lib/veewee/builder/vmfusion/helper/export_ova.rb +0 -26
- data/lib/veewee/builder/vmfusion/helper/validate_vmfusion.rb +0 -37
- data/lib/veewee/config/builders.rb +0 -36
- data/lib/veewee/util/scancode.rb +0 -112
- data/lib/veewee/util/shell.rb +0 -42
- data/lib/veewee/util/ssh.rb +0 -158
- data/lib/veewee/util/tcp.rb +0 -88
- data/lib/veewee/util/web.rb +0 -63
- data/lib/veewee/vagrant/config.rb +0 -7
- data/test/build_test.rb +0 -50
- data/test/definitions/test_definition/_test_me.sh +0 -1
- data/validation/vagrant.feature +0 -68
@@ -0,0 +1 @@
|
|
1
|
+
strings /Applications/VMware Fusion.app/Contents/MacOS/vmware |grep gostable|cut -d '.' -f 4|cut -d ')' -f 1|more
|
data/lib/veewee/definition.rb
CHANGED
@@ -1,15 +1,19 @@
|
|
1
1
|
require 'ostruct'
|
2
|
+
require 'veewee/provider/core/helper/iso'
|
2
3
|
|
3
4
|
module Veewee
|
4
5
|
class Definition
|
5
6
|
|
7
|
+
include ::Veewee::Provider::Core::Helper::Iso
|
8
|
+
|
6
9
|
attr_accessor :name
|
7
10
|
attr_accessor :env
|
11
|
+
attr_accessor :path
|
8
12
|
|
9
13
|
attr_accessor :cpu_count,:memory_size,:iso_file
|
10
14
|
attr_accessor :disk_size, :disk_format
|
11
15
|
|
12
|
-
attr_accessor :
|
16
|
+
attr_accessor :os_type_id
|
13
17
|
|
14
18
|
attr_accessor :boot_wait,:boot_cmd_sequence
|
15
19
|
|
@@ -24,17 +28,26 @@ module Veewee
|
|
24
28
|
|
25
29
|
attr_accessor :floppy_files
|
26
30
|
|
27
|
-
attr_accessor :path
|
28
31
|
|
29
|
-
attr_accessor :
|
32
|
+
attr_accessor :use_hw_virt_ext,:use_pae,:hostiocache
|
30
33
|
|
31
34
|
attr_accessor :iso_dowload_timeout, :iso_src,:iso_md5 ,:iso_download_instructions
|
32
35
|
|
33
|
-
|
36
|
+
attr_accessor :virtualbox
|
37
|
+
attr_accessor :vmfusion
|
38
|
+
attr_accessor :kvm
|
39
|
+
|
40
|
+
def initialize(name,path,env)
|
34
41
|
|
35
42
|
@name=name
|
36
43
|
@env=env
|
37
44
|
|
45
|
+
if path.nil?
|
46
|
+
@path=File.join(env.definition_dir,name)
|
47
|
+
else
|
48
|
+
@path=path
|
49
|
+
end
|
50
|
+
|
38
51
|
# Default is 1 CPU + 256 Mem of memory
|
39
52
|
@cpu_count='1' ; @memory_size='256';
|
40
53
|
|
@@ -55,76 +68,119 @@ module Veewee
|
|
55
68
|
# :boot_wait => "10", :boot_cmd_sequence => [ "boot"],
|
56
69
|
# :kickstart_port => "7122", :kickstart_ip => "127.0.0.1", :kickstart_timeout => 10000,#
|
57
70
|
# :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
|
71
|
+
@ssh_host_port = "2222"; @ssh_guest_port = "22"
|
58
72
|
# :ssh_host_port => "2222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
|
59
73
|
# :shutdown_cmd => "shutdown -h now",
|
60
74
|
# :kickstart_file => nil,
|
61
75
|
|
62
|
-
|
76
|
+
@virtualbox={:vm_options => {}}
|
77
|
+
@vmfusion={:vm_options => {}}
|
78
|
+
@kvm={:vm_options => {}}
|
63
79
|
|
64
|
-
|
65
|
-
def method_missing(m, *args, &block)
|
66
|
-
env.logger.info "There's no attribute #{m} defined for builder #{@name}-- ignoring it"
|
67
80
|
end
|
68
81
|
|
82
|
+
|
83
|
+
# This function takes a hash of options and injects them into the definition
|
69
84
|
def declare(options)
|
70
85
|
options.each do |key, value|
|
71
86
|
instance_variable_set("@#{key}".to_sym, options[key])
|
72
87
|
env.logger.info("definition") { " - #{key} : #{options[key]}" }
|
73
88
|
end
|
74
|
-
verify_ostype
|
75
89
|
|
76
90
|
end
|
77
91
|
|
78
|
-
#
|
92
|
+
# Class method to loading a definition
|
79
93
|
def self.load(name,env)
|
80
94
|
|
81
|
-
|
82
|
-
|
83
|
-
if dir.nil?
|
84
|
-
env.ui.error "Error loading definition."
|
85
|
-
env.ui.error "could not find the directory of definition #{name}"
|
86
|
-
exit -1
|
95
|
+
# Construct the path to the definition
|
87
96
|
|
97
|
+
path=File.join(env.definition_dir,name)
|
98
|
+
definition=Veewee::Definition.new(name,path,env)
|
99
|
+
env.logger.info "Loading definition directory #{definition.path}"
|
100
|
+
unless definition.exists?
|
101
|
+
raise Veewee::DefinitionNotExist,"Error: Definition #{name} does not seem to exist"
|
88
102
|
end
|
89
103
|
|
90
|
-
|
91
|
-
veewee_definition
|
104
|
+
# We create this longer name to avoid clashes
|
105
|
+
veewee_definition=definition
|
92
106
|
|
93
|
-
|
94
|
-
|
95
|
-
|
107
|
+
if definition.exists?
|
108
|
+
definition_file=File.join(definition.path,"definition.rb")
|
109
|
+
content=File.read(definition_file)
|
96
110
|
|
97
|
-
|
98
|
-
|
111
|
+
content.gsub!("Veewee::Session.declare","veewee_definition.declare")
|
112
|
+
content.gsub!("Veewee::Definition.declare","veewee_definition.declare")
|
99
113
|
|
100
|
-
env.logger.info(
|
114
|
+
env.logger.info(content)
|
101
115
|
|
102
116
|
begin
|
103
117
|
cwd=FileUtils.pwd
|
104
|
-
|
105
|
-
|
106
|
-
|
118
|
+
env.logger.info("Entering path #{definition.path}")
|
119
|
+
FileUtils.cd(definition.path)
|
120
|
+
self.instance_eval(content)
|
121
|
+
env.logger.info("Returning to path #{cwd}")
|
107
122
|
FileUtils.cd(cwd)
|
108
123
|
rescue NameError => ex
|
109
|
-
|
124
|
+
raise Veewee::DefinitionError,"NameError reading definition from file #{definition_file} #{ex}"
|
110
125
|
rescue Exception => ex
|
111
|
-
|
112
|
-
exit -1
|
126
|
+
raise Veewee::DefinitionError,"Error in the definition from file #{definition_file}\n#{ex}"
|
113
127
|
end
|
114
128
|
else
|
115
|
-
env.logger.
|
129
|
+
env.logger.fatal("#{definition_file} not found")
|
130
|
+
raise Veewee::DefinitionNotExist,"#{definition_file} not found"
|
131
|
+
end
|
132
|
+
|
133
|
+
if definition.valid?
|
134
|
+
return definition
|
135
|
+
else
|
136
|
+
env.logger.fatal("Invalid Definition")
|
137
|
+
raise Veewee::DefinitionError,"Invalid Definition"
|
116
138
|
end
|
117
|
-
veewee_definition
|
118
139
|
end
|
119
140
|
|
120
|
-
def
|
141
|
+
def exists?
|
142
|
+
filename=File.join(path,"definition.rb")
|
143
|
+
unless File.exists?(filename)
|
144
|
+
return false
|
145
|
+
end
|
146
|
+
|
147
|
+
return true
|
148
|
+
end
|
149
|
+
|
150
|
+
def valid?
|
151
|
+
# Check if the definition exists?
|
152
|
+
unless exists?
|
153
|
+
return false
|
154
|
+
end
|
155
|
+
|
156
|
+
# Check ostype to be valid
|
157
|
+
unless ostype_valid?
|
158
|
+
return false
|
159
|
+
end
|
121
160
|
|
122
|
-
|
123
|
-
|
161
|
+
# Postinstall files require a valid user and password
|
162
|
+
unless self.postinstall_files.nil?
|
163
|
+
if self.ssh_user.nil? || self.ssh_password.nil?
|
164
|
+
return false
|
165
|
+
end
|
124
166
|
end
|
125
167
|
|
168
|
+
return true
|
126
169
|
end
|
127
170
|
|
171
|
+
private
|
172
|
+
def ostype_valid?
|
173
|
+
unless env.ostypes.has_key?(@os_type_id)
|
174
|
+
env.ui.info("The ostype: #{@os_type_id} is not available")
|
175
|
+
return false
|
176
|
+
else
|
177
|
+
return true
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
def method_missing(m, *args, &block)
|
182
|
+
env.logger.info "There's no attribute #{m} defined for definition #{@name}-- ignoring it"
|
183
|
+
end
|
128
184
|
|
129
185
|
end #End Class
|
130
186
|
end #End Module
|
@@ -0,0 +1,156 @@
|
|
1
|
+
require 'veewee/definition'
|
2
|
+
require 'veewee/templates'
|
3
|
+
require 'veewee/template'
|
4
|
+
|
5
|
+
module Veewee
|
6
|
+
class Definitions
|
7
|
+
|
8
|
+
attr_accessor :env
|
9
|
+
|
10
|
+
def initialize(env)
|
11
|
+
@env=env
|
12
|
+
return self
|
13
|
+
end
|
14
|
+
|
15
|
+
def [](name)
|
16
|
+
begin
|
17
|
+
definition=Veewee::Definition.load(name,env)
|
18
|
+
return definition
|
19
|
+
rescue Veewee::DefinitionNotExist
|
20
|
+
return nil
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# Fetch all definitions
|
25
|
+
def each(&block)
|
26
|
+
definitions=Hash.new
|
27
|
+
|
28
|
+
env.logger.debug("[Definition] Searching #{env.definition_dir} for definitions:")
|
29
|
+
subdirs=Dir.glob("#{env.definition_dir}/*")
|
30
|
+
|
31
|
+
subdirs.each do |sub|
|
32
|
+
name=File.basename(sub)
|
33
|
+
env.logger.debug("[Definition] possible definition '#{name}' found")
|
34
|
+
begin
|
35
|
+
definitions[name]=Veewee::Definition.load(name,env)
|
36
|
+
rescue Veewee::DefinitionError => ex
|
37
|
+
env.logger.debug("[Definition] failed to load definition from directory '#{name}' #{ex}")
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
if definitions.length==0
|
42
|
+
env.logger.debug("[Definition] no definitions found")
|
43
|
+
end
|
44
|
+
|
45
|
+
definitions.each(&block)
|
46
|
+
end
|
47
|
+
|
48
|
+
# This function 'defines'/'clones'/'instantiates a template:
|
49
|
+
# It copies from a template dir with template_name
|
50
|
+
# to a new definition dir with definition_name
|
51
|
+
#
|
52
|
+
# Options are : :force => true to overwrite an existing definition
|
53
|
+
#
|
54
|
+
# Returns definition object
|
55
|
+
|
56
|
+
|
57
|
+
def define(definition_name,template_name,options = {})
|
58
|
+
|
59
|
+
# Default is not to overwrite
|
60
|
+
options = {'force' => false}.merge(options)
|
61
|
+
|
62
|
+
env.logger.debug("Forceflag : #{options['force']}")
|
63
|
+
|
64
|
+
# Check if template exists
|
65
|
+
template=env.templates[template_name]
|
66
|
+
if template.nil?
|
67
|
+
env.logger.fatal("Template '#{template_name}' does not exist")
|
68
|
+
raise Veewee::TemplateError, "Template '#{template_name}' does not exist"
|
69
|
+
else
|
70
|
+
env.logger.debug("Template '#{template_name}' exists")
|
71
|
+
end
|
72
|
+
|
73
|
+
create_definition_dir_if_needed
|
74
|
+
|
75
|
+
# Check if definition does not exist
|
76
|
+
definition=env.definitions[definition_name]
|
77
|
+
unless definition.nil?
|
78
|
+
env.logger.debug("Definition '#{definition_name}' exists")
|
79
|
+
if options['force']==true
|
80
|
+
self.undefine(definition_name,options)
|
81
|
+
else
|
82
|
+
raise Veewee::DefinitionError,"Definition #{definition_name} already exists and no force option was given"
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
env.logger.debug("Creating definition #{definition_name} in directory '#{env.definition_dir}' ")
|
87
|
+
dst_dir="#{File.join(env.definition_dir,definition_name)}"
|
88
|
+
FileUtils.mkdir(dst_dir)
|
89
|
+
env.logger.debug("Definition Directory '#{File.join(env.definition_dir,definition_name)}' succesfuly created")
|
90
|
+
|
91
|
+
# Start copying/cloning the directory of the template to the definition directory
|
92
|
+
begin
|
93
|
+
env.logger.debug("Starting copy '#{template.path}' to '#{dst_dir}'")
|
94
|
+
FileUtils.cp_r(template.path+"/.",dst_dir)
|
95
|
+
env.logger.debug("Copy '#{template.path}' to '#{dst_dir}' succesfull")
|
96
|
+
rescue Exception => ex
|
97
|
+
env.logger.fatal("Copy '#{template.path}' to #{dst_dir}' failed: #{ex}")
|
98
|
+
raise Veewee::Error , "Copy '#{template.path}' to #{dst_dir}' failed: #{ex}"
|
99
|
+
end
|
100
|
+
|
101
|
+
definition=env.definitions[definition_name]
|
102
|
+
return definition
|
103
|
+
end
|
104
|
+
|
105
|
+
|
106
|
+
# This function undefines/removes the definition by removing the directoy with definition_name
|
107
|
+
# under env.definition_dir
|
108
|
+
def undefine(definition_name,options = {})
|
109
|
+
definition=env.definitions[definition_name]
|
110
|
+
unless definition.nil?
|
111
|
+
|
112
|
+
#TODO: Needs to be more defensive!!
|
113
|
+
env.logger.debug("[Undefine] About to remove '#{definition.path} for '#{definition_name}'")
|
114
|
+
begin
|
115
|
+
if File.exists?(File.join(definition.path,"definition.rb"))
|
116
|
+
FileUtils.rm_rf(definition.path)
|
117
|
+
else
|
118
|
+
env.logger.fatal("Aborting delete: The directory definition.path does not contain a definition.rb file")
|
119
|
+
raise Veewee::DefinitionError,"Aborting delete: The directory definition.path does not contain a definition.rb file"
|
120
|
+
end
|
121
|
+
rescue Exception => ex
|
122
|
+
env.logger.fatal("Removing '#{definition.path} for '#{definition_name}' failed: #{ex}")
|
123
|
+
raise Veewee::Error, "Removing '#{definition.path }for '#{definition_name}' failed: #{ex}"
|
124
|
+
end
|
125
|
+
env.logger.debug("Removing '#{definition.path} for '#{definition_name}' succesful")
|
126
|
+
else
|
127
|
+
raise Veewee::DefinitionError,"Definition '#{definition_name}' does not exist"
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
def create_definition_dir_if_needed
|
132
|
+
# Check if definition_dir already exists
|
133
|
+
unless File.exists?(env.definition_dir)
|
134
|
+
env.logger.debug("Creating definition base directory '#{env.definition_dir}' ")
|
135
|
+
FileUtils.mkdir(env.definition_dir)
|
136
|
+
env.logger.debug("Definition base directory '#{env.definition_dir}' succesfuly created")
|
137
|
+
end
|
138
|
+
|
139
|
+
if File.writable?(env.definition_dir)
|
140
|
+
env.logger.debug("DefinitionDir '#{env.definition_dir}' is writable")
|
141
|
+
if File.exists?("#{env.definition_dir}")
|
142
|
+
env.logger.debug("DefinitionDir '#{env.definition_dir}' already exists")
|
143
|
+
else
|
144
|
+
env.logger.debug("DefinitionDir '#{env.definition_dir}' does not exist, creating it")
|
145
|
+
FileUtils.mkdir(definition_dir)
|
146
|
+
env.logger.debug("DefinitionDir '#{env.definition_dir}' succesfuly created")
|
147
|
+
end
|
148
|
+
else
|
149
|
+
env.logger.fatal("DefinitionDir '#{definition_dir}' is not writable")
|
150
|
+
raise Veewee::Error, "DefinitionDir '#{definition_dir}' is not writable"
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
|
155
|
+
end
|
156
|
+
end
|
data/lib/veewee/environment.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
require 'veewee/config'
|
2
|
+
require 'veewee/definitions'
|
3
|
+
require 'veewee/templates'
|
4
|
+
require 'veewee/providers'
|
2
5
|
|
3
6
|
require 'logger'
|
4
7
|
|
@@ -19,16 +22,16 @@ module Veewee
|
|
19
22
|
|
20
23
|
# This initializes a new Veewee Environment
|
21
24
|
# settings argument is a hash with the following options
|
22
|
-
# - :
|
23
|
-
# - :definition_dir : where new definition will be created
|
25
|
+
# - :definition_dir : where definitions are located
|
24
26
|
# - :template_path : paths that contains the template definitions that come with the veewee gem, defaults to the path relative to the gemfiles
|
25
27
|
# - :iso_dir : directory to look for iso files, defaults to $environment_dir/iso
|
26
28
|
# - :validation_dir : directory that contains a list of validation tests, that can be run after building a box
|
27
29
|
# - :tmp_dir : directory that will be used for creating temporary files, needs to be rewritable, default to $environment_dir/tmp
|
28
|
-
|
29
|
-
attr_accessor :
|
30
|
-
|
31
|
-
attr_accessor :
|
30
|
+
attr_accessor :template_path
|
31
|
+
attr_accessor :definition_dir
|
32
|
+
attr_accessor :iso_dir
|
33
|
+
attr_accessor :validation_dir
|
34
|
+
attr_accessor :tmp_dir
|
32
35
|
|
33
36
|
# The {UI} Object to communicate with the outside world
|
34
37
|
attr_writer :ui
|
@@ -36,15 +39,28 @@ module Veewee
|
|
36
39
|
# The configuration as loaded
|
37
40
|
attr_accessor :config
|
38
41
|
|
42
|
+
# Hash element of all definitions available
|
43
|
+
attr_accessor :definitions
|
44
|
+
|
45
|
+
# Hash element of all templates available
|
46
|
+
attr_accessor :templates
|
47
|
+
|
48
|
+
# Hash element of all templates available
|
49
|
+
attr_accessor :providers
|
50
|
+
|
51
|
+
# Hash elelement of all OStypes
|
52
|
+
attr_reader :ostypes
|
53
|
+
|
39
54
|
def initialize(options={})
|
40
55
|
|
41
|
-
cwd=
|
56
|
+
cwd = ENV['VEEWEE_DIR'] || Dir.pwd
|
57
|
+
# If a cwd was provided as option it overrules the default
|
58
|
+
cwd = options[:cwd] if options.has_key?(:cwd)
|
42
59
|
|
43
60
|
defaults={
|
44
61
|
:cwd => cwd,
|
45
62
|
:veewee_filename => "Veeweefile",
|
46
63
|
:loglevel => :info,
|
47
|
-
:definition_path => [File.join(cwd,"definitions")],
|
48
64
|
:definition_dir => File.join(cwd,"definitions"),
|
49
65
|
:template_path => [File.expand_path(File.join(File.dirname(__FILE__),"..","..",'templates')),"templates"],
|
50
66
|
:iso_dir => File.join(cwd,"iso"),
|
@@ -57,209 +73,29 @@ module Veewee
|
|
57
73
|
# We need to set this variable before the first call to the logger object
|
58
74
|
if options.has_key?("debug")
|
59
75
|
ENV['VEEWEE_LOG']="STDOUT"
|
60
|
-
ui.info "Debugging enabled"
|
61
76
|
end
|
62
77
|
|
63
|
-
|
64
78
|
logger.info("environment") { "Environment initialized (#{self})" }
|
65
79
|
|
66
80
|
# Injecting all variables of the options and assign the variables
|
67
81
|
options.each do |key, value|
|
68
82
|
instance_variable_set("@#{key}".to_sym, options[key])
|
69
83
|
logger.info("environment") { " - #{key} : #{options[key]}" }
|
70
|
-
|
71
|
-
end
|
72
|
-
|
73
|
-
return self
|
74
|
-
end
|
75
|
-
|
76
|
-
|
77
|
-
#---------------------------------------------------------------
|
78
|
-
# Retrieval Methods
|
79
|
-
#---------------------------------------------------------------
|
80
|
-
|
81
|
-
# Traverses path to see which exist or not
|
82
|
-
# and checks if a definition.rb is available
|
83
|
-
def valid_paths(paths)
|
84
|
-
valid_paths=paths.collect { |path|
|
85
|
-
if File.exists?(path) && File.directory?(path)
|
86
|
-
logger.info "Definition path #{path} exists"
|
87
|
-
File.expand_path(path)
|
88
|
-
else
|
89
|
-
logger.info "Definition path #{path} does not exist, skipping"
|
90
|
-
nil
|
91
|
-
end
|
92
|
-
}
|
93
|
-
return valid_paths.compact
|
94
|
-
end
|
95
|
-
|
96
|
-
# This function retrieves all the templates given the @template_dir in the current Environment object
|
97
|
-
# A valid template has to contain the file definition.rb
|
98
|
-
# The name of the template is the name of the parent directory of the definition.rb file
|
99
|
-
#
|
100
|
-
# returns a hash of 'template name' => 'path'
|
101
|
-
def get_template_paths
|
102
|
-
|
103
|
-
templates=Hash.new
|
104
|
-
|
105
|
-
valid_paths(template_path).each do |template_dir|
|
106
|
-
|
107
|
-
logger.debug("[Template] Searching #{template_dir} for templates")
|
108
|
-
|
109
|
-
subdirs=Dir.glob("#{template_dir}/*")
|
110
|
-
subdirs.each do |sub|
|
111
|
-
if File.directory?("#{sub}")
|
112
|
-
definition=Dir.glob("#{sub}/definition.rb")
|
113
|
-
if definition.length!=0
|
114
|
-
name=sub.sub(/#{template_dir}\//,'')
|
115
|
-
logger.debug("[Template] template '#{name}' found")
|
116
|
-
templates[name]=File.join(template_dir,name)
|
117
|
-
end
|
118
|
-
end
|
119
84
|
end
|
120
|
-
end
|
121
85
|
|
122
|
-
|
123
|
-
|
86
|
+
# Definitions
|
87
|
+
@definitions=Veewee::Definitions.new(self)
|
88
|
+
@templates=Veewee::Templates.new(self)
|
89
|
+
@providers=Veewee::Providers.new(self)
|
124
90
|
|
125
|
-
|
126
|
-
|
91
|
+
# Read ostypes
|
92
|
+
yamlfile=File.join(File.dirname(__FILE__),"config","ostypes.yml")
|
93
|
+
logger.info "Reading ostype yamlfile #{yamlfile}"
|
94
|
+
@ostypes=YAML.load_file(yamlfile)
|
127
95
|
|
128
|
-
|
129
|
-
@ui.info "#{key}"
|
130
|
-
}
|
96
|
+
return self
|
131
97
|
end
|
132
98
|
|
133
|
-
# This function returns a hash of names of all the definitions that are in the @definition_dir,
|
134
|
-
# given the @definition_dir in the current Environment object
|
135
|
-
# The name of the definition is the name of a sub-directory in the @definition_dir
|
136
|
-
def get_definition_paths
|
137
|
-
|
138
|
-
definitions=Hash.new
|
139
|
-
|
140
|
-
valid_paths(definition_path).each do |definition_dir|
|
141
|
-
|
142
|
-
logger.debug("[Definition] Searching #{definition_dir} for definitions:")
|
143
|
-
|
144
|
-
subdirs=Dir.glob("#{definition_dir}/*")
|
145
|
-
subdirs.each do |sub|
|
146
|
-
name=File.basename(sub)
|
147
|
-
logger.debug("[Definition] definition '#{name}' found")
|
148
|
-
definitions[name]=File.join(definition_dir,name)
|
149
|
-
end
|
150
|
-
end
|
151
|
-
logger.debug("[Definition] no definitions found") if definitions.length==0
|
152
|
-
|
153
|
-
return definitions
|
154
|
-
end
|
155
|
-
|
156
|
-
# Based on the definition_dir set in the current Environment object
|
157
|
-
# it will load the definition based on the name
|
158
|
-
#
|
159
|
-
# returns a Veewee::Definition
|
160
|
-
def get_definition(name)
|
161
|
-
definition=Veewee::Definition.load(name,self)
|
162
|
-
return definition
|
163
|
-
end
|
164
|
-
|
165
|
-
# This function 'defines'/'clones'/'instantiates a template
|
166
|
-
# by copying the template directory to a directory with the definitionname under the @defintion_dir
|
167
|
-
# Options are : :force => true to overwrite an existing definition
|
168
|
-
#
|
169
|
-
# Returns nothing
|
170
|
-
def define(definition_name,template_name,define_options = {})
|
171
|
-
# Default is not to overwrite
|
172
|
-
define_options = {'force' => false}.merge(define_options)
|
173
|
-
|
174
|
-
logger.debug("Forceflag : #{define_options['force']}")
|
175
|
-
|
176
|
-
# Check if template exists
|
177
|
-
template_exists=get_template_paths.has_key?(template_name)
|
178
|
-
template_dir=get_template_paths[template_name]
|
179
|
-
|
180
|
-
unless template_exists
|
181
|
-
logger.fatal("Template '#{template_name}' does not exist")
|
182
|
-
exit -1
|
183
|
-
else
|
184
|
-
logger.debug("Template '#{template_name}' exists")
|
185
|
-
end
|
186
|
-
|
187
|
-
# Check if definition exists
|
188
|
-
definition_exists=get_definition_paths.has_key?(definition_name)
|
189
|
-
definition_dir=get_definition_paths[definition_name]
|
190
|
-
|
191
|
-
if definition_exists
|
192
|
-
logger.debug("Definition '#{definition_name}' already exists")
|
193
|
-
|
194
|
-
if !define_options['force']
|
195
|
-
logger.fatal("No force was specified, bailing out")
|
196
|
-
exit -1
|
197
|
-
else
|
198
|
-
logger.debug("Force option specified, cleaning existing directory")
|
199
|
-
undefine(definition_name)
|
200
|
-
end
|
201
|
-
|
202
|
-
else
|
203
|
-
logger.debug("Definition '#{definition_name}' does not yet exist")
|
204
|
-
end
|
205
|
-
|
206
|
-
unless File.exists?(@definition_dir)
|
207
|
-
logger.debug("Creating definition base directory '#{@definition_dir}' ")
|
208
|
-
FileUtils.mkdir(@definition_dir)
|
209
|
-
logger.debug("Definition base directory '#{@definition_dir}' succesfuly created")
|
210
|
-
end
|
211
|
-
|
212
|
-
if File.writable?(@definition_dir)
|
213
|
-
logger.debug("DefinitionDir '#{@definition_dir}' is writable")
|
214
|
-
if File.exists?("#{@definition_dir}")
|
215
|
-
logger.debug("DefinitionDir '#{@definition_dir}' already exists")
|
216
|
-
else
|
217
|
-
logger.debug("DefinitionDir '#{@definition_dir}' does not exist, creating it")
|
218
|
-
FileUtils.mkdir(definition_dir)
|
219
|
-
logger.debug("DefinitionDir '#{@definition_dir}' succesfuly created")
|
220
|
-
end
|
221
|
-
logger.debug("Creating definition #{definition_name} in directory '#{@definition_dir}' ")
|
222
|
-
FileUtils.mkdir(File.join(@definition_dir,definition_name))
|
223
|
-
logger.debug("Definition Directory '#{File.join(@definition_dir,definition_name)}' succesfuly created")
|
224
|
-
|
225
|
-
else
|
226
|
-
logger.fatal("DefinitionDir '#{definition_dir}' is not writable")
|
227
|
-
exit -1
|
228
|
-
end
|
229
|
-
|
230
|
-
# Start copying/cloning the directory of the template to the definition directory
|
231
|
-
begin
|
232
|
-
logger.debug("Starting copy '#{template_dir}' to '#{File.join(@definition_dir,definition_name)}'")
|
233
|
-
FileUtils.cp_r(template_dir+"/.","#{File.join(@definition_dir,definition_name)}")
|
234
|
-
logger.debug("Copy '#{template_dir}' to '#{File.join(@definition_dir,definition_name)}' succesfull")
|
235
|
-
rescue Exception => ex
|
236
|
-
logger.fatal("Copy '#{template_dir}' to #{File.join(@definition_dir,definition_name)}' failed: #{ex}")
|
237
|
-
exit -1
|
238
|
-
end
|
239
|
-
end
|
240
|
-
|
241
|
-
|
242
|
-
# This function undefines/removes the definition by removing the directoy with definition_name
|
243
|
-
# under @definition_dir
|
244
|
-
def undefine(definition_name,undefine_options = {})
|
245
|
-
definition_dir=get_definition_paths[definition_name]
|
246
|
-
unless definition_dir.nil?
|
247
|
-
#TODO: Needs to be more defensive!!
|
248
|
-
logger.debug("[Undefine] About to remove '#{definition_dir} for '#{definition_name}'")
|
249
|
-
begin
|
250
|
-
FileUtils.rm_rf(definition_dir)
|
251
|
-
rescue Exception => ex
|
252
|
-
logger.fatal("Removing '#{definition_dir} for '#{definition_name}' failed")
|
253
|
-
exit -1
|
254
|
-
end
|
255
|
-
logger.debug("Removing '#{definition_dir} for '#{definition_name}' succesful")
|
256
|
-
else
|
257
|
-
logger.fatal("Definition '#{definition_name}' does not exist")
|
258
|
-
exit -1
|
259
|
-
end
|
260
|
-
end
|
261
|
-
|
262
|
-
|
263
99
|
#---------------------------------------------------------------
|
264
100
|
# Config Methods
|
265
101
|
#---------------------------------------------------------------
|
@@ -309,59 +145,59 @@ module Veewee
|
|
309
145
|
end
|
310
146
|
|
311
147
|
def load_config!
|
312
|
-
|
148
|
+
@config=Config.new({:env => self}).load_veewee_config()
|
313
149
|
|
314
|
-
|
150
|
+
return self
|
315
151
|
end
|
316
152
|
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
# Makes a call to the CLI with the given arguments as if they
|
325
|
-
# came from the real command line (sometimes they do!). An example:
|
326
|
-
#
|
327
|
-
# env.cli("package", "--veeweefile", "Veeweefie")
|
328
|
-
#
|
329
|
-
def cli(*args)
|
330
|
-
CLI.start(args.flatten, :env => self)
|
331
|
-
end
|
153
|
+
# Reloads the configuration of this environment.
|
154
|
+
def reload_config!
|
155
|
+
@config = nil
|
156
|
+
load_config!
|
157
|
+
self
|
158
|
+
end
|
332
159
|
|
333
|
-
|
334
|
-
|
335
|
-
|
160
|
+
# Makes a call to the CLI with the given arguments as if they
|
161
|
+
# came from the real command line (sometimes they do!). An example:
|
162
|
+
#
|
163
|
+
# env.cli("package", "--veeweefile", "Veeweefie")
|
164
|
+
#
|
165
|
+
def cli(*args)
|
166
|
+
CLI.start(args.flatten, :env => self)
|
167
|
+
end
|
336
168
|
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
#
|
341
|
-
# @return [Logger]
|
342
|
-
def logger
|
343
|
-
return @logger if @logger
|
169
|
+
def resource
|
170
|
+
"veewee"
|
171
|
+
end
|
344
172
|
|
345
|
-
|
173
|
+
# Accesses the logger for Veewee. This logger is a _detailed_
|
174
|
+
# logger which should be used to log internals only. For outward
|
175
|
+
# facing information, use {#ui}.
|
176
|
+
#
|
177
|
+
# @return [Logger]
|
178
|
+
def logger
|
179
|
+
return @logger if @logger
|
180
|
+
|
181
|
+
# Figure out where the output should go to.
|
182
|
+
output = nil
|
183
|
+
if ENV["VEEWEE_LOG"] == "STDOUT"
|
184
|
+
output = STDOUT
|
185
|
+
elsif ENV["VEEWEE_LOG"] == "NULL"
|
346
186
|
output = nil
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
elsif ENV["VEEWEE_LOG"]
|
352
|
-
output = ENV["VEEWEE_LOG"]
|
353
|
-
else
|
354
|
-
output = nil #log_path.join("#{Time.now.to_i}.log")
|
355
|
-
end
|
356
|
-
|
357
|
-
# Create the logger and custom formatter
|
358
|
-
@logger = ::Logger.new(output)
|
359
|
-
@logger.formatter = Proc.new do |severity, datetime, progname, msg|
|
360
|
-
"#{datetime} - #{progname} - [#{resource}] #{msg}\n"
|
361
|
-
end
|
362
|
-
|
363
|
-
@logger
|
187
|
+
elsif ENV["VEEWEE_LOG"]
|
188
|
+
output = ENV["VEEWEE_LOG"]
|
189
|
+
else
|
190
|
+
output = nil #log_path.join("#{Time.now.to_i}.log")
|
364
191
|
end
|
365
192
|
|
366
|
-
|
367
|
-
|
193
|
+
# Create the logger and custom formatter
|
194
|
+
@logger = ::Logger.new(output)
|
195
|
+
@logger.formatter = Proc.new do |severity, datetime, progname, msg|
|
196
|
+
"#{datetime} - #{progname} - [#{resource}] #{msg}\n"
|
197
|
+
end
|
198
|
+
|
199
|
+
@logger
|
200
|
+
end
|
201
|
+
|
202
|
+
end #Class
|
203
|
+
end #Module
|