add docs validation to ci

This commit is contained in:
Robert Kaussow 2020-06-02 22:17:46 +02:00
parent 7701f39fe8
commit 5e306a8aae
11 changed files with 110 additions and 21 deletions

22
.dictionary Normal file
View File

@ -0,0 +1,22 @@
([a-zA-Z0-9]+[_=])+\S+
@\S+
.py
Ansible
Bott
CLI
Jinja2
Kaussow
PyPI
YAML
Yaml
ansible-.+
basename
cli
config
dir
SELinux
subfolder
sudo
xoxys
option1:option2
todo

View File

@ -212,6 +212,40 @@ local PipelineDocs = {
limit: 1,
},
steps: [
{
name: 'markdownlint',
image: 'node:lts-alpine',
commands: [
'npm install -g markdownlint-cli',
"markdownlint 'docs/content/**/*.md' 'README.md'",
],
environment: {
FORCE_COLOR: true,
NPM_CONFIG_LOGLEVEL: 'error',
},
},
{
name: 'spellcheck',
image: 'node:lts-alpine',
commands: [
'npm install -g spellchecker-cli',
"spellchecker --files 'docs/content/**/*.md' 'README.md' -d .dictionary -p spell indefinite-article syntax-urls --no-suggestions",
],
environment: {
FORCE_COLOR: true,
NPM_CONFIG_LOGLEVEL: 'error',
},
},
{
name: 'link-validation',
image: 'xoxys/link-validator',
commands: [
'link-validator -ro',
],
environment: {
LINK_VALIDATOR_BASE_DIR: 'exampleSite/public',
},
},
{
name: 'assets',
image: 'byrnedo/alpine-curl',
@ -221,7 +255,7 @@ local PipelineDocs = {
],
},
{
name: 'test',
name: 'build',
image: 'klakegg/hugo:0.59.1-ext-alpine',
commands: [
'cd docs/ && hugo-official',

View File

@ -338,13 +338,38 @@ concurrency:
limit: 1
steps:
- name: markdownlint
image: node:lts-alpine
commands:
- npm install -g markdownlint-cli
- markdownlint 'docs/content/**/*.md' 'README.md'
environment:
FORCE_COLOR: true
NPM_CONFIG_LOGLEVEL: error
- name: spellcheck
image: node:lts-alpine
commands:
- npm install -g spellchecker-cli
- spellchecker --files 'docs/content/**/*.md' 'README.md' -d .dictionary -p spell indefinite-article syntax-urls --no-suggestions
environment:
FORCE_COLOR: true
NPM_CONFIG_LOGLEVEL: error
- name: link-validation
image: xoxys/link-validator
commands:
- link-validator -ro
environment:
LINK_VALIDATOR_BASE_DIR: exampleSite/public
- name: assets
image: byrnedo/alpine-curl
commands:
- mkdir -p docs/themes/hugo-geekdoc/
- curl -L https://github.com/xoxys/hugo-geekdoc/releases/latest/download/hugo-geekdoc.tar.gz | tar -xz -C docs/themes/hugo-geekdoc/ --strip-components=1
- name: test
- name: build
image: klakegg/hugo:0.59.1-ext-alpine
commands:
- cd docs/ && hugo-official
@ -431,8 +456,4 @@ trigger:
depends_on:
- docs
---
kind: signature
hmac: 4cccf7f253f9396b3447ed1a5027b9f1aa68d7211ddbfaf89ae7df43e509891a
...

4
.markdownlint.yml Normal file
View File

@ -0,0 +1,4 @@
---
default: True
MD013: False
MD041: False

View File

@ -1,2 +1,4 @@
* INTERNAL
* maintenance and refactoring release, no changes
* add markdown linting to CI (markdownlint-cli)
* add spellchecking to CI (spellcheck-cli)
* add broken link check to CI (broken-link-checker)

View File

@ -3,13 +3,13 @@
[![Build Status](https://img.shields.io/drone/build/xoxys/ansible-doctor?logo=drone)](https://cloud.drone.io/xoxys/ansible-doctor)
[![Docker Hub](https://img.shields.io/badge/docker-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/xoxys/ansible-doctor)
[![Python Version](https://img.shields.io/pypi/pyversions/ansible-doctor.svg)](https://pypi.org/project/ansible-doctor/)
[![PyPi Status](https://img.shields.io/pypi/status/ansible-doctor.svg)](https://pypi.org/project/ansible-doctor/)
[![PyPi Release](https://img.shields.io/pypi/v/ansible-doctor.svg)](https://pypi.org/project/ansible-doctor/)
[![PyPI Status](https://img.shields.io/pypi/status/ansible-doctor.svg)](https://pypi.org/project/ansible-doctor/)
[![PyPI Release](https://img.shields.io/pypi/v/ansible-doctor.svg)](https://pypi.org/project/ansible-doctor/)
[![License: MIT](https://img.shields.io/github/license/xoxys/ansible-doctor)](LICENSE)
This project is based on the idea (and at some parts on the code) of [ansible-autodoc](https://github.com/AndresBott/ansible-autodoc) by Andres Bott so credits goes to him for his work.
_ansible-doctor_ is a simple annotation like documentation generator based on Jinja2 templates. While _ansible-doctor_ comes with a default template called `readme`, it is also possible to write your own templates. This gives you the ability to customize the output and render the data to every format you like (e.g. html or xml).
_ansible-doctor_ is a simple annotation like documentation generator based on Jinja2 templates. While _ansible-doctor_ comes with a default template called `readme`, it is also possible to write your own templates. This gives you the ability to customize the output and render the data to every format you like (e.g. HTML or XML).
_ansible-doctor_ is designed to work within your CI pipeline to complete your testing and deployment workflow. Releases are available as Python Packages on [GitHub](https://github.com/xoxys/ansible-doctor/releases) or [PyPI](https://pypi.org/project/ansible-doctor/) and as Docker Image on [Docker Hub](https://hub.docker.com/r/xoxys/ansible-doctor).

View File

@ -5,12 +5,12 @@ title: Documentation
[![Build Status](https://img.shields.io/drone/build/xoxys/ansible-doctor?logo=drone)](https://cloud.drone.io/xoxys/ansible-doctor/)
[![Docker Hub](https://img.shields.io/badge/docker-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/xoxys/ansible-doctor/)
[![Python Version](https://img.shields.io/pypi/pyversions/ansible-doctor.svg)](https://pypi.org/project/ansible-doctor/)
[![PyPi Status](https://img.shields.io/pypi/status/ansible-doctor.svg)](https://pypi.org/project/ansible-doctor/)
[![PyPi Release](https://img.shields.io/pypi/v/ansible-doctor.svg)](https://pypi.org/project/ansible-doctor/)
[![PyPI Status](https://img.shields.io/pypi/status/ansible-doctor.svg)](https://pypi.org/project/ansible-doctor/)
[![PyPI Release](https://img.shields.io/pypi/v/ansible-doctor.svg)](https://pypi.org/project/ansible-doctor/)
[![License: MIT](https://img.shields.io/github/license/xoxys/ansible-doctor)](LICENSE)
This project is based on the idea (and at some parts on the code) of [ansible-autodoc](https://github.com/AndresBott/ansible-autodoc) by Andres Bott so credits goes to him for his work.
_ansible-doctor_ is a simple annotation like documentation generator based on Jinja2 templates. While _ansible-doctor_ comes with a default template called `readme`, it is also possible to write your own templates. This gives you the ability to customize the output and render the data to every format you like (e.g. html or xml).
_ansible-doctor_ is a simple annotation like documentation generator based on Jinja2 templates. While _ansible-doctor_ comes with a default template called `readme`, it is also possible to write your own templates. This gives you the ability to customize the output and render the data to every format you like (e.g. HTML or XML).
_ansible-doctor_ is designed to work within your CI pipeline to complete your testing and deployment workflow. Releases are available as Python Packages at [GitHub](https://github.com/xoxys/ansible-doctor/releases) or [PyPI](https://pypi.org/project/ansible-doctor/) and as Docker Image at [Docker Hub](https://hub.docker.com/r/xoxys/ansible-doctor).

View File

@ -2,6 +2,7 @@
title: Default settings
---
<!-- markdownlint-disable -->
{{< highlight YAML "linenos=table" >}}
---
# default is your current working dir
@ -36,3 +37,4 @@ exclude_files: []
# - molecule/
# - files/**/*.py
{{< /highlight >}}
<!-- markdownlint-enable -->

View File

@ -18,5 +18,5 @@ docker run \
{{< hint info >}}
**Info**\
Keep in mind, that you have to pass selinux labels (:Z or :z) to your mount option if you are working on selinux enabled systems.
Keep in mind, that you have to pass SELinux labels (:Z or :z) to your mount option if you are working on SELinux enabled systems.
{{< /hint >}}

View File

@ -3,8 +3,9 @@ title: Using pip
---
<!-- markdownlint-disable -->
{{< highlight Shell "linenos=table" >}}
# From PyPI as unprivilegd user
# From PyPI as unprivileged user
$ pip install ansible-doctor --user
# .. or as root
@ -13,3 +14,4 @@ $ sudo pip install ansible-doctor
# From Wheel file
$ pip install https://github.com/xoxys/ansible-doctor/releases/download/v0.1.1/ansible_doctor-0.1.1-py2.py3-none-any.whl
{{< /highlight >}}
<!-- markdownlint-enable -->

View File

@ -6,7 +6,7 @@ title: Usage
ansible-doctor FOLDER
```
If you don't pass a folder to *ansible-doctor* your current working directory will be used. The first step is to identify if the given folder is an ansible role. This check is very simple, if the folder contains a subfolder called `tasks` is MUST be an ansible role! :)
If you don't pass a folder to *ansible-doctor* your current working directory will be used. The first step is to identify if the given folder is an Ansible role. This check is very simple, if the folder contains a subfolder called `tasks` is MUST be an Ansible role! :)
After the successful check, *ansible-doctor* will try to read some static files into a dictionary:
@ -15,6 +15,7 @@ After the successful check, *ansible-doctor* will try to read some static files
This will be the base result set which is used as data source for every output template. Without any work, you will get at least a documentation about available variables and some meta information. Theses basic information can be expanded with a set of available annotations. In general, an annotation is a comment with an identifier. This identifier is followed by colon separated options and ends with a value.
<!-- markdownlint-disable -->
{{< highlight Yaml "linenos=table" >}}
# @identifier option1:option2: <value>
@ -26,8 +27,9 @@ This will be the base result set which is used as data source for every output t
# @end
docker_registry_password: "secret"
{{< /highlight >}}
<!-- markdownlint-enable -->
These list of pre-defined identifiers is currently available:
These list of predefined identifiers is currently available:
* @meta
* @todo