9 if [ ! -f "$confdir/releaser.conf" ]; then
11 echo "Missing configuration file. Please copy $confdir/releaser.conf.txt to $confdir/releaser.conf and edit it."
14 source "$confdir/releaser.conf"
16 if [ -z "$version" -o -z "$start_point" ]; then
18 echo "Usage: $0 <start_point> <version>"
19 echo " <start_point> is a branch name (e.g. \"master\")"
20 echo " <version> is Civi release (e.g. \"4.3.beta2\"); it will become a tag name"
24 if [ "`echo -n $version | tr -d 0-9.`" = '' ]; then
32 #################################################
34 function do_git_config
() {
35 git config
--global user.name
"$git_author_name"
36 git config
--global user.email
"$git_author_email"
39 #################################################
40 ## Create build directories; checkout repos
41 function do_mk_project
() {
45 "$workdir/$version/export" \
46 "$workdir/$version/gen" \
47 "$workdir/$version/tarballs" \
48 "$workdir/$version/tmp"
50 if [ ! -d "$dir" ]; then
55 $cmd_gitify all
"$git_base_url" "$workdir/$version/export" --l10n
58 #################################################
60 function do_git_tag
() {
62 for dir
in export export
/joomla export
/WordPress export
/packages
; do
64 git checkout
"$start_point"
69 for drupal_ver
in 6.x
7.x
; do
71 git checkout
"${drupal_ver}-${start_point}"
72 git tag
"${drupal_ver}-${version}"
77 #################################################
78 ## Publish tags via git
79 function do_git_tag_push
() {
81 for dir
in export export
/joomla export
/WordPress export
/packages
; do
83 git push
-f origin
"$version"
87 for drupal_ver
in 6.x
7.x
; do
89 git push
-f origin
"${drupal_ver}-${version}"
94 #################################################
96 function do_distmaker
() {
99 ## Determine SCM revision of main codebase
101 rev=$
(git rev-parse HEAD |
head -c10)
104 # create the distmaker.conf file
106 DM_SOURCEDIR=$workdir/$version/export
107 DM_GENFILESDIR=$workdir/$version/gen
108 DM_TMPDIR=$workdir/$version/tmp
109 DM_TARGETDIR=$workdir/$version/tarballs
115 " > $workdir/$version/export
/distmaker
/distmaker.conf
117 # create a minimal civicrm.settings.php file
118 mkdir
-p $workdir/$version/export
/default
119 echo "<?php define('CIVICRM_GETTEXT_RESOURCEDIR', '$workdir/$version/export/l10n/'); define('CIVICRM_UF', 'Drupal'); global \$civicrm_root; \$civicrm_root = '$workdir/$version/export'; ?>" > $workdir/$version/export
/default
/civicrm.settings.php
121 # create a minimal settings_location.php file
122 echo "<?php define('CIVICRM_CONFDIR', '$workdir/$version/export'); ?>" > $workdir/$version/export
/settings_location.php
124 # run the exported distmaker
125 cd $workdir/$version/export
/distmaker
126 .
/distmaker.sh
$distmaker_tgt > $workdir/$version/build.log
129 #################################################
131 function do_publish
() {
133 cd $workdir/$version/tarballs
135 $cmd_md5sum *.
tar.gz
*.tgz
*.
zip > civicrm-
$version.MD5SUMS
136 echo $gpg_pass |
$cmd_gpg --armor --batch --passphrase-fd 0 --sign civicrm-
$version.MD5SUMS
138 if [ "$is_stable" ]; then
139 echo mkdir
${publish_stable_dir}/$version |
$cmd_sftp ${publish_ssh}
140 $cmd_rsync -aP --exclude='*starterkit.tgz' *.
tar.gz
*.
zip *MD5SUMS
* ${publish_ssh}:${publish_stable_dir}/$version
142 echo mkdir
${publish_latest_dir}/$version |
$cmd_sftp ${publish_ssh}
143 $cmd_rsync -aP --exclude='*starterkit.tgz' *.
tar.gz
*.
zip *MD5SUMS
* ${publish_ssh}:${publish_latest_dir}/$version
146 mv *.
tar.gz
*.tgz
*.
zip *MD5SUMS
* $build_dest
148 # publish to latest.civicrm.org
149 # FIXME: isn't this racy when doing concurrent security releases
150 if [ "$is_stable" ]; then
151 echo $version > $latest/stable.txt
153 echo $version > $latest/latest.txt
156 #################################################
158 function do_cleanup
() {
160 rm -rf export gen tmp tarballs tmp
163 #################################################
166 ## Refactoring note: this used to be one monolithic script