Skip to content

Commit

Permalink
Merge pull request #1227 from jim-parry/admin/docbot
Browse files Browse the repository at this point in the history
Admin script for user guide build & deploy
  • Loading branch information
jim-parry authored Sep 20, 2018
2 parents 1e08dc6 + b104aa3 commit c860901
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 7 deletions.
6 changes: 6 additions & 0 deletions admin/README.md
Original file line number Diff line number Diff line change
@@ -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 changes: 33 additions & 0 deletions admin/docbot.md
Original file line number Diff line number Diff line change
@@ -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 changes: 36 additions & 0 deletions admin/docbot.sh
Original file line number Diff line number Diff line change
@@ -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 changes: 8 additions & 0 deletions admin/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# release

Builds & deploys framework release.

## Assumptions

## Usage

4 changes: 4 additions & 0 deletions admin/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Build and deploy framework release



7 changes: 0 additions & 7 deletions user_guide_src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build
GHBUILDDIR = ../../CodeIgniter4-guide

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
Expand Down Expand Up @@ -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."

0 comments on commit c860901

Please sign in to comment.