Skip to content

@cyberswat /gist:cb422f6634441443d05d secret
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
#!/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
Something went wrong with that request. Please try again.