-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from CircleCI-Public/usage
Generate docs for the CLI
- Loading branch information
Showing
42 changed files
with
7,468 additions
and
2,760 deletions.
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 |
---|---|---|
|
@@ -25,6 +25,16 @@ jobs: | |
destination: coverage.txt | ||
- codecov/upload: | ||
path: coverage.txt | ||
docs: | ||
executor: go | ||
steps: | ||
- checkout | ||
- run: sudo apt-get install pandoc | ||
- run: go run main.go usage | ||
- store_artifacts: | ||
path: ./docs | ||
destination: docs | ||
- run: ./.circleci/deploy-gh-pages.sh | ||
|
||
lint: | ||
docker: | ||
|
@@ -55,8 +65,8 @@ jobs: | |
- run: | ||
name: Tag Repo | ||
command: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Marc O'Morain" | ||
git config --global user.email $GH_EMAIL | ||
git config --global user.name $GH_NAME | ||
git tag -a "v0.1.$CIRCLE_BUILD_NUM" -m "Release v0.1.$CIRCLE_BUILD_NUM" | ||
git push origin "v0.1.$CIRCLE_BUILD_NUM" | ||
- run: | ||
|
@@ -93,6 +103,9 @@ workflows: | |
- test | ||
- coverage | ||
- lint | ||
- docs: | ||
requires: | ||
- deploy | ||
- deploy: | ||
requires: | ||
- test | ||
|
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,48 @@ | ||
#!/bin/sh | ||
# ideas used from https://gist.github.com/motemen/8595451 | ||
|
||
# Based on https://github.com/eldarlabs/ghpages-deploy-script/blob/master/scripts/deploy-ghpages.sh | ||
# Used with their MIT license https://github.com/eldarlabs/ghpages-deploy-script/blob/master/LICENSE | ||
|
||
# abort the script if there is a non-zero error | ||
set -e | ||
|
||
# show where we are on the machine | ||
pwd | ||
remote=$(git config remote.origin.url) | ||
|
||
# make a directory to put the gp-pages branch | ||
mkdir gh-pages-branch | ||
cd gh-pages-branch | ||
# now lets setup a new repo so we can update the gh-pages branch | ||
git config --global user.email "$GH_EMAIL" > /dev/null 2>&1 | ||
git config --global user.name "$GH_NAME" > /dev/null 2>&1 | ||
git init | ||
git remote add --fetch origin "$remote" | ||
|
||
# switch into the the gh-pages branch | ||
if git rev-parse --verify origin/gh-pages > /dev/null 2>&1 | ||
then | ||
git checkout gh-pages | ||
# delete any old site as we are going to replace it | ||
# Note: this explodes if there aren't any, so moving it here for now | ||
git rm -rf . | ||
else | ||
git checkout --orphan gh-pages | ||
fi | ||
|
||
# copy over or recompile the new site | ||
cp -a "../out/." . | ||
|
||
# stage any changes and new files | ||
git add -A | ||
# now commit, ignoring branch gh-pages doesn't seem to work, so trying skip | ||
git commit --allow-empty -m "Deploy to GitHub pages [ci skip]" | ||
# and push, but send any output to /dev/null to hide anything sensitive | ||
git push --force --quiet origin gh-pages | ||
# go back to where we started and remove the gh-pages git repo we made and used | ||
# for deployment | ||
cd .. | ||
rm -rf gh-pages-branch | ||
|
||
echo "Finished Deployment!" |
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,18 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# generate markdown docs | ||
go run main.go usage | ||
|
||
# setup output dir | ||
mkdir -p out | ||
|
||
# pandoc markdown to html into out dir | ||
for f in docs/*.md; do | ||
pandoc "$f" -s -o "out/$(basename ${f%.md}.html)"; | ||
done | ||
|
||
# move index and update links | ||
mv out/circleci.html out/index.html | ||
sed -i -- 's#<a href="circleci.html">#<a href="index.html">#g' out/*.html |
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 |
---|---|---|
|
@@ -3,4 +3,6 @@ TODO | |
circleci-cli | ||
coverage.txt | ||
dist/ | ||
docs/ | ||
out/ | ||
.vscode |
Oops, something went wrong.