feat(mkdocs_build): use a pip file for job so that licence scanning can function.

MR !15
This commit is contained in:
2022-01-23 05:31:06 +00:00
parent 18c2e23128
commit 906f09e2d3
2 changed files with 5 additions and 4 deletions

View File

@ -3,13 +3,15 @@
stage: build stage: build
variables: variables:
GIT_DEPTH: 0 GIT_DEPTH: 0
MKDOCS_VERSION: "==1.2.3"
MKDOCS_BUILD_PATH: build MKDOCS_BUILD_PATH: build
MKDOCS_SOURCE_PATH: pages MKDOCS_SOURCE_PATH: pages
DEFAULT_ROOT_DIR: './gitlab-ci'
before_script: before_script:
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME" - mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME"
- if [ ! -f "requirements.txt" ]; then pip install --upgrade pip mkdocs$MKDOCS_VERSION; fi - if [ "0$JOB_ROOT_DIR" == "0" ]; then ROOT_DIR=$DEFAULT_ROOT_DIR; else ROOT_DIR=$JOB_ROOT_DIR ; fi
- if [ -f "requirements.txt" ]; then pip install --upgrade pip mkdocs$MKDOCS_VERSION -r requirements.txt; fi - echo "[DEBUG] ROOT_DIR[$ROOT_DIR]"
- if [ ! -f "requirements.txt" ]; then pip install --upgrade pip -r $ROOT_DIR/mkdocs/requirements.txt; fi
- if [ -f "requirements.txt" ]; then pip install --upgrade pip -r $ROOT_DIR/mkdocs/requirements.txt; pip install -r requirements.txt; fi
script: script:
- mkdocs build --clean --strict - mkdocs build --clean --strict
- mv "$MKDOCS_BUILD_PATH" "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$MKDOCS_BUILD_PATH" - mv "$MKDOCS_BUILD_PATH" "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$MKDOCS_BUILD_PATH"

View File

@ -31,7 +31,6 @@ MKDocs build:
| var name | Description | | var name | Description |
|:----:|:----| |:----:|:----|
| MKDOCS_VERSION | **Optional** The MKDocs version to install. Defaults to `"==1.2.3"` |
| MKDOCS_BUILD_PATH | **Mandatory, if different from default** The path where MKDocs places the build files. Defaults to `build` | | MKDOCS_BUILD_PATH | **Mandatory, if different from default** The path where MKDocs places the build files. Defaults to `build` |
| MKDOCS_INCLUDE_SOURCE | **Optional** Include the build source files in the artifacts. Default is Not set. Any value in this variable, will include the source files. | | MKDOCS_INCLUDE_SOURCE | **Optional** Include the build source files in the artifacts. Default is Not set. Any value in this variable, will include the source files. |
| MKDOCS_SOURCE_PATH | **Optional, if source files are not to be included** Set to the path where mkdocs uses to build the static html. | | MKDOCS_SOURCE_PATH | **Optional, if source files are not to be included** Set to the path where mkdocs uses to build the static html. |