secret
Created

  • Download Gist
gistfile1.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
#!/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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.