Esempio n. 1
0
 /**
  * 
  */
 public function setUp()
 {
     $this->envPath = '/tmp/deploynaut_test/envs';
     Config::inst()->update('Injector', 'DNData', array('constructor' => array(0 => $this->envPath, 1 => '/tmp/deploynaut_test/gitkeys', 2 => Director::baseFolder() . '/assets/transfers')));
     parent::setUp();
     $this->project = new DNProject();
     $this->project->Name = 'testproject';
     $this->project->write();
     $this->env = new DNEnvironment();
     $this->env->Name = 'uat';
     $this->env->ProjectID = $this->project->ID;
     $this->env->write();
 }
Esempio n. 2
0
 /**
  * Used by the sync task
  *
  * @param string $path
  * @return \DNProject
  */
 public static function create_from_path($path)
 {
     $project = new DNProject();
     $project->Name = $path;
     $project->write();
     // add the administrators group as the viewers of the new project
     $adminGroup = Group::get()->filter('Code', 'administrators')->first();
     if ($adminGroup && $adminGroup->exists()) {
         $project->Viewers()->add($adminGroup);
     }
     return $project;
 }