Merge pull request #1227 from jim-parry/admin/docbot

Admin script for user guide build & deploy
This commit is contained in:
Instructor, BCIT 2018-09-20 12:03:09 -07:00 committed by GitHub
commit c860901a5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 87 additions and 7 deletions

6
admin/README.md Normal file
View File

@ -0,0 +1,6 @@
# CodeIgniter 4 Admin
This folder contains tools or docs useful for project maintainers.
- [docbot](./docbot.md) - build & deploy user guide
- [release](./release.md) - build & deploy framework release

33
admin/docbot.md Normal file
View File

@ -0,0 +1,33 @@
# docbot
Builds & deploys user guide.
The CI4 user guide, warts & all, is rebuilt in a nested
repository clone (`user_guide_src/build/html`), with the result
optionally pushed to the `gh-pages` branch of the repo.
That would then be publically visible as the in-progress
version of the [User Guide](https://bcit-ci.github.io/CodeIgniter4/).
## Audience
This script is intended for use by framework maintainers,
i.e. someone with commit rights on the CI4 repository.
This script wraps the conventional user guide building,
i.e. `user_guide_src/make html`, with additional
steps.
You will be prompted for your github credentials and
GPG-signing key as appropriate.
## Usage
Inside a shell prompt, in the project root:
`admin/docbot.sh [deploy]`
If "deploy" is not added, the script execution is considered
a trial run, and nothing is pushed to the repo.
Whether or not deployed, the results are left inside
user_guide_src/build

36
admin/docbot.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/bash
# Rebuild and deploy CodeIgniter4 user guide
UPSTREAM=https://github.com/bcit-ci/CodeIgniter4.git
# Prepare the nested repo clone folder
cd user_guide_src
rm -rf build/*
mkdir build/html
# Get ready for git
cd build/html
git init
git remote add origin $UPSTREAM
git fetch origin gh-pages
git checkout gh-pages
git reset --hard origin/gh-pages
rm -r *
# Make the new user guide
cd ../..
make html
# All done?
if [ $# -lt 1 ]; then
exit 0
fi
# Optionally update the remote repo
if [ $1 = "deploy" ]; then
cd build/html
git add .
git commit -S -m "Docbot synching"
git push -f origin gh-pages
fi

8
admin/release.md Normal file
View File

@ -0,0 +1,8 @@
# release
Builds & deploys framework release.
## Assumptions
## Usage

4
admin/release.sh Normal file
View File

@ -0,0 +1,4 @@
## Build and deploy framework release

View File

@ -6,7 +6,6 @@ SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build
GHBUILDDIR = ../../CodeIgniter4-guide
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
@ -129,9 +128,3 @@ doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
ghpages:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(GHBUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(GHBUILDDIR)/html."