Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed whole bunch of bugs and refactored configuration for more flexi…

…bility
  • Loading branch information...
commit b4eb5965c6b955bea13f0e562c69295584987033 1 parent 9459792
@inadarei authored
View
23 build
@@ -49,16 +49,12 @@ if [ -f "$ap/config.info" ]; then
source "$ap/config.info"
fi
-if [ -z $releasefolder ] || [ -z $headfolder ] || [ -z $sitesfolder ]; then
+if [ -z $trunk_location ] || [ -z $releases_location ] || [ -z $sites_location ]; then
echo "Configuration file missing or not properly filled-out. Please fix."
echo "Aborting..."
exit
fi
-headfolder=$trunk_location
-releasefolder=${releases_location}/platform/$timestamp
-sitesfolder=${releases_location}/projroot/releases/websites
-
echo -n "SVN username? [default: $username]: "
read username2
@@ -66,12 +62,21 @@ if [[ "$username2" =~ ".*?[a-zA-Z0-9]+.*" ]] ; then
username=$username2
fi
+echo -n "SVN password? "
+stty -echo
+read password
+stty echo
+echo ""
+
+
#-- make sure the username has permissions/exists
#-- We are using a little trick here, running svn uri check on path we know exists, so the only way it would not work
#-- if authentication is botched.
-if [ ! "`$ap/dm-build-svn-uri-check -u $username -p \"$headfolder\"`" = "exists" ]; then
- echo "The username you indicated [$username] does not seem to have permissions on the repo [$headfolder]"
+auth="--username $username --password $password --non-interactive --no-auth-cache --trust-server-cert"
+
+if [ ! "`$ap/dm-build-svn-uri-check -u "$auth" -p $trunk_location`" = "exists" ]; then
+ echo "The username you indicated [$username] does not seem to have permissions on the repo [$trunk_location]"
echo "Aborting..."
exit
fi
@@ -82,10 +87,10 @@ fi
case "$op" in
'platform')
- $ap/dm-build-platform -t "$timestamp" -u "$username" -r "$releasefolder" -s "$sitesfolder" -h "$headfolder"
+ $ap/dm-build-platform -t "$timestamp" -c "$core_symlink_name" -u "$auth" -r "$releases_location" -s "$sites_location" -h "$trunk_location"
;;
'site')
- $ap/dm-build-site -t "$timestamp" -u "$username" -d "$sitedomain" -s "$sitesfolder" -h "$headfolder"
+ $ap/dm-build-site -t "$timestamp" -u "$auth" -d "$sitedomain" -r "$releases_location" -s "$sites_location" -h "$trunk_location"
;;
esac
View
6 config.info.default
@@ -1,2 +1,4 @@
-releases_location=svn://svn.example.com/projroot/releases
-trunk_location=svn://svn.example.com/projroot/trunk
+releases_location=https://svn.example.com/projname/releases
+trunk_location=https://svn.example.com/projname/trunk
+core_symlink_name=docroot
+sites_location=https://svn.example.com/projname/trunk/sites
View
65 dm-build-platform
@@ -1,65 +1,70 @@
#!/bin/sh
-unamestr=`uname`
-if [[ "$unamestr" == 'Linux' ]]; then
- script=`readlink -f $0`;
- ap=`dirname $script`;
-elif [[ "$unamestr" == 'Darwin' ]]; then
- ap=$(dirname $0);
-fi
+script=`readlink -f $0`;
+ap=`dirname $script`;
-while getopts "t:u:r:s:h:" opt; do
+while getopts "c:t:u:r:s:h:" opt; do
case $opt in
+ c) core_symlink_name=$OPTARG;;
t) timestamp=$OPTARG;;
- u) username=$OPTARG;;
- r) releasefolder=$OPTARG;;
- s) sitesfolder=$OPTARG;;
- h) headfolder=$OPTARG;;
+ u) auth=$OPTARG;;
+ r) releases_location=$OPTARG;;
+ s) sites_location=$OPTARG;;
+ h) trunk_location=$OPTARG;;
esac
done
-if [ -z $username ] || [ -z $timestamp ] || [ -z $releasefolder ] || [ -z $sitesfolder ] || [ -z $headfolder ]; then
+if [ -z $core_symlink_name ] || [ -z "$auth" ] || [ -z $timestamp ] || [ -z $releases_location ] || [ -z $sites_location ] || [ -z $trunk_location ]; then
echo "Invalid list of parameters for $0. Aborting..."
exit
fi
-tag_prefix="releases/platform/lf-"
+releasefolder=${releases_location}/platform/$timestamp
+dst_sitesfolder=$releases_location/websites
+tag_prefix="releases/platform/"
echo "START: releasing platform under ${tag_prefix}${timestamp}"
releasemsg="creating release $timestamp"
-svn mkdir --username "$username" -m "$releasemsg" $releasefolder > /dev/null 2>&1
-svn cp --username "$username" -m "$releasemsg" $headfolder/pressflow $releasefolder/pressflow > /dev/null 2>&1
-svn cp --username "$username" -m "$releasemsg" $headfolder/docroot $releasefolder/docroot > /dev/null 2>&1
+# figure-out the name of the current core folder
+rm -rf work
+svn co $auth -N $trunk_location work > /dev/null 2>&1
+drupal_core_folder=$(readlink work/$core_symlink_name)
+rm -rf work
+
+
+svn mkdir $auth -m "$releasemsg" $releasefolder > /dev/null 2>&1
+
+svn cp $auth -m "$releasemsg" $trunk_location/${drupal_core_folder} $releasefolder/${drupal_core_folder} > /dev/null 2>&1
+svn cp $auth -m "$releasemsg" $trunk_location/${core_symlink_name} $releasefolder/${core_symlink_name} > /dev/null 2>&1
+
+svn mkdir $auth -m "$releasemsg" $releasefolder/sites > /dev/null 2>&1
-svn mkdir --username "$username" -m "$releasemsg" $releasefolder/sites > /dev/null 2>&1
rm -rf work
-svn co --username "$username" $releasefolder/sites work > /dev/null 2>&1
+svn co $auth $releasefolder/sites work > /dev/null 2>&1
cd work
-svnlist=(`svn --username "$username" list $sitesfolder`)
+svnlist=(`svn $auth list $dst_sitesfolder`)
externals=""
for sitename in ${svnlist[@]}; do
- if [ "`$ap/dm-build-svn-uri-check -u $username -p \"$sitesfolder/${sitename}live\"`" = "exists" ]; then
- externals=$(echo -e "$externals \n ${sitename%/} $sitesfolder/${sitename}live")
+ if [ "`$ap/dm-build-svn-uri-check -u "$auth" -p \"$dst_sitesfolder/${sitename}live\"`" = "exists" ]; then
+ externals=$(echo -e "$externals \n ${sitename%/} $dst_sitesfolder/${sitename}live")
else
- echo "ERROR: $sitesfolder/${sitename}live IS MISSING, yet ${sitename%/} is present in $sitesfolder!"
+ echo "ERROR: $dst_sitesfolder/${sitename}live IS MISSING, yet ${sitename%/} is present in $dst_sitesfolder!"
echo "Looks like a broken site release. Please fix, your platform release will proceed, but may be corrupt."
fi
done
-#echo "$externals"
-
-svn propset --username "$username" svn:externals "$externals" . > /dev/null
-svn update --username "$username" > /dev/null 2>&1
-svn commit --username "$username" -m "externals created. $releasemsg" . > /dev/null 2>&1
+svn propset $auth svn:externals "$externals" . > /dev/null
+svn update $auth > /dev/null 2>&1
+svn commit $auth -m "externals created. $releasemsg" . > /dev/null 2>&1
cd ..
rm -rf work
-svn cp --username "$username" -m "$releasemsg" $headfolder/sites/all $releasefolder/sites/all > /dev/null 2>&1
-svn cp --username "$username" -m "$releasemsg" $headfolder/sites/default $releasefolder/sites/default > /dev/null 2>&1
+svn cp $auth -m "$releasemsg" $sites_location/all $releasefolder/sites/all > /dev/null 2>&1
+svn cp $auth -m "$releasemsg" $sites_location/default $releasefolder/sites/default > /dev/null 2>&1
echo "completed..."
exit
View
41 dm-build-site
@@ -1,23 +1,19 @@
#!/bin/sh
-unamestr=`uname`
-if [[ "$unamestr" == 'Linux' ]]; then
- script=`readlink -f $0`;
- ap=`dirname $script`;
-elif [[ "$unamestr" == 'Darwin' ]]; then
- ap=$(dirname $0);
-fi
+script=`readlink -f $0`;
+ap=`dirname $script`;
-while getopts "t:u:d:s:h:" opt; do
+while getopts "d:t:u:r:s:h:" opt; do
case $opt in
- t) timestamp=$OPTARG;;
- u) username=$OPTARG;;
d) sitedomain=$OPTARG;;
- s) sitesfolder=$OPTARG;;
- h) headfolder=$OPTARG;;
+ t) timestamp=$OPTARG;;
+ u) auth=$OPTARG;;
+ r) releases_location=$OPTARG;;
+ s) sites_location=$OPTARG;;
+ h) trunk_location=$OPTARG;;
esac
done
-if [ -z $username ] || [ -z $timestamp ] || [ -z $sitedomain ] || [ -z $sitesfolder ] || [ -z $headfolder ]; then
+if [ -z $sitedomain ] || [ -z "$auth" ] || [ -z $timestamp ] || [ -z $releases_location ] || [ -z $sites_location ] || [ -z $trunk_location ]; then
echo "Invalid list of parameters for $0. Aborting..."
exit
fi
@@ -25,16 +21,17 @@ fi
echo "START: releasing $sitedomain snapshot from Head as $timestamp"
releasemsg="releasing $sitedomain site"
+dst_sitesfolder=$releases_location/websites
-if [ ! "`$ap/dm-build-svn-uri-check -u $username -p \"$headfolder/sites/$sitedomain\"`" = "exists" ]; then
- echo "Unknown site! $headfolder/sites/$sitedomain does not exist!"
+if [ ! "`$ap/dm-build-svn-uri-check -u "$auth" -p \"$sites_location/$sitedomain\"`" = "exists" ]; then
+ echo "Unknown site! $sites_location/$sitedomain does not exist!"
echo "Aborting"
exit
fi
-if [ ! "`$ap/dm-build-svn-uri-check -u $username -p \"$sitesfolder/$sitedomain\"`" = "exists" ]; then
- echo "WARNING: $sitesfolder/$sitedomain does not exist!"
+if [ ! "`$ap/dm-build-svn-uri-check -u "$auth" -p \"$dst_sitesfolder/$sitedomain\"`" = "exists" ]; then
+ echo "WARNING: $dst_sitesfolder/$sitedomain does not exist!"
echo -n "This means this site has never been released before. Do you want to initialize and proceed? ( y/n ): "
read answer
if [ "$answer" = "n" ] || [ "$answer" = "N" ]
@@ -42,19 +39,19 @@ if [ ! "`$ap/dm-build-svn-uri-check -u $username -p \"$sitesfolder/$sitedomain\"
echo "Aborting"
exit
else
- svn mkdir --username "$username" -m "$releasemsg" $sitesfolder/$sitedomain > /dev/null 2>&1
+ svn mkdir $auth -m "$releasemsg" $dst_sitesfolder/$sitedomain > /dev/null 2>&1
echo "IMPORTANT: You need to release new platform version for the new site to get picked up!!!"
fi
fi
-svn cp --username "$username" -m "$releasemsg" $headfolder/sites/$sitedomain $sitesfolder/$sitedomain/$timestamp > /dev/null 2>&1
+svn cp $auth -m "$releasemsg" $sites_location/$sitedomain $dst_sitesfolder/$sitedomain/$timestamp > /dev/null 2>&1
-if [ "`$ap/dm-build-svn-uri-check -u $username -p \"$sitesfolder/$sitedomain/live\"`" = "exists" ]; then
- svn rm --username "$username" -m "$releasemsg" $sitesfolder/$sitedomain/live > /dev/null 2>&1
+if [ "`$ap/dm-build-svn-uri-check -u "$auth" -p \"$dst_sitesfolder/$sitedomain/live\"`" = "exists" ]; then
+ svn rm $auth -m "$releasemsg" $dst_sitesfolder/$sitedomain/live > /dev/null 2>&1
fi
-svn cp --username "$username" -m "$releasemsg" $sitesfolder/$sitedomain/$timestamp $sitesfolder/$sitedomain/live > /dev/null 2>&1
+svn cp $auth -m "$releasemsg" $dst_sitesfolder/$sitedomain/$timestamp $dst_sitesfolder/$sitedomain/live > /dev/null 2>&1
echo "completed..."
exit
View
6 dm-build-svn-uri-check
@@ -2,16 +2,16 @@
while getopts "u:p:" opt; do
case $opt in
- u) username=$OPTARG;;
+ u) auth=$OPTARG;;
p) svn_path=$OPTARG;;
esac
done
-if [ -z $username ] || [ -z $svn_path ]; then
+if [ -z "$auth" ] || [ -z "$svn_path" ]; then
exit
fi
-svn_info=`svn info --username $username --xml $svn_path 2> /dev/null`
+svn_info=`svn info $auth --xml $svn_path 2> /dev/null `
if [[ "$svn_info" =~ ".*?<uuid>.*" ]]; then
echo "exists"
Please sign in to comment.
Something went wrong with that request. Please try again.