Joli\JoliCi\Vacuum::getJobs PHP Method

getJobs() protected method

Get all jobs related to a project
protected getJobs ( string $projectPath ) : Joli\JoliCi\Job[]
$projectPath string Directory where the project is
return Joli\JoliCi\Job[]
    protected function getJobs($projectPath)
    {
        $jobs = array();
        $project = $this->naming->getProjectName($projectPath);
        $repositoryRegex = sprintf('#^%s_([a-z]+?)/%s:\\d+-\\d+$#', Job::BASE_NAME, $project);
        foreach ($this->docker->getImageManager()->findAll() as $image) {
            foreach ($image->getRepoTags() as $name) {
                if (preg_match($repositoryRegex, $name, $matches)) {
                    $jobs[] = $this->getJobFromImage($image, $name, $matches[1], $project);
                }
            }
        }
        return $jobs;
    }