Eileen has uploaded a new change for review. https://gerrit.wikimedia.org/r/252376
Change subject: Add script for compiling deployment repo ...................................................................... Add script for compiling deployment repo Bug: T1152925 Change-Id: I959faa1066121f372c1109a6f6e6e5aa70d4b7d1 --- M .gitignore A .gitmodules A drupal A packages A wmf/README.md A wmf/compile.sh A wmf/gitreview.conf 7 files changed, 111 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/civicrm-core refs/changes/76/252376/1 diff --git a/.gitignore b/.gitignore index 4bbd069..8ca32ea 100644 --- a/.gitignore +++ b/.gitignore @@ -142,10 +142,8 @@ authors.txt CRM/Batch/DAO/ CRM/Financial/DAO/ -drupal/ WordPress joomla -packages/ tests/output tests/phpunit/CiviTest/civicrm.settings.local.php tests/phpunit/CiviTest/truncate.xml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..9d068f0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "drupal"] + path = drupal + url = https://gerrit.wikimedia.org/r/wikimedia/fundraising/civicrm-drupal +[submodule "packages"] + path = packages + url = https://gerrit.wikimedia.org/r/wikimedia/fundraising/civicrm-packages diff --git a/drupal b/drupal new file mode 160000 index 0000000..86a74e7 --- /dev/null +++ b/drupal +Subproject commit 86a74e70eb9d53866e2c60476dc51858a9c21957 diff --git a/packages b/packages new file mode 160000 index 0000000..c0b53f0 --- /dev/null +++ b/packages +Subproject commit c0b53f091c2512282815b439c7e60812bce56e41 diff --git a/wmf/README.md b/wmf/README.md new file mode 100644 index 0000000..bd5da9e --- /dev/null +++ b/wmf/README.md @@ -0,0 +1,53 @@ +This explains the process for generating + +1) a functional local civicrm dev copy +2) a compiled version of civicrm + +==Background + +The CiviCRM code base is compiled from the following repos (at https://github.com/civicrm/) +- civicrm-core +- civicrm-drupal +- civicrm-packages +- civicrm-joomla (not required for wmf) +- civicrm-wordpress (not required for wmf) + +The compilation process combines the repos, generates the DAO files and some sql files and selectively includes +the files in the above repos. + +We want to be able to patch and build on the CiviCRM repos, but to have a compiled version that +we check in & use for deployment. + +==Get the WMF repos. +git clone origin https://gerrit.wikimedia.org/r/wikimedia/fundraising/civicrm-core --recursive + +==Compile the deploy version +run the compile.sh batch file - it will output the new version to a folder called civicrm at the same +level as the civicrm-core file by default. We could make this more flexible - e.g env var - having a reasonable set of defaults seemed + convenient but now that we are bailing early it might need ?. + +==Prepare a new point release +The expectation is that on each point release WMF changes (which include some Fuzion changes) will be rebased over +the new upstream tag - with any patches since upstreamed removed, and any conflicts tidied up. This would consist of +1) creating new branches for the new point release + +2) in the new branch do git pull --rebase upstream/xxx where upstream is the civicrm repo & xxx is the tag for the new release. +From a QA point of view this is not different to a merge commit but it allows us to continuously prune the patch-set and +not let conflict resolution to become cumulative. + +3) update the version in : +.gitreview +drupal/.gitreview +packages/.gitreview +wmf/gitreview.conf +wmf/compile.sh + + +NOTES + - the civicm-core directory needs to be in a clean git state with all changes committed or it will abort. A non-git folder is + treated as a clean folder. + - the compile.sh also generates the (ignored) DAO files - so after running this script the civicrm-core folder can be used in place of + the civicrm folder on your dev site - which may facilitate patching. + - unlike gitify and civibuild this script & the distmaker it calls do not require database access. + - refer to https://issues.civicrm.org/jira/browse/CRM-17435 for more discussion. + diff --git a/wmf/compile.sh b/wmf/compile.sh new file mode 100755 index 0000000..90c0180 --- /dev/null +++ b/wmf/compile.sh @@ -0,0 +1,46 @@ +THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; + +# http://stackoverflow.com/questions/2657935/checking-for-a-dirty-index-or-untracked-files-with-git +# Returns "*" if the current git branch is dirty. +function evil_git_dirty { + [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]] && echo 1 +} + +function check_git_for_directory { + CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; + cd $1; + + GIT_STATUS="$( evil_git_dirty )"; + + if [ $GIT_STATUS ]; then + echo "exiting to avoid overwriting git in dir $1"; + exit; + fi + cd $CUR_DIR; +} + + +DM_TARGETDIR="$THIS_DIR/../../civicrm" +DM_PACKAGESDIR="$THIS_DIR/../packages" +DM_DRUPALDIR="$THIS_DIR/../drupal" + +check_git_for_directory $THIS_DIR; +check_git_for_directory $DM_TARGETDIR; +check_git_for_directory $DM_PACKAGESDIR; +check_git_for_directory $DM_DRUPALDIR; + + +DM_VERSION=4.6.9 DM_DRUPALDIR="$DM_DRUPALDIR" DM_PACKAGESDIR="$DM_PACKAGESDIR" DM_TARGETDIR="$DM_TARGETDIR" $THIS_DIR/../distmaker/distmaker.sh d7_dir + +#Copy files deliberately excluded by the main script but desired by WMF. +cp "$THIS_DIR/gitreview.conf" "$DM_TARGETDIR/.gitreview" +cp "$THIS_DIR/../settings_location.php" "$DM_TARGETDIR/" +rm $DM_TARGETDIR/packages/.gitreview +rm $DM_TARGETDIR/drupal/.gitreview + +# The following 2 lines generate the DAO files in this folder so it can be used as a functional module for development. +cd $THIS_DIR/../xml +php GenCode.php + + + diff --git a/wmf/gitreview.conf b/wmf/gitreview.conf new file mode 100644 index 0000000..b7cc975 --- /dev/null +++ b/wmf/gitreview.conf @@ -0,0 +1,6 @@ +[gerrit] +host=gerrit.wikimedia.org +port=29418 +project=wikimedia/fundraising/crm/civicrm.git +defaultbranch=civi-4.6.9 +defaultrebase=0 -- To view, visit https://gerrit.wikimedia.org/r/252376 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I959faa1066121f372c1109a6f6e6e5aa70d4b7d1 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/civicrm-core Gerrit-Branch: master Gerrit-Owner: Eileen <emcnaugh...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits