Toolchain for TecDoc managed documentation repositories
To run the toolchain locally, or run the unit tests, the following requirements must be met:
- Ruby 2.x
- installed dependencies (Gemfile)
In order to install dependencies, run the following at the root of the project:
bundle install --jobs 4 --retry 3
bundle exec rake -T
NOTE: Use bundle exec rake
to invoke rake
.
Building the content can be done one stage after another:
rake docs:clean
rake docs:test
rake docs:pre
rake docs:build
rake docs:post
or by using the target all
, which runs all of the stages mentioned above:
rake docs:all
Alternatively, use the Docker image at wirecard/docs-dockerfile.
The toolchain is designed to run through different stages, that have specific responsibilities:
- setup: install required dependencies
- test:
- validate all configuration files
- test the current commit with:
- predefined tests by the toolchain (
lib/extensions.d/
)- ID Checker
if
Checker- Link Checker
- Pattern Checker
- custom tests (
${CUSTOM_DIR}/extensions.d/
)
- predefined tests by the toolchain (
- pre:
- combine Javascript files to BLOB file
- transpile (cross-browser compatibility and loading speed)
- build:
- invoke asciidoctor (with multipage converter)
- [future] diagram integration
- Table of Content injector
- CodeRay source code highlighter
- post:
- create Table of Content
- create search index (Lunr)
- deploy:
- wirecard/s3-deploy
- crazy-max/ghaction-github-pages
- required variables, see Configuration/Secret/AWS
- notify:
- send Slack message stating the fail status and a description if the build failed, see Configuration/Secret/Slack
rake toolchain:lint
calls rubocoprake toolchain:test
runs unit tests withsimplecov
and writes report tocoverage/index.html
rake toolchain:quality
runsrubycritic
and generates an overview in/tmp/rubycritic/overview.html
rake toolchain:rdoc
generates rdoc documentation in/tmp/rdoc
rake toolchain:inch:grade
orrake toolchain:inch:suggest
runsinch
on the code base
- No rake task:
bundle install --jobs 4 --retry 3
rake docs:test
rake docs:pre
rake docs:build
rake docs:post
- No rake task: Deployed by Github Action
Additional tasks
rake docs:clean
: delete build directory and clean uprake docs:all
: run the stagesclean test pre build post
rake docs:list:<stage>
: list loaded extensions for a processing stagerake docs:list:pre
rake docs:list:post
SKIP_COMBINE
: skips the Javascript combine and transpile operation.SKIP_HTMLCHECK
: skips the HTML Check Post process.- Skip entire stages
SKIP_RAKE_TEST
: skips test stage (i.e.rake docs:test
)
FAST
sets the following variables (which may be set individually):SKIP_COMBINE
,SKIP_HTMLCHECK
,SKIP_RAKE_TEST
DEBUG
for debug buildsSKIP_COMBINE
- additional debug output