CRM-19417 - distmaker - Generate report about git revisions
authorTim Otten <totten@civicrm.org>
Wed, 28 Sep 2016 00:42:59 +0000 (20:42 -0400)
committerTim Otten <totten@civicrm.org>
Wed, 28 Sep 2016 00:42:59 +0000 (20:42 -0400)
distmaker/distmaker.sh
distmaker/dists/common.sh
distmaker/dists/repo-report.sh [new file with mode: 0755]

index 7347213bb0c5dbba8a68aa0f81c68bb13159dd16..fca550e81223f710c1303f87a32cdf9b58af3b2c 100755 (executable)
@@ -43,6 +43,7 @@ J5PACK=0
 WP5PACK=0
 SK5PACK=0
 L10NPACK=0
+REPOREPORT=0
 
 # Display usage
 display_usage()
@@ -192,6 +193,12 @@ case $1 in
   WP5PACK=1
   ;;
 
+  # REPO REPORT PHP5
+  report)
+  echo; echo "Generating repo report module"; echo;
+  REPOREPORT=1
+  ;;
+
   # ALL
   all)
   echo; echo "Generating all the tarballs we've got (not the directories). "; echo;
@@ -202,6 +209,7 @@ case $1 in
   WP5PACK=1
   SKPACK=1
   L10NPACK=1
+  REPOREPORT=1
   ;;
 
   # USAGE
@@ -289,5 +297,10 @@ if [ "$WP5PACK" = 1 ]; then
   bash $P/dists/wordpress_php5.sh
 fi
 
+if [ "$REPOREPORT" = 1 ]; then
+  echo; echo "Preparing repository report"; echo;
+  bash $P/dists/repo-report.sh
+fi
+
 unset DM_SOURCEDIR DM_GENFILESDIR DM_TARGETDIR DM_TMPDIR DM_PHP DM_RSYNC DM_VERSION DM_ZIP
 echo;echo "DISTMAKER Done.";echo;
index b3096060cec14cb96fd9b297232ebfc4abcd5a05..2a81e49317c3fa48eca05f027434502569d046e0 100644 (file)
@@ -239,3 +239,15 @@ function dm_git_checkout() {
     git checkout "$2"
   popd
 }
+
+## usage: dm_repo_report <name> <path> <treeish>
+function dm_repo_report() {
+  local COMMIT
+  if [ -d "$2" ]; then
+    pushd "$2" >> /dev/null
+      COMMIT=$(git show "$3" | head -n1 | cut -f2 -d\  )
+    popd >> /dev/null
+  fi
+  [ -z "$COMMIT" ] && COMMIT=NONE
+  echo "$1 $3 $COMMIT"
+}
diff --git a/distmaker/dists/repo-report.sh b/distmaker/dists/repo-report.sh
new file mode 100755 (executable)
index 0000000..e8ee307
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+set -ex
+
+P=`dirname $0`
+CFFILE=$P/../distmaker.conf
+if [ ! -f $CFFILE ] ; then
+       echo "NO DISTMAKER.CONF FILE!"
+       exit 1
+else
+       . $CFFILE
+fi
+. "$P/common.sh"
+
+SRC=$DM_SOURCEDIR
+REPORT="$DM_TARGETDIR/civicrm-$DM_VERSION-repos.txt"
+
+echo '# <repo> <branch> <commit>' > "$REPORT"
+dm_repo_report "civicrm-core"          "$DM_SOURCEDIR"                 "$DM_REF_CORE"          >> $REPORT
+dm_repo_report "civicrm-backdrop@1.x"  "$DM_SOURCEDIR/backdrop"        "$DM_REF_BACKDROP"      >> $REPORT
+dm_repo_report "civicrm-drupal@6.x"    "$DM_SOURCEDIR/drupal"          "$DM_REF_DRUPAL6"       >> $REPORT
+dm_repo_report "civicrm-drupal@7.x"    "$DM_SOURCEDIR/drupal"          "$DM_REF_DRUPAL"        >> $REPORT
+#dm_repo_report "civicrm-drupal@8.x"   "$DM_SOURCEDIR/drupal"          "$DM_REF_DRUPAL8"       >> $REPORT
+dm_repo_report "civicrm-joomla"        "$DM_SOURCEDIR/joomla"          "$DM_REF_JOOMLA"        >> $REPORT
+dm_repo_report "civicrm-wordpress"     "$DM_SOURCEDIR/WordPress"       "$DM_REF_WORDPRESS"     >> $REPORT
+dm_repo_report "civicrm-packages"      "$DM_SOURCEDIR/packages"        "$DM_REF_PACKAGES"      >> $REPORT