-
-
Save cyberswat/cb422f6634441443d05d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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