예제 #1
0
 private function setExtraEnvironmentVariables()
 {
     if (!empty($this->view->variables['existingEnv'])) {
         $this->log('info', "Existing .yml file found, ignoring global variables specified on command line.");
         return;
     }
     $extraVars = array();
     $artifactsPass = @$this->options['artifacts-pass'];
     if (!empty($artifactsPass)) {
         $extraVars[] = $this->travisEncrypt("ARTIFACTS_PASS="******"GITHUB_USER_TOKEN=" . $githubToken);
     }
     $this->view->setExtraGlobalEnvVars($extraVars);
 }
예제 #2
0
 public function testViewGeneratesCorrectLookingYAMLForCore()
 {
     $view = new TravisYmlView();
     $view->setGenerationMode('core');
     // no setPlugin call here signifies generating for core
     $parser = new Parser();
     $existingSections = $parser->processExistingTravisYml(__DIR__ . '/../resources/test.travis.yml');
     $view->setExistingSections($existingSections);
     $view->setExtraGlobalEnvVars(array('secure: artifactspass', 'secure: githubtoken'));
     $view->setGenerateYmlCommand('./console generate:travis-yml \'arg1\' arg2');
     $output = $view->render();
     $yaml = Spyc::YAMLLoadString($output);
     $this->assertNotEmpty($yaml['env']);
     $this->assertNotEmpty($yaml['env']['global']);
     $this->assertBuildSectionsNotEmpty($yaml);
     $this->assertViewDoesNotUsePluginSpecifiedTravisCommands($yaml);
     $this->assertViewDoesNotUsePluginSpecifiedAptPackages($yaml);
 }