mirror of
https://github.com/silverstripe/doc.silverstripe.org
synced 2024-10-22 15:05:50 +00:00
FIX: DRY update for managing documented module checkouts. (Fixes #2)
This commit is contained in:
parent
146c34ac7c
commit
5b2a11c23b
29
Makefile
29
Makefile
@ -1,24 +1,17 @@
|
|||||||
|
all:
|
||||||
|
@echo "Available commands:"
|
||||||
|
@grep "^[^#[:space:]].*:$$" Makefile
|
||||||
|
|
||||||
update:
|
update:
|
||||||
@echo "Cleaning up existing folders..";
|
@make fetch
|
||||||
@if [ -d $(CURDIR)/src/sapphire_master ]; then rm -rf $(CURDIR)/src/sapphire_master; fi
|
@make index
|
||||||
|
|
||||||
@echo "Checking out SilverStripe (Framework)..";
|
fetch:
|
||||||
@if [ -d $(CURDIR)/src/framework ]; then cd $(CURDIR)/src/framework; git pull -q; else git clone --depth=100 -q git://github.com/silverstripe/sapphire.git $(CURDIR)/src/framework; fi
|
@./bin/update.sh $(CURDIR)
|
||||||
|
|
||||||
@echo "-- master";
|
index:
|
||||||
@if [ -d $(CURDIR)/src/framework_master ]; then cd $(CURDIR)/src/framework_master; git pull -q; else cp -R $(CURDIR)/src/framework $(CURDIR)/src/framework_master; cd $(CURDIR)/src/framework_master; git pull -q; fi
|
@mkdir -p $(CURDIR)/silverstripe-cache/
|
||||||
|
@php framework/cli-script.php dev/tasks/RebuildLuceneDocsIndex flush=1
|
||||||
@echo "-- 3.0";
|
|
||||||
@if [ -d $(CURDIR)/src/framework_3.0 ]; then cd $(CURDIR)/src/framework_3.0; git pull -q; else cp -R $(CURDIR)/src/framework $(CURDIR)/src/framework_3.0; cd $(CURDIR)/src/framework_3.0; git pull -q; fi
|
|
||||||
|
|
||||||
@echo "-- 2.4";
|
|
||||||
@if [ -d $(CURDIR)/src/framework_2.4 ]; then cd $(CURDIR)/src/framework_2.4; git pull -q; else cp -R $(CURDIR)/src/framework $(CURDIR)/src/framework_2.4; cd $(CURDIR)/src/framework_2.4; git pull -q; fi
|
|
||||||
|
|
||||||
@echo "-- 2.3";
|
|
||||||
@if [ -d $(CURDIR)/src/framework_2.3 ]; then cd $(CURDIR)/src/framework_2.3; git pull -q; else cp -R $(CURDIR)/src/framework $(CURDIR)/src/framework_2.3; cd $(CURDIR)/src/framework_2.3; git pull -q; fi
|
|
||||||
|
|
||||||
@echo "Building index";
|
|
||||||
@cd $(CURDIR); php framework/cli-script.php dev/tasks/RebuildLuceneDocsIndex flush=1
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
$(MAKE) QUERYSTRING="$(QUERYSTRING)&SkipTests=RestfulServiceTest" -C sapphire test
|
$(MAKE) QUERYSTRING="$(QUERYSTRING)&SkipTests=RestfulServiceTest" -C sapphire test
|
||||||
|
@ -1,9 +1,53 @@
|
|||||||
url='git@github.com:chillu/silverstripe-doc-restructuring.git'
|
dir=$1
|
||||||
base=`dirname $0`
|
|
||||||
if [ ! -d "$base/../src/github" ]; then
|
if [ ! "$dir" ]; then
|
||||||
mkdir $base/../src/
|
echo "Usage: $0 /base/folder/to/docs"
|
||||||
git clone $url $base/../src/github
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $base/../src/github/
|
#=== FUNCTION ================================================================
|
||||||
git pull origin
|
# NAME: checkout
|
||||||
|
# DESCRIPTION: Checks out a specific branch of a module into a folder. Not
|
||||||
|
# particular good for taking up space, but at the moment separate
|
||||||
|
# folders for each version we need will do.
|
||||||
|
#
|
||||||
|
# The master branch will checked out by default
|
||||||
|
# PARAMETERS:
|
||||||
|
# $1 - module path on github (e.g silverstripe/sapphire.git)
|
||||||
|
# $2 - branch name (e.g 3.0)
|
||||||
|
# $3 - module name (e.g sapphire)
|
||||||
|
#
|
||||||
|
#===============================================================================
|
||||||
|
# Parameters: github path
|
||||||
|
function checkout {
|
||||||
|
if [ ! -d $dir/src/$3 ]; then
|
||||||
|
echo "Cloning $1 "
|
||||||
|
cd $dir/src
|
||||||
|
git clone --depth=100 -q git://github.com/$1 $3 --quiet
|
||||||
|
cd $3
|
||||||
|
git checkout master -q
|
||||||
|
else
|
||||||
|
cd $dir/src/$3
|
||||||
|
git pull -q
|
||||||
|
git checkout master -q
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Checking out $2 from $1 into $3_$2"
|
||||||
|
|
||||||
|
if [ -d $dir/src/$3_$2 ]; then
|
||||||
|
cd $dir/src/$3_$2
|
||||||
|
else
|
||||||
|
cp -R $dir/src/$3 $dir/src/$3_$2
|
||||||
|
cd $dir/src/$3_$2
|
||||||
|
fi
|
||||||
|
|
||||||
|
git reset --hard -q
|
||||||
|
git checkout $2 -q
|
||||||
|
git pull -q
|
||||||
|
}
|
||||||
|
|
||||||
|
checkout 'silverstripe/sapphire.git' '3.0' 'framework'
|
||||||
|
checkout 'silverstripe/sapphire.git' '2.4' 'framework'
|
||||||
|
checkout 'silverstripe/sapphire.git' '2.3' 'framework'
|
||||||
|
|
||||||
|
echo "Done."
|
Loading…
x
Reference in New Issue
Block a user