Example #1
0
 public function process(BuildInterface $build)
 {
     foreach ($this->results as $result) {
         $build->info($result);
         if ($result->getStatus() == Result::CHANGED) {
             $build->setStatus(BuildInterface::PASSED);
             break;
         } else {
             if ($result->getStatus() === Result::STOPPED) {
                 $build->setStatus(BuildInterface::STOPPED);
             } else {
                 if ($result->getStatus() === Result::FAILED) {
                     $build->setStatus(BuildInterface::FAILED);
                 } else {
                     if ($result->getStatus() === Result::ERROR) {
                         $build->setStatus(BuildInterface::STOPPED);
                         break;
                     } else {
                         $build->setStatus(BuildInterface::STOPPED);
                     }
                 }
             }
         }
         return;
     }
 }
Example #2
0
 /**
  * Check if this modification set has been modified
  *
  * @param BuildInterface $build The running build.
  * @return Xinc::Core::Plugin::ModificationSet::Result The result of the check.
  */
 public function checkModified(BuildInterface $build)
 {
     $result = new Result();
     $result->setSource(get_class($this));
     try {
         $this->initSvn();
         $strRemoteVersion = $this->getRemoteVersion();
         $strLocalVersion = $this->getLocalVersion();
     } catch (\VersionControl_SVN_Exception $e) {
         $build->error('Test of Subversion failed: ' . $e->getMessage());
         $build->setStatus(BuildInterface::FAILED);
         $result->setStatus(Result::ERROR);
         return $result;
     }
     $result->setRemoteRevision($strRemoteVersion);
     $result->setLocalRevision($strLocalVersion);
     if ($strRemoteVersion !== $strLocalVersion) {
         try {
             $this->getModifiedFiles($result);
             $this->getChangeLog($result);
             if ($this->doUpdate()) {
                 $this->update($result);
             }
             $result->setStatus(Result::CHANGED);
         } catch (Exception $e) {
             $build->error('Processing SVN failed: ' . $e->getMessage());
             $result->setStatus(Result::FAILED);
         }
     }
     return $result;
 }
Example #3
0
 public function process(BuildInterface $build)
 {
     if ($this->_if !== null) {
         /*
          * If we have a condition, we need to check
          */
         $property = $build->getProperty($this->_if);
         if ($property !== true) {
             $build->info('Property: ' . $this->_name . ' does not apply, ' . $this->_if . ' == false');
             $build->setStatus(BuildInterface::PASSED);
             return;
         }
     }
     if (isset($this->_file)) {
         if (file_exists($this->_file)) {
             $build->info('Reading property file: ' . $this->_file);
             $this->_plugin->parsePropertyFile($build, $this->_file);
         } elseif (strstr($this->_file, '${')) {
             // not substituted yet, will not use it
         } else {
             $build->error('Cannot read property file: ' . $this->_file);
         }
     } else {
         $build->debug('Setting property "${' . $this->_name . '}" to "' . $this->_value . '"');
         $build->getProperties()->set($this->_name, $this->_value);
         $build->setStatus(BuildInterface::PASSED);
     }
 }