Beispiel #1
0
 /**
  * @param array $config
  * @return VagrantfileRenderer
  */
 private function getVagrantfile(array $config)
 {
     $boxName = $config['vm']['base_box'];
     $box = $this->getBox($boxName);
     $vagrantfile = new VagrantfileRenderer();
     $vagrantfile->setTemplate('vagrant_local.twig');
     $vagrantfile->setName($config['vm']['hostname']);
     $vagrantfile->setBoxName($box['cloud']);
     $vagrantfile->setMemory($config['vm']['memory']);
     $vagrantfile->setIpAddress($config['vm']['ip']);
     $vagrantfile->setSyncedFolder($config['vm']['sharedfolder']);
     $vagrantfile->setSyncedType($config['vm']['syncType']);
     // Add box url when NOT using the vagrant cloud
     if (!isset($config['vm']['useVagrantCloud'])) {
         $vagrantfile->setBoxUrl($box['url']);
     }
     return $vagrantfile;
 }
Beispiel #2
0
 /**
  * @param array $requestVars
  * @return VagrantfileRenderer
  */
 public function getVagrantfile(array $requestVars)
 {
     $config = $requestVars[$this->getSlug()];
     $boxName = $config['vm']['base_box'];
     $box = $this->getBox($boxName);
     if (!isset($config['vm']['enableWindows'])) {
         $config['vm']['enableWindows'] = false;
     }
     $vagrantfile = new VagrantfileRenderer();
     $vagrantfile->setTemplate('vagrant_local.twig');
     $vagrantfile->setName($config['vm']['hostname']);
     $vagrantfile->setBoxName($box['cloud']);
     $vagrantfile->setMemory($config['vm']['memory']);
     $vagrantfile->setIpAddress($config['vm']['ip']);
     $vagrantfile->setSyncedFolder($config['vm']['sharedfolder']);
     $vagrantfile->setEnableWindows($config['vm']['enableWindows']);
     $vagrantfile->setSyncedType($config['vm']['syncType']);
     // Add box url when NOT using the vagrant cloud
     if (!isset($config['vm']['useVagrantCloud'])) {
         $vagrantfile->setBoxUrl($box['url']);
     }
     return $vagrantfile;
 }