How to manage different configuration sources#

Introduction#

Since the Docupedia Fetcher supports environment variables, CLI flags and configuration files as configuration sources, some simple examples for each variant are presented below. In addition, the user can mix and match the specified values so that one, two or all variants can be used simultaneously.

Note

When mixing and matching different types of configuration sources, be aware of their precedence.

Example with environment variables#

In qg-config.yaml below, lines 12 and 13 are required.

 1metadata:
 2  version: v1
 3header:
 4  name: MACMA
 5  version: 1.16.0
 6autopilots:
 7  docupedia-autopilot:
 8    run: |
 9      docupedia-fetcher
10      filecheck exists "docupedia_content.html"
11    env:
12      DOCUPEDIA_PAGE_ID: ${{ env.DOCUPEDIA_PAGE_ID }}
13      DOCUPEDIA_PAT: ${{ secrets.DOCUPEDIA_PAT }}
14finalize:
15  run: |
16    html-finalizer
17chapters:
18  "1":
19    title: Project management
20    requirements:
21      "2.6":
22        title: The requirements for information security and data protection are considered.
23        text: The data protection compliance have to be guaranteed
24        checks:
25          "1.1":
26            title: Download docupedia page content
27            automation:
28              autopilot: docupedia-autopilot

Example with CLI flags#

In qg-config.yaml below, line 9 is required.

 1metadata:
 2  version: v1
 3header:
 4  name: MACMA
 5  version: 1.16.0
 6autopilots:
 7  docupedia-autopilot:
 8    run: |
 9      docupedia-fetcher --pageId ${{ env.DOCUPEDIA_PAGE_ID }} --token ${{ secrets.DOCUPEDIA_PAT }}
10      filecheck exists "docupedia_content.html"
11finalize:
12  run: |
13    html-finalizer
14chapters:
15  "1":
16    title: Project management
17    requirements:
18      "2.6":
19        title: The requirements for information security and data protection are considered.
20        text: The data protection compliance have to be guaranteed
21        checks:
22          "1.1":
23            title: Download docupedia page content
24            automation:
25              autopilot: docupedia-autopilot

Example with configuration file#

In qg-config.yaml below, lines 9 and 12 are required.

 1metadata:
 2  version: v1
 3header:
 4  name: MACMA
 5  version: 1.16.0
 6autopilots:
 7  docupedia-autopilot:
 8    run: |
 9      docupedia-fetcher -c configFile.yaml
10      filecheck exists "docupedia_content.html"
11    env:
12      DOCUPEDIA_PAT: ${{ secrets.DOCUPEDIA_PAT }}
13finalize:
14  run: |
15    html-finalizer
16chapters:
17  "1":
18    title: Project management
19    requirements:
20      "2.6":
21        title: The requirements for information security and data protection are considered.
22        text: The data protection compliance have to be guaranteed
23        checks:
24          "1.1":
25            title: Download docupedia page content
26            automation:
27              autopilot: docupedia-autopilot

The CLI flag for the configuration file can be either -c or --configFile.

The configuration file would look like this:

1pageId: '13121989'

Note

For this case, the DOCUPEDIA_PAT must be set via environment variables or CLI flags.

Upload and run the config#

You can now upload the config to the Yaku service and run it. You should then find the downloaded content in the evidence zip file.