-
-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build cli docs automatically with circleci
- Loading branch information
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash -eux | ||
|
||
# Even though specs also generate docs, lets run again to ensure clean slate | ||
rake docs | ||
|
||
out=$(git status docs) | ||
if [[ "$out" = *"nothing to commit"* ]]; then | ||
exit | ||
fi | ||
|
||
COMMIT_MESSAGE="docs updated by circleci" | ||
|
||
# If the last commit already updated the docs, then exit. | ||
# Preventable measure to avoid infinite loop. | ||
if git log -1 --pretty=oneline | grep "$COMMIT_MESSAGE" ; then | ||
exit | ||
fi | ||
|
||
# If reach here, we have some changes on docs that we should commit. | ||
# Even though s | ||
git add docs | ||
git commit -m "$COMMIT_MESSAGE" | ||
|
||
# https://makandracards.com/makandra/12107-git-show-current-branch-name-only | ||
current_branch=$(git rev-parse --abbrev-ref HEAD) | ||
git push origin "$current_branch" |
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
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