Skip to content
Snippets Groups Projects
Commit 268c1540 authored by Frank Sauerburger's avatar Frank Sauerburger
Browse files

Merge branch '11-ci-for-readme' into 'master'

Resolve "CI for README"

Closes #11

See merge request !5
parents 3dbb1859 a60a7a13
No related tags found
1 merge request!5Resolve "CI for README"
Pipeline #
image: ${CI_REGISTRY}/${CI_PROJECT_PATH}/ubuntu_python3:latest
image: ${CI_REGISTRY_IMAGE}
stages:
- test
......@@ -14,5 +14,12 @@ doxec_doctest:
script:
- python3 -m doctest doxec/*.py
README:
stage: test
variables:
DOXEC_COLOR: 0
script:
- python3 setup.py install
- bin/doxec --color README.md
# This image is intended for the git CI
FROM ubuntu:16.04
LABEL maintainer "frank@sauerburger.com"
RUN apt-get update && apt-get install -y \
python3 \
python3 python3-setuptools git recode\
&& rm -rf /var/lib/apt/lists/*
......@@ -16,9 +16,16 @@ This ensures that the code snippets work as intended.
You can simply clone the repository and run the setup script to get doxec.
<!-- console
```bash
$ git clone https://srv.sauerburger.com/esel/doxec.git doxec_install
$ cd doxec_install
$ git clone https://srv.sauerburger.com/frank/doxec.git doxec_install
```
-->
```bash
$ git clone https://srv.sauerburger.com/frank/doxec.git doxec_install
$ cd doxec_install
$ python3 setup.py install
```
......@@ -82,6 +89,8 @@ accepts `<pre>` and `</pre>` as code block delimiters.
### Example
A full example of a imaginary bash tutorial (hello_world.md) can look like this.
<!-- write hello_world.md -->
<pre>
A mandatory step in learning a new technology in computer science is to
run a 'hello world' example. Your first step in bash should be no exception.
......@@ -95,18 +104,26 @@ Hello World!
```
</pre>
<!-- console
```
$ recode html..ascii hello_world.md
```
-->
To verify that the code snipped in this tutorial works as expected run
<!-- console_output -->
```bash
$ doxec hello_world.md
/home/esel/rpriv/doxec/hello_world.md:6 console_output ...
Doxec -- Copyright (c) 2017 Frank Sauerburger
/builds/frank/doxec/hello_world.md:6 console_output ...
--- $ echo "Hello World!"
--- Hello World!
/home/esel/rpriv/doxec/hello_world.md:6 console_output ... done
/builds/frank/doxec/hello_world.md:6 console_output ... done
--------------------------------------------------------------------------------
Failed: 0
Total: 1
```
The *console_output* command runs the lines starting with `$` in a bash shell
and compares the output list below.
......@@ -137,7 +154,3 @@ The following table summarizes the implemented commands.
| `console` | *none* | Run all lines starting with `$`. All other lines are ignored. This operation fails, if the return value of a command is non-zero. |
| `console_output` | *none* | Run all lines starting with `$`. All following lines without a leading `$`, are compared to the `stdout` of the previous command. This operation fails, if the outputs differ, or the return value is non-zero. |
# Trivia
In this early version doxec I have not implemented some kind of meta-execution to
run doxec on this README file, so ironically the tutorial for doxec could be
out-of-sync with the actual code.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment