allow extra parameters to be passed to apidocs container

This commit is contained in:
2020-05-17 10:26:59 -04:00
parent 4a38cc16f4
commit f2eb584214
5 changed files with 26 additions and 7 deletions

View File

@@ -18,4 +18,4 @@ RUN apk --no-cache add \
ADD ./entrypoint-apidocs.sh /scripts/entrypoint.sh
RUN chmod +x -R /scripts && mkdir /src
ENTRYPOINT /scripts/entrypoint.sh
ENTRYPOINT ["/scripts/entrypoint.sh"]

View File

@@ -1,13 +1,18 @@
#!/usr/bin/env bash
set -e
#set -x
set -x
#build
docker build --rm -f Dockerfile -t apidocjs:latest .
#test
docker run --rm --entrypoint=node apidocjs --version
docker run --rm apidocjs apidoc | grep 'apidoc.json'
echo node version: "$(docker run --rm --entrypoint=node apidocjs --version)"
# shellcheck disable=SC2046
[ -z "$(docker run --rm -u$(id -ru) -v ${PWD}/test:/src apidocjs --silent | grep "not found in block")" ]
ls -l test/build/docs/index.html
##cleanup after test
rm -r test/build
#save
docker tag apidocjs:latest dkregistry.xai-corp.net:5000/xaicorp/apidocjs:latest

View File

@@ -8,6 +8,8 @@ echo Using file filter: "${FILE_FILTER}"
echo
cd /src/ || exit
echo ${APP_DIR} : ${DOCS_DIR} : ${FILE_FILTER}
rm -rf ${DOCS_DIR} && mkdir -p ${DOCS_DIR}
apidoc -i ${APP_DIR} -o ${DOCS_DIR} -f ${FILE_FILTER}
echo "${APP_DIR}" : "${DOCS_DIR}" : "${FILE_FILTER}"
rm -rf "${DOCS_DIR}" && mkdir -p "${DOCS_DIR}"
# shellcheck disable=SC2068
apidoc -i "${APP_DIR}" -o "${DOCS_DIR}" -f "${FILE_FILTER}" $@

View File

@@ -0,0 +1,4 @@
{
"name": "Test Api",
"version": "0.0.1"
}

View File

@@ -0,0 +1,8 @@
<?php
/**
* @api {get} /test
* @apiName Test endpoint
*
* @return int
*/