Skip to content

Commit

Permalink
Quick and dirty way to get the workspace to be used as part of the jo…
Browse files Browse the repository at this point in the history
…b name
  • Loading branch information
eddiemoya committed Feb 9, 2015
1 parent bdb6e0e commit cdc95e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Jenkins.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public function getJob($jobName)
throw new RuntimeException('Error during json_decode');
}

return new Jenkins_Job($infos, $this);
return new Jenkins_Job($infos, $this, $jobName);
}

/**
Expand Down Expand Up @@ -456,7 +456,7 @@ public function getBuild($job, $buildId, $tree = 'actions[parameters,parameters[
return null;
}

return new Jenkins_Build($infos, $this);
return new Jenkins_Build($infos, $this, $job);
}

/**
Expand Down
13 changes: 10 additions & 3 deletions Jenkins/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@ class Jenkins_Job
*/
protected $jenkins;

/**
* @var string
*/
protected $jobName;


/**
* @param stdClass $job
* @param \Jenkins $jenkins
* @param string $jobName
*/
public function __construct($job, Jenkins $jenkins)
public function __construct($job, Jenkins $jenkins, $jobName)
{
$this->job = $job;

$this->jobName = $jobName;
$this->setJenkins($jenkins);
}

Expand Down Expand Up @@ -55,7 +62,7 @@ public function getJenkinsBuild($buildId)
*/
public function getName()
{
return $this->job->name;
return $this->jobName;
}

/**
Expand Down

0 comments on commit cdc95e0

Please sign in to comment.