allow extra parameters to be passed to apidocs container
This commit is contained in:
@@ -18,4 +18,4 @@ RUN apk --no-cache add \
|
|||||||
ADD ./entrypoint-apidocs.sh /scripts/entrypoint.sh
|
ADD ./entrypoint-apidocs.sh /scripts/entrypoint.sh
|
||||||
RUN chmod +x -R /scripts && mkdir /src
|
RUN chmod +x -R /scripts && mkdir /src
|
||||||
|
|
||||||
ENTRYPOINT /scripts/entrypoint.sh
|
ENTRYPOINT ["/scripts/entrypoint.sh"]
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
#set -x
|
set -x
|
||||||
|
|
||||||
#build
|
#build
|
||||||
docker build --rm -f Dockerfile -t apidocjs:latest .
|
docker build --rm -f Dockerfile -t apidocjs:latest .
|
||||||
|
|
||||||
#test
|
#test
|
||||||
docker run --rm --entrypoint=node apidocjs --version
|
echo node version: "$(docker run --rm --entrypoint=node apidocjs --version)"
|
||||||
docker run --rm apidocjs apidoc | grep 'apidoc.json'
|
# 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
|
#save
|
||||||
docker tag apidocjs:latest dkregistry.xai-corp.net:5000/xaicorp/apidocjs:latest
|
docker tag apidocjs:latest dkregistry.xai-corp.net:5000/xaicorp/apidocjs:latest
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ echo Using file filter: "${FILE_FILTER}"
|
|||||||
echo
|
echo
|
||||||
|
|
||||||
cd /src/ || exit
|
cd /src/ || exit
|
||||||
echo ${APP_DIR} : ${DOCS_DIR} : ${FILE_FILTER}
|
echo "${APP_DIR}" : "${DOCS_DIR}" : "${FILE_FILTER}"
|
||||||
rm -rf ${DOCS_DIR} && mkdir -p ${DOCS_DIR}
|
rm -rf "${DOCS_DIR}" && mkdir -p "${DOCS_DIR}"
|
||||||
apidoc -i ${APP_DIR} -o ${DOCS_DIR} -f ${FILE_FILTER}
|
|
||||||
|
# shellcheck disable=SC2068
|
||||||
|
apidoc -i "${APP_DIR}" -o "${DOCS_DIR}" -f "${FILE_FILTER}" $@
|
||||||
|
|||||||
4
dockerfiles/tasks/apidocjs/test/apidoc.json
Normal file
4
dockerfiles/tasks/apidocjs/test/apidoc.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"name": "Test Api",
|
||||||
|
"version": "0.0.1"
|
||||||
|
}
|
||||||
8
dockerfiles/tasks/apidocjs/test/app/docs.php
Normal file
8
dockerfiles/tasks/apidocjs/test/app/docs.php
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @api {get} /test
|
||||||
|
* @apiName Test endpoint
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
Reference in New Issue
Block a user