Skip to content

Instantly share code, notes, and snippets.

@cyberswat
Created October 3, 2012 12:51
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save cyberswat/cb422f6634441443d05d to your computer and use it in GitHub Desktop.
#!/bin/bash
# A subfolder in the Jenkins workspace for the Acquia hosted repo.
ALLTHINGS=$WORKSPACE/allthethings
# A subfolder in the Jenkins workspace for the Acquia hosted repo.
ACQUIAREPO='example@example.acquia.com:allthethings.git'
# The base for github repos.
GITBASE='git@github.com:acquia'
if [ ! -d $ALLTHINGS/.git ]; then
rm -rf $ALLTHINGS
git clone $ACQUIAREPO $ALLTHINGS
fi
cd $ALLTHINGS
git fetch --all
git reset --hard origin
# Standardize on <repo>/doc ... copy existing markdown
for i in "repo1" "repo2" "repo3" "repo4" "repo5" "repo6";
do
mkdir -p $ALLTHINGS/github/$i/
if [ ! -d $WORKSPACE/$i/.git ]; then
rm -rf $WORKSPACE/$i
git clone $GITBASE/$i.git $WORKSPACE/$i
fi
cd $WORKSPACE/$i
git fetch --all
git reset --hard origin
cp -R $WORKSPACE/$i/doc $ALLTHINGS/github/$i/
cp -R $WORKSPACE/$i/docs $ALLTHINGS/github/$i/
cp -R $WORKSPACE/$i/*.md $ALLTHINGS/github/$i/
cp -R $WORKSPACE/$i/*.txt $ALLTHINGS/github/$i/
cp -R $WORKSPACE/$i/*.html $ALLTHINGS/github/$i/
done
# Generate rdocs for api's
cd $WORKSPACE/fields/aq
rdoc -o $ALLTHINGS/generated/fields
cd $ALLTHINGS
# Only commit all the things if there are changes
git add generated
git add github
if ! git diff-index --quiet HEAD --; then
git status
git commit -am "Automated document generation: ${JOB_NAME} build ${BUILD_NUMBER}"
git push
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment