Merge branch 'travis-fix-apidoc-revs'

Closes https://github.com/awesomeWM/awesome/pull/807.
This commit is contained in:
Daniel Hahler 2016-04-05 00:29:03 +02:00
commit b87dac5075
1 changed files with 11 additions and 3 deletions

View File

@ -66,7 +66,6 @@ if git diff --cached --exit-code --quiet; then
fi fi
# Commit the relevant changes. # Commit the relevant changes.
OLD_REV="$(git rev-parse --short HEAD)"
COMMIT_MSG="Update docs for $AWESOME_VERSION via Travis COMMIT_MSG="Update docs for $AWESOME_VERSION via Travis
Last commit message: Last commit message:
@ -74,7 +73,6 @@ $(cd $REPO_DIR && git log -1 --pretty=format:%s)
Build URL: https://travis-ci.org/awesomeWM/awesome/builds/${TRAVIS_BUILD_ID}" Build URL: https://travis-ci.org/awesomeWM/awesome/builds/${TRAVIS_BUILD_ID}"
git commit -m "[relevant] $COMMIT_MSG" git commit -m "[relevant] $COMMIT_MSG"
NEW_REV="$(git rev-parse --short HEAD)"
# Commit the irrelevant changes. # Commit the irrelevant changes.
mv .git ../doc mv .git ../doc
@ -87,15 +85,25 @@ git commit -m "[boilerplate] $COMMIT_MSG"
git tag _old git tag _old
git reset --hard HEAD~2 git reset --hard HEAD~2
git cherry-pick _old _old~1 git cherry-pick _old _old~1
RELEVANT_REV="$(git rev-parse --short HEAD)"
git tag -d _old git tag -d _old
git checkout "$BRANCH" git checkout "$BRANCH"
git merge --no-ff -m "$COMMIT_MSG" merged-update OLD_REV="$(git rev-parse --short HEAD)"
MERGE_COMMIT_MSG="$COMMIT_MSG"
if [ "$TRAVIS_PULL_REQUEST" != false ]; then
COMMIT_MSG="$COMMIT_MSG
Pull request: https://github.com/awesomeWM/awesome/pull/${TRAVIS_PULL_REQUEST}"
fi
git merge --no-ff -m "$MERGE_COMMIT_MSG" merged-update
NEW_REV="$(git rev-parse --short HEAD)"
git push --quiet origin "$BRANCH" git push --quiet origin "$BRANCH"
# Generate compare view links. # Generate compare view links.
# NOTE: use "\n" for line endings, not real ones for valid json!
COMPARE_LINKS="Compare view: https://github.com/awesomeWM/apidoc/compare/${OLD_REV}...${NEW_REV}" COMPARE_LINKS="Compare view: https://github.com/awesomeWM/apidoc/compare/${OLD_REV}...${NEW_REV}"
COMPARE_LINKS="$COMPARE_LINKS\nRelevant changes: https://github.com/awesomeWM/apidoc/commit/${RELEVANT_REV}"
if [ "$BRANCH" != "gh-pages" ]; then if [ "$BRANCH" != "gh-pages" ]; then
COMPARE_LINKS="$COMPARE_LINKS\nComparison against master (gh-pages): https://github.com/awesomeWM/apidoc/compare/gh-pages...${NEW_REV}" COMPARE_LINKS="$COMPARE_LINKS\nComparison against master (gh-pages): https://github.com/awesomeWM/apidoc/compare/gh-pages...${NEW_REV}"
fi fi