4 * Make a small report about the git content in a given folder+branch.
6 * @param string $branch
11 function repo($path, $branch) {
12 $escPath = escapeshellarg($path);
13 $escBranch = escapeshellarg($branch);
14 $commit = file_exists($path) ?
trim(`cd
$escPath ; git show
$escBranch | head
-n1 | cut
-f2
-d\ `
) : NULL;
15 if (!empty($commit)) {
26 $DM_SOURCEDIR = getenv('DM_SOURCEDIR');
27 $DM_VERSION = getenv('DM_VERSION');
29 'version' => $DM_VERSION,
31 'pretty' => date('r'),
36 'civicrm-backdrop@1.x' => repo("$DM_SOURCEDIR/backdrop", getenv('DM_REF_BACKDROP')),
37 'civicrm-core' => repo("$DM_SOURCEDIR", getenv('DM_REF_CORE')),
38 'civicrm-drupal@6.x' => repo("$DM_SOURCEDIR/drupal", getenv('DM_REF_DRUPAL6')),
39 'civicrm-drupal@7.x' => repo("$DM_SOURCEDIR/drupal", getenv('DM_REF_DRUPAL')),
40 //'civicrm-drupal@8.x' => repo("$DM_SOURCEDIR/drupal", getenv('DM_REF_DRUPAL8')),
41 'civicrm-joomla' => repo("$DM_SOURCEDIR/joomla", getenv('DM_REF_JOOMLA')),
42 'civicrm-packages' => repo("$DM_SOURCEDIR/packages", getenv('DM_REF_PACKAGES')),
43 'civicrm-wordpress' => repo("$DM_SOURCEDIR/WordPress", getenv('DM_REF_WORDPRESS')),
47 if (getenv('BPACK')) {
48 $data['tar']['Backdrop'] = "civicrm-$DM_VERSION-backdrop-unstable.tar.gz";
50 if (getenv('J5PACK')) {
51 $data['tar']['Joomla'] = "civicrm-$DM_VERSION-joomla.zip";
53 if (getenv('D56PACK')) {
54 $data['tar']['Drupal6'] = "civicrm-$DM_VERSION-drupal6.tar.gz";
56 if (getenv('D5PACK')) {
57 $data['tar']['Drupal'] = "civicrm-$DM_VERSION-drupal.tar.gz";
59 if (getenv('WPPACK')) {
60 $data['tar']['WordPress'] = "civicrm-$DM_VERSION-wordpress.zip";
62 if (getenv('L10NPACK')) {
63 $data['tar']['L10n'] = "civicrm-$DM_VERSION-l10n.tar.gz";
69 $data['rev'] = $DM_VERSION . '-' . md5(json_encode($data));
70 echo json_encode($data);