Skip to content

Commit c860901

Browse files
authored
Merge pull request #1227 from jim-parry/admin/docbot
Admin script for user guide build & deploy
2 parents 1e08dc6 + b104aa3 commit c860901

6 files changed

Lines changed: 87 additions & 7 deletions

File tree

admin/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# CodeIgniter 4 Admin
2+
3+
This folder contains tools or docs useful for project maintainers.
4+
5+
- [docbot](./docbot.md) - build & deploy user guide
6+
- [release](./release.md) - build & deploy framework release

admin/docbot.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# docbot
2+
3+
Builds & deploys user guide.
4+
5+
The CI4 user guide, warts & all, is rebuilt in a nested
6+
repository clone (`user_guide_src/build/html`), with the result
7+
optionally pushed to the `gh-pages` branch of the repo.
8+
That would then be publically visible as the in-progress
9+
version of the [User Guide](https://bcit-ci.github.io/CodeIgniter4/).
10+
11+
## Audience
12+
13+
This script is intended for use by framework maintainers,
14+
i.e. someone with commit rights on the CI4 repository.
15+
16+
This script wraps the conventional user guide building,
17+
i.e. `user_guide_src/make html`, with additional
18+
steps.
19+
20+
You will be prompted for your github credentials and
21+
GPG-signing key as appropriate.
22+
23+
## Usage
24+
25+
Inside a shell prompt, in the project root:
26+
27+
`admin/docbot.sh [deploy]`
28+
29+
If "deploy" is not added, the script execution is considered
30+
a trial run, and nothing is pushed to the repo.
31+
32+
Whether or not deployed, the results are left inside
33+
user_guide_src/build

admin/docbot.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
# Rebuild and deploy CodeIgniter4 user guide
4+
5+
UPSTREAM=https://github.com/bcit-ci/CodeIgniter4.git
6+
7+
# Prepare the nested repo clone folder
8+
cd user_guide_src
9+
rm -rf build/*
10+
mkdir build/html
11+
12+
# Get ready for git
13+
cd build/html
14+
git init
15+
git remote add origin $UPSTREAM
16+
git fetch origin gh-pages
17+
git checkout gh-pages
18+
git reset --hard origin/gh-pages
19+
rm -r *
20+
21+
# Make the new user guide
22+
cd ../..
23+
make html
24+
25+
# All done?
26+
if [ $# -lt 1 ]; then
27+
exit 0
28+
fi
29+
30+
# Optionally update the remote repo
31+
if [ $1 = "deploy" ]; then
32+
cd build/html
33+
git add .
34+
git commit -S -m "Docbot synching"
35+
git push -f origin gh-pages
36+
fi

admin/release.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# release
2+
3+
Builds & deploys framework release.
4+
5+
## Assumptions
6+
7+
## Usage
8+

admin/release.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## Build and deploy framework release
2+
3+
4+

user_guide_src/Makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
77
PAPER =
88
BUILDDIR = build
9-
GHBUILDDIR = ../../CodeIgniter4-guide
109

1110
# Internal variables.
1211
PAPEROPT_a4 = -D latex_paper_size=a4
@@ -129,9 +128,3 @@ doctest:
129128
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
130129
@echo "Testing of doctests in the sources finished, look at the " \
131130
"results in $(BUILDDIR)/doctest/output.txt."
132-
133-
ghpages:
134-
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(GHBUILDDIR)/html
135-
@echo
136-
@echo "Build finished. The HTML pages are in $(GHBUILDDIR)/html."
137-

0 commit comments

Comments
 (0)