From f8b70220e3be2bd09cbc52b00acae23fc4e8bcd9 Mon Sep 17 00:00:00 2001 From: Override-6 Date: Sun, 8 Jan 2023 17:51:07 +0100 Subject: [PATCH] changed options labels, swagger generator now looks for the given destination path as a file instead of as a directory that contains a swagger.* file pattern --- README.md | 10 +++++----- entrypoint.sh | 8 ++++---- generators/swagger.sh | 14 +++++++------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 34731e0..f19bd40 100644 --- a/README.md +++ b/README.md @@ -15,15 +15,15 @@ This command generates the documentation and deploys it on your CodeDoc space ### arguments -- `-d --dir [dir]` path to the documentation root - **required** +- `-l --loc [dir]` location of the documentation sources root - **required** - `-t --type [docusaurus|doxygen|swagger]` type of documentation generator to use. - **required** -- `-l --dest [dir]` path to where to put the documentation outputs in your repository's CodeDoc space - **optional !! cannot be absolute !!** +- `-d --dest [dir]` path to where to put the documentation outputs in your repository's CodeDoc space - **optional !! cannot be absolute !!** usage examples : ``` -/entrypoint.sh -d ./documentation/api -t swagger -l api_documentation -/entrypoint.sh -d ./documentation/app -t docusaurus -l application_documentation -/entrypoint.sh -d ./src -t doxygen -l sourcecode_documentation +/entrypoint.sh -l ./documentation/api/api-swagger.yml -t swagger -d api_documentation +/entrypoint.sh -l ./documentation/app -t docusaurus -d application_documentation +/entrypoint.sh -l ./src -t doxygen -d sourcecode_documentation ``` diff --git a/entrypoint.sh b/entrypoint.sh index fc28b2c..9dbbbfe 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -8,9 +8,9 @@ echo "Generating and deploying documentation for user $DRONE_REPO_OWNER and repo help() { cat <&2 + if [[ ! "$1" ]]; then + echo "missing swagger config file ($1)" >&2 fi + mkdir -p $GEN_PATH + echo " - + -

Suivez ce lien.

+

Suivez ce lien.

" > $GEN_PATH/CLICKME.html - mkdir -p $GEN_PATH - mv "$SWAGGER_FILE" $GEN_PATH + mv "$1" $GEN_PATH }