-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit.php
More file actions
26 lines (22 loc) · 752 Bytes
/
git.php
File metadata and controls
26 lines (22 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
/**
* @file
* Git auto deploy for dev.drupal.breaktech.org.
*/
require 'vendor/autoload.php';
use BtDeploy\BtDeploy;
use BtDeploy\BtGitFactory;
use BtDeploy\BtMailerFactory;
$repos = BtDeploy::parseConfig('repos');
foreach ($repos as $repo => $config) {
$git_config = array_key_exists('git', $config) ? $config['git'] : [];
$btGit = BtGitFactory::create($git_config);
if ($btGit) {
$output = $btGit->run();
if (!empty($output) && $output != "Already up-to-date.") {
$mail_config = array_key_exists('mailer', $config) ? $config['mailer'] : [];
$mailer = BtMailerFactory::create($mail_config);
$mailer->mail($output, "$repo on dev.drupal has been updated.");
}
}
}