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 -TNOTE: 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:postor by using the target all, which runs all of the stages mentioned above:
rake docs:allAlternatively, 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
ifChecker- 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:lintcalls rubocoprake toolchain:testruns unit tests withsimplecovand writes report tocoverage/index.htmlrake toolchain:qualityrunsrubycriticand generates an overview in/tmp/rubycritic/overview.htmlrake toolchain:rdocgenerates rdoc documentation in/tmp/rdocrake toolchain:inch:gradeorrake toolchain:inch:suggestrunsinchon the code base
- No rake task:
bundle install --jobs 4 --retry 3 rake docs:testrake docs:prerake docs:buildrake 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 postrake docs:list:<stage>: list loaded extensions for a processing stagerake docs:list:prerake 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)
FASTsets the following variables (which may be set individually):SKIP_COMBINE,SKIP_HTMLCHECK,SKIP_RAKE_TEST
DEBUGfor debug buildsSKIP_COMBINE- additional debug output