diff --git a/entrypoint.sh b/entrypoint.sh index 5e62099..49f7ca5 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -52,7 +52,8 @@ fi generate "$DOC_DIR" # generates doc using the wanted generator -SERVER_TARGET="/usr/share/nginx/html/$DRONE_REPO_OWNER/$DRONE_REPO_NAME/$DEST" +RELATIVE_PATH=$(echo "$DRONE_REPO_OWNER/$DRONE_REPO_NAME/$DEST/" | tr -s "/") +SERVER_TARGET="/usr/share/nginx/html/$RELATIVE_PATH" # launches rsync in archive, verbose and compression mode # creates target directory ($SERVER_TARGET) on server @@ -62,4 +63,4 @@ rsync -avz \ -e "ssh -o StrictHostKeyChecking=no" \ --delete "$GEN_PATH"/* root@nginx:"$SERVER_TARGET" -echo "documentation generated and deployed at https://codefirst.iut.uca.fr/documentation/$DRONE_REPO_OWNER/$DRONE_REPO_NAME/$DEST/index.html" +echo "documentation generated and deployed at https://codefirst.iut.uca.fr/documentation/${RELATIVE_PATH}index.html"