From c68e9ec47ef8f24c25b561748255323766e9f67a Mon Sep 17 00:00:00 2001 From: Thomas BELLEMBOIS Date: Sun, 17 Nov 2024 19:50:57 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'entrypoint.sh'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entrypoint.sh | 71 +++------------------------------------------------ 1 file changed, 4 insertions(+), 67 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 14451ac..c8f18a9 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,82 +3,19 @@ echo "Repository name: "$DRONE_REPO_NAME echo "Repository owner: "$DRONE_REPO_OWNER -echo "NODOXYGEN: "$NODOXYGEN -echo "NODUSAURUS: "$NODUSAURUS -echo "NOSWAGGER: "$NOSWAGGER - -echo "Generating and deploying documentation for user $DRONE_REPO_OWNER and repository $DRONE_REPO_NAME" +echo "Generating and deploying stryker for user $DRONE_REPO_OWNER and repository $DRONE_REPO_NAME" # /docs must be declared as a temporary volume in drone.yml -mkdir -p /docs/doxygen/ -mkdir -p /docs/docusaurus/ +mkdir -p /docs/stryker/ # Check documentation directory syntax. DOCDIR="Documentation" [ -d "/drone/src/documentation" ] && DOCDIR="documentation" -# Generate doxygen. -if [[ -z "${NODOXYGEN}" ]] -then - echo "- generating doxygen" - - [ -d "/drone/src/$DOCDIR/doxygen" ] && cd /drone/src/$DOCDIR/doxygen && doxygen Doxyfile -else - # Create empty directory for rsync to delete remote content. - rm -Rf /docs/doxygen/ - mkdir -p /docs/doxygen/ -fi - -# Generate docusaurus. -if [[ -z "${NODOCUSAURUS}" ]] -then - echo "- generating docusaurus" - - [ -d "/drone/src/$DOCDIR/docusaurus" ] && cd /drone/src/$DOCDIR/docusaurus && npm install && npm run build -else - # Create empty directory for rsync to delete remote content. - rm -Rf /drone/src/$DOCDIR/docusaurus/build/ - mkdir -p /drone/src/$DOCDIR/docusaurus/build/ -fi - -# Generate swagger CLICKME file. -if [[ -z "${NOSWAGGER}" ]] -then - echo "- generating swagger" - - swaggerfile=$(find /docs -maxdepth 1 -type f -iname "swagger.*" -printf "%f" -quit) - if [[ ! -z "$swaggerfile" ]] - then - echo " - - - - - -

Suivez ce lien.

- - " > /docs/CLICKME.html - - echo "- pushing swagger on remote" - - rsync --rsync-path="mkdir -p /usr/share/nginx/html/$DRONE_REPO_OWNER/swagger/$DRONE_REPO_NAME/ && rsync" -e "ssh -o StrictHostKeyChecking=no" -avz --delete /docs/{swagger.*,CLICKME.html} root@nginx:/usr/share/nginx/html/$DRONE_REPO_OWNER/swagger/$DRONE_REPO_NAME/ - else - echo "- deleting swagger from remote" - - mkdir /docs/empty/ - rsync --rsync-path="mkdir -p /usr/share/nginx/html/$DRONE_REPO_OWNER/swagger/$DRONE_REPO_NAME/ && rsync" -e "ssh -o StrictHostKeyChecking=no" -avz --delete /docs/empty/ root@nginx:/usr/share/nginx/html/$DRONE_REPO_OWNER/swagger/$DRONE_REPO_NAME/ - fi - -fi - cd /drone/src/$DOCDIR -echo "- rsync doxygen with remote" - -[ -d "/drone/src/$DOCDIR/doxygen" ] && rsync --rsync-path="mkdir -p /usr/share/nginx/html/$DRONE_REPO_OWNER/doxygen/$DRONE_REPO_NAME/ && rsync" -e "ssh -o StrictHostKeyChecking=no" -avz --delete /docs/doxygen/ root@nginx:/usr/share/nginx/html/$DRONE_REPO_OWNER/doxygen/$DRONE_REPO_NAME/ - -echo "- rsync docusaurus with remote" +echo "- rsync stryker with remote" -[ -d "/drone/src/$DOCDIR/docusaurus" ] && rsync --rsync-path="mkdir -p /usr/share/nginx/html/$DRONE_REPO_OWNER/docusaurus/$DRONE_REPO_NAME/ && rsync" -e "ssh -o StrictHostKeyChecking=no" -avz --delete docusaurus/build/ root@nginx:/usr/share/nginx/html/$DRONE_REPO_OWNER/docusaurus/$DRONE_REPO_NAME/ +[ -d "/drone/src/$DOCDIR/stryker" ] && rsync --rsync-path="mkdir -p /usr/share/nginx/html/$DRONE_REPO_OWNER/stryker/$DRONE_REPO_NAME/ && rsync" -e "ssh -o StrictHostKeyChecking=no" -avz --delete /docs/stryker/ root@nginx:/usr/share/nginx/html/$DRONE_REPO_OWNER/stryker/$DRONE_REPO_NAME/ exit 0 \ No newline at end of file