Exemple #1
0
 /**
  * @param Builder $builder
  *
  * @return void
  */
 protected function extendSvnCommandFromConfig(Builder $builder)
 {
     $cmd = $this->svnCommand;
     $svn = $builder->getConfig('svn');
     if ($svn) {
         foreach ($svn as $key => $value) {
             $cmd .= " --{$key} {$value} ";
         }
     }
     $depth = $builder->getConfig('clone_depth');
     if (!is_null($depth)) {
         $cmd .= ' --depth ' . intval($depth) . ' ';
     }
     $this->svnCommand = $cmd;
 }
 public function __construct(Builder $phpci, Build $build, array $options = array())
 {
     $this->phpci = $phpci;
     $this->build = $build;
     $buildSettings = $phpci->getConfig('build_settings');
     if (isset($buildSettings['redmine'])) {
         $redmine = $buildSettings['redmine'];
         $this->server = $redmine['server'];
         $this->apiKey = $redmine['api_key'];
     }
     if (isset($options['enabled'])) {
         $this->enabled = $options['enabled'];
     }
     if (isset($options['status'])) {
         $this->status = $options['status'];
     }
     if (isset($options['prev_status'])) {
         $this->prevStatus = $options['prev_status'];
     }
     if (isset($options['percent'])) {
         $this->percent = $options['percent'];
     }
     if (isset($options['lang'])) {
         $this->lang = $options['lang'];
     }
     if (isset($options['issue_regexp'])) {
         $this->issueRegexp = $options['issue_regexp'];
     }
     $parser = new YamlParser();
     $config = (array) $parser->parse(file_get_contents(__DIR__ . '/messages.yml'));
     $this->messages = $config[$this->lang];
 }
Exemple #3
0
 /**
  * Use an SSH-based git clone.
  */
 protected function cloneBySsh(Builder $builder, $cloneTo)
 {
     $keyFile = $this->writeSshKey($cloneTo);
     if (!IS_WIN) {
         $gitSshWrapper = $this->writeSshWrapper($cloneTo, $keyFile);
     }
     // Do the git clone:
     $cmd = 'git clone --recursive ';
     $depth = $builder->getConfig('clone_depth');
     if (!is_null($depth)) {
         $cmd .= ' --depth ' . intval($depth) . ' ';
     }
     $cmd .= ' -b %s %s "%s"';
     if (!IS_WIN) {
         $cmd = 'export GIT_SSH="' . $gitSshWrapper . '" && ' . $cmd;
     }
     $success = $builder->executeCommand($cmd, $this->getBranch(), $this->getCloneUrl(), $cloneTo);
     if ($success) {
         $success = $this->postCloneSetup($builder, $cloneTo);
     }
     // Remove the key file and git wrapper:
     unlink($keyFile);
     if (!IS_WIN) {
         unlink($gitSshWrapper);
     }
     return $success;
 }
Exemple #4
0
 /**
  * @param Builder $phpci
  * @param Build   $build
  * @param array   $options
  */
 public function __construct(Builder $phpci, Build $build, array $options = array())
 {
     $this->phpci = $phpci;
     $this->build = $build;
     $this->queries = $options;
     $buildSettings = $phpci->getConfig('build_settings');
     if (isset($buildSettings['sqlite'])) {
         $sql = $buildSettings['sqlite'];
         $this->path = $sql['path'];
     }
 }
Exemple #5
0
 /**
  * @param Builder $phpci
  * @param Build   $build
  * @param array   $options
  */
 public function __construct(Builder $phpci, Build $build, array $options = array())
 {
     $this->phpci = $phpci;
     $this->build = $build;
     $this->queries = $options;
     $buildSettings = $phpci->getConfig('build_settings');
     if (isset($buildSettings['pgsql'])) {
         $sql = $buildSettings['pgsql'];
         $this->host = $sql['host'];
         $this->user = $sql['user'];
         $this->pass = $sql['pass'];
     }
 }
Exemple #6
0
 /**
  * Standard Constructor
  *
  * $options['directory'] Output Directory. Default: %BUILDPATH%
  * $options['filename']  Phar Filename. Default: build.phar
  * $options['regexp']    Regular Expression Filename Capture. Default: /\.php$/
  * $options['stub']      Stub Content. No Default Value
  *
  * @param Builder $phpci
  * @param Build   $build
  * @param array   $options
  */
 public function __construct(Builder $phpci, Build $build, array $options = array())
 {
     $this->phpci = $phpci;
     $this->build = $build;
     $this->message = $options['message'];
     $buildSettings = $phpci->getConfig('build_settings');
     if (isset($buildSettings['irc'])) {
         $irc = $buildSettings['irc'];
         $this->server = $irc['server'];
         $this->port = $irc['port'];
         $this->room = $irc['room'];
         $this->nick = $irc['nick'];
     }
 }
Exemple #7
0
 /**
  * Use an SSH-based git clone.
  */
 protected function cloneBySsh(Builder $builder, $cloneTo)
 {
     // Do the git clone:
     $cmd = 'git clone ';
     $depth = $builder->getConfig('clone_depth');
     if (!is_null($depth)) {
         $cmd .= ' --depth ' . intval($depth) . ' ';
     }
     $cmd .= ' -b %s %s "%s"';
     $success = $builder->executeCommand($cmd, $this->getBranch(), $this->getCloneUrl(), $cloneTo);
     if ($success) {
         $success = $this->postCloneSetup($builder, $cloneTo);
     }
     return $success;
 }
Exemple #8
0
 /**
  * Set up the plugin, configure options, etc.
  * @param Builder $phpci
  * @param Build $build
  * @param array $options
  * @throws \Exception
  */
 public function __construct(Builder $phpci, Build $build, array $options = array())
 {
     $this->phpci = $phpci;
     $this->build = $build;
     $this->message = $options['message'];
     $this->userAgent = "PHPCI/1.0 (+http://www.phptesting.org/)";
     $this->cookie = "phpcicookie";
     $buildSettings = $phpci->getConfig('build_settings');
     if (isset($buildSettings['campfire'])) {
         $campfire = $buildSettings['campfire'];
         $this->url = $campfire['url'];
         $this->authToken = $campfire['authToken'];
         $this->roomId = $campfire['roomId'];
     } else {
         throw new \Exception(Lang::get('no_campfire_settings'));
     }
 }
Exemple #9
0
 /**
  * @param Builder $phpci
  * @param Build   $build
  * @param array   $options
  */
 public function __construct(Builder $phpci, Build $build, array $options = array())
 {
     $this->phpci = $phpci;
     $this->build = $build;
     $this->queries = $options;
     $config = \b8\Database::getConnection('write')->getDetails();
     $this->host = defined('PHPCI_DB_HOST') ? PHPCI_DB_HOST : null;
     $this->user = $config['user'];
     $this->pass = $config['pass'];
     $buildSettings = $phpci->getConfig('build_settings');
     if (!isset($buildSettings['mysql'])) {
         return;
     }
     if (!empty($buildSettings['mysql']['host'])) {
         $this->host = $this->phpci->interpolate($buildSettings['mysql']['host']);
     }
     if (!empty($buildSettings['mysql']['user'])) {
         $this->user = $this->phpci->interpolate($buildSettings['mysql']['user']);
     }
     if (array_key_exists('pass', $buildSettings['mysql'])) {
         $this->pass = $buildSettings['mysql']['pass'];
     }
 }