Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix auto updation travis issue #238

Merged
merged 1 commit into from
Nov 6, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 37 additions & 25 deletions update_documentation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ GIT_PASS="$2"
FROM_BRANCH="master"
TO_BRANCH="gh-pages"

# Needed for setting identity
git config --global user.email "[email protected]"
git config --global user.name "Tushar Makkar"
git config --global push.default "simple"

# Get the current branch
export PAGER=cat
CURRENT_BRANCH=$(git log -n 1 --pretty=%d HEAD | cut -d"," -f3 | cut -d" " -f2 | cut -d")" -f1)
Expand All @@ -21,29 +26,36 @@ echo "current branch is '$CURRENT_BRANCH'"
# Create the URL to push merge to
URL=$(git remote -v | head -n1 | cut -f2 | cut -d" " -f1)
echo "Repo url is $URL"
PUSH_URL="https://$GIT_USER:$GIT_PASS@${URL:6}"

if [ "$CURRENT_BRANCH" = "$FROM_BRANCH" ] ; then
# Checkout the dev branch
#git checkout $FROM_BRANCH && \
#echo "Checking out $TO_BRANCH..." && \

# Checkout the latest stable
git fetch origin ${TO_BRANCH}:${TO_BRANCH} && \
git checkout ${TO_BRANCH} && \

# Merge the dev into latest stable
echo "Merging changes..." && \
git merge ${FROM_BRANCH} && \

# Push changes back to remote vcs
echo "Pushing changes..." && \
git push ${PUSH_URL} && \
echo "Merge complete!" || \
echo "Error Occurred. Merge failed"
else
echo "Not on $FROM_BRANCH. Skipping merge"
fi
PUSH_URL="https://$GIT_USER:$GIT_PASS@${URL:8}"

git remote set-url origin ${PUSH_URL}

echo "Checking out $FROM_BRANCH..." && \
git fetch origin ${FROM_BRANCH}:${FROM_BRANCH} && \
git checkout ${FROM_BRANCH}


echo "Checking out $TO_BRANCH..." && \
# Checkout the latest stable
git fetch origin ${TO_BRANCH}:${TO_BRANCH} && \
git checkout ${TO_BRANCH} && \

# Merge the dev into latest stable
echo "Merging changes..." && \
git merge ${FROM_BRANCH} && \

# Push changes back to remote vcs
echo "Pushing changes..." && \
git push origin gh-pages &> /dev/null && \
echo "Merge complete!" || \
echo "Error Occurred. Merge failed"

export PYTHONPATH=${PYTHONPATH}:$(pwd):$(pwd)/voluptuous

pip install -r requirements.txt && sphinx-apidoc -o docs -f voluptuous &&
cd docs && make html ||
echo "Sphinx not able to generate HTML"

pip install -r requirements.txt
sphinx-apidoc -o docs -f voluptuous
git status && git add . &&
git commit -m "Auto updating documentation from $CURRENT_BRANCH" &&
git push origin gh-pages &> /dev/null && echo "Documentation pushed"