From f8820d9d4bc03474b717405b0af499707d7485d6 Mon Sep 17 00:00:00 2001 From: jovenden Date: Wed, 19 Jul 2017 17:41:10 +1200 Subject: [PATCH 1/3] Generate from tag where branch doesn't exist --- makedoc.sh | 72 +++++++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/makedoc.sh b/makedoc.sh index dda2847..8936130 100755 --- a/makedoc.sh +++ b/makedoc.sh @@ -4,39 +4,45 @@ cd $(dirname "$0"); # Where the module source code should be stored -STORAGE_DIR="modulesource" +STORAGE_DIR="assets/src" #=== FUNCTION ================================================================== -# 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. +# 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 +# The master branch will checked out by default # PARAMETERS: -# $1 - module path on github (e.g silverstripe/silverstripe-framework.git) -# $2 - branch name (e.g 3.0) -# $3 - module name (e.g framework) +# $1 - module path on github (e.g silverstripe/silverstripe-framework.git) +# $2 - branch/tag name (e.g 3.0), if $4 is defined this references the tag +# $3 - module name (e.g framework) +# $4 - whether we should use a branch for the clone # #=============================================================================== function checkout { - if [ -d "$STORAGE_DIR"/$2/$3/.git ]; then - (cd "$STORAGE_DIR"/$2/$3 && git reset --hard HEAD && git pull) - else - git clone --depth=100 --branch=$2 $1 "$STORAGE_DIR"/$2/$3 - fi + if [ -z $4 ]; then + VERSION_DIR=$2 + else + VERSION_DIR=$(echo $2 | cut -c1-3) + fi + if [ -d "$STORAGE_DIR"/$2/$3/.git ]; then + (cd "$STORAGE_DIR"/$2/$3 && git reset --hard HEAD && git pull) + else + git clone --depth=100 --branch=$2 $1 "$STORAGE_DIR"/"$VERSION_DIR"/$3 + fi } #=== FUNCTION ================================================================ -# NAME: generate -# DESCRIPTION: Generates APIGEN documentation +# NAME: generate +# DESCRIPTION: Generates APIGEN documentation # PARAMETERS: -# $1 - branch name (e.g. 3.0) -# $2 - Title (e.g. "SilverStripe master API Docs") +# $1 - branch name (e.g. 3.0) +# $2 - Title (e.g. "SilverStripe master API Docs") # #=============================================================================== function generate { - vendor/bin/apigen generate --config conf/apigen/apigen.neon --source "$STORAGE_DIR"/$1 --destination en/$1 --title "$2" + vendor/bin/apigen generate --config conf/apigen/apigen.neon --source "$STORAGE_DIR"/$1 --destination htdocs/$1 --title "$2" } # Ensure storage directory exists @@ -71,29 +77,29 @@ checkout 'git://github.com/silverstripe/silverstripe-reports.git' '3.5' 'reports generate '3.5' 'SilverStripe 3.5 API Docs' # 3.4 -checkout 'git://github.com/silverstripe/silverstripe-cms.git' '3.4' 'cms' -checkout 'git://github.com/silverstripe/silverstripe-framework.git' '3.4' 'framework' -checkout 'git://github.com/silverstripe/silverstripe-siteconfig.git' '3.4' 'siteconfig' -checkout 'git://github.com/silverstripe/silverstripe-reports.git' '3.4' 'reports' +checkout 'git://github.com/silverstripe/silverstripe-cms.git' '3.4.1' 'cms' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-framework.git' '3.4.1' 'framework' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-siteconfig.git' '3.4.1' 'siteconfig' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-reports.git' '3.4.1' 'reports' 'tag' generate '3.4' 'SilverStripe 3.4 API Docs' # 3.3 -checkout 'git://github.com/silverstripe/silverstripe-cms.git' '3.3' 'cms' -checkout 'git://github.com/silverstripe/silverstripe-framework.git' '3.3' 'framework' -checkout 'git://github.com/silverstripe/silverstripe-siteconfig.git' '3.3' 'siteconfig' -checkout 'git://github.com/silverstripe/silverstripe-reports.git' '3.3' 'reports' +checkout 'git://github.com/silverstripe/silverstripe-cms.git' '3.3.1' 'cms' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-framework.git' '3.3.1' 'framework' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-siteconfig.git' '3.3.1' 'siteconfig' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-reports.git' '3.3.1' 'reports' 'tag' generate '3.3' 'SilverStripe 3.3 API Docs' # 3.2 -checkout 'git://github.com/silverstripe/silverstripe-cms.git' '3.2' 'cms' -checkout 'git://github.com/silverstripe/silverstripe-framework.git' '3.2' 'framework' -checkout 'git://github.com/silverstripe/silverstripe-siteconfig.git' '3.2' 'siteconfig' -checkout 'git://github.com/silverstripe/silverstripe-reports.git' '3.2' 'reports' +checkout 'git://github.com/silverstripe/silverstripe-cms.git' '3.2.1' 'cms' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-framework.git' '3.2.1' 'framework' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-siteconfig.git' '3.2.1' 'siteconfig' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-reports.git' '3.2.1' 'reports' 'tag' generate '3.2' 'SilverStripe 3.2 API Docs' # 3.1 -checkout 'git://github.com/silverstripe/silverstripe-cms.git' '3.1' 'cms' -checkout 'git://github.com/silverstripe/silverstripe-framework.git' '3.1' 'framework' +checkout 'git://github.com/silverstripe/silverstripe-cms.git' '3.1.1' 'cms' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-framework.git' '3.1.1' 'framework' 'tag' generate '3.1' 'SilverStripe 3.1 API Docs' # 3.0 From 13fe1ef3d78907a4f4b6b9dd0b68c4085804b2f2 Mon Sep 17 00:00:00 2001 From: jovenden Date: Wed, 19 Jul 2017 17:42:26 +1200 Subject: [PATCH 2/3] Ungoof --- makedoc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makedoc.sh b/makedoc.sh index 8936130..35293ad 100755 --- a/makedoc.sh +++ b/makedoc.sh @@ -4,7 +4,7 @@ cd $(dirname "$0"); # Where the module source code should be stored -STORAGE_DIR="assets/src" +STORAGE_DIR="modulesource" #=== FUNCTION ================================================================== # NAME: checkout From d06620e0c686e10506e40451c36a965f35ff2060 Mon Sep 17 00:00:00 2001 From: jovenden Date: Thu, 20 Jul 2017 09:17:28 +1200 Subject: [PATCH 3/3] Generate to the right place, change tags --- makedoc.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/makedoc.sh b/makedoc.sh index 35293ad..0d22e91 100755 --- a/makedoc.sh +++ b/makedoc.sh @@ -42,7 +42,7 @@ function checkout { # #=============================================================================== function generate { - vendor/bin/apigen generate --config conf/apigen/apigen.neon --source "$STORAGE_DIR"/$1 --destination htdocs/$1 --title "$2" + vendor/bin/apigen generate --config conf/apigen/apigen.neon --source "$STORAGE_DIR"/$1 --destination en/$1 --title "$2" } # Ensure storage directory exists @@ -77,29 +77,29 @@ checkout 'git://github.com/silverstripe/silverstripe-reports.git' '3.5' 'reports generate '3.5' 'SilverStripe 3.5 API Docs' # 3.4 -checkout 'git://github.com/silverstripe/silverstripe-cms.git' '3.4.1' 'cms' 'tag' -checkout 'git://github.com/silverstripe/silverstripe-framework.git' '3.4.1' 'framework' 'tag' -checkout 'git://github.com/silverstripe/silverstripe-siteconfig.git' '3.4.1' 'siteconfig' 'tag' -checkout 'git://github.com/silverstripe/silverstripe-reports.git' '3.4.1' 'reports' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-cms.git' '3.4.6' 'cms' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-framework.git' '3.4.6' 'framework' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-siteconfig.git' '3.4.6' 'siteconfig' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-reports.git' '3.4.6' 'reports' 'tag' generate '3.4' 'SilverStripe 3.4 API Docs' # 3.3 -checkout 'git://github.com/silverstripe/silverstripe-cms.git' '3.3.1' 'cms' 'tag' -checkout 'git://github.com/silverstripe/silverstripe-framework.git' '3.3.1' 'framework' 'tag' -checkout 'git://github.com/silverstripe/silverstripe-siteconfig.git' '3.3.1' 'siteconfig' 'tag' -checkout 'git://github.com/silverstripe/silverstripe-reports.git' '3.3.1' 'reports' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-cms.git' '3.3.4' 'cms' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-framework.git' '3.3.4' 'framework' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-siteconfig.git' '3.3.4' 'siteconfig' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-reports.git' '3.3.4' 'reports' 'tag' generate '3.3' 'SilverStripe 3.3 API Docs' # 3.2 -checkout 'git://github.com/silverstripe/silverstripe-cms.git' '3.2.1' 'cms' 'tag' -checkout 'git://github.com/silverstripe/silverstripe-framework.git' '3.2.1' 'framework' 'tag' -checkout 'git://github.com/silverstripe/silverstripe-siteconfig.git' '3.2.1' 'siteconfig' 'tag' -checkout 'git://github.com/silverstripe/silverstripe-reports.git' '3.2.1' 'reports' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-cms.git' '3.2.6' 'cms' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-framework.git' '3.2.6' 'framework' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-siteconfig.git' '3.2.6' 'siteconfig' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-reports.git' '3.2.6' 'reports' 'tag' generate '3.2' 'SilverStripe 3.2 API Docs' # 3.1 -checkout 'git://github.com/silverstripe/silverstripe-cms.git' '3.1.1' 'cms' 'tag' -checkout 'git://github.com/silverstripe/silverstripe-framework.git' '3.1.1' 'framework' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-cms.git' '3.1.21' 'cms' 'tag' +checkout 'git://github.com/silverstripe/silverstripe-framework.git' '3.1.21' 'framework' 'tag' generate '3.1' 'SilverStripe 3.1 API Docs' # 3.0