3 # $ALLTHINGS tells use where the repo is
5 if [ -z "$ALLTHINGS" ]; then
6 echo "Please define env variable ALLTHINGS"
11 echo "Usage: $0 -r REPONAME -g REPONAME/GEMDIR"
15 while getopts ":g:r:" optname
22 repos[$OPTIND]=$OPTARG
25 echo "Unknown option $OPTARG"
29 echo "No argument value for $OPTARG"
34 echo "Error while processing options"
40 echo "repos: ${repos[@]}"
42 echo "gems to build RDoc: ${gems[@]}"
44 # Standardize on <repo>/doc ... copy existing markdown
47 mkdir -p $ALLTHINGS/github/$i/
48 if [ ! -d $WORKSPACE/$i/.git ]; then
50 git clone git@github.com:acquia/$i.git $WORKSPACE/$i
54 git reset --hard origin
55 for dir in $WORKSPACE/$i/{doc,docs}; do
56 [ ! -d $dir ] || cp -R $dir $ALLTHINGS/github/$i/
58 # Copy docs at the top level of the repo too.
59 for file in $WORKSPACE/$i/*.{md,txt,htm,html}; do
60 [ ! -f $file ] || cp $file $ALLTHINGS/github/$i/
64 # Generate rdocs for api's
69 rdoc -o $ALLTHINGS/generated/$name
74 # Only commit all the things if there are changes
77 if ! git diff-index --quiet HEAD --; then
79 git commit -am "Automated document generation: ${JOB_NAME} build ${BUILD_NUMBER}"