diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 09f4f73b2ad8df1b89b7de8b317cf2399707fe5d..080607f38260a39693df148e0d735022af755a9c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -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 diff --git a/Dockerfile b/Dockerfile index 98f9413ad77e04d088488b521f067d2334cc2a65..2b07365fd71184083ee676189539b68bd21ea864 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,10 @@ # 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/* diff --git a/README.md b/README.md index 5094f5152c39d8ab94e50bad5cf90a266a4f631f..3907087c07e5e768974987ba78b103065b2b57b3 100644 --- a/README.md +++ b/README.md @@ -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.