Compare commits

...

10 Commits

Author SHA1 Message Date
Alexandre AGOSTINHO c940f89f84 update readme
2 years ago
Alexandre AGOSTINHO 10073a1d5f fix typo
continuous-integration/drone/push Build is passing Details
2 years ago
Alexandre AGOSTINHO 17efe3ec44 modif on doxygen gen
continuous-integration/drone/push Build was killed Details
2 years ago
Alexandre AGOSTINHO 2ab70080f7 add mkdir doxygen
continuous-integration/drone/push Build is passing Details
2 years ago
Alexandre AGOSTINHO a89acb8ada change on build *
continuous-integration/drone/push Build is passing Details
2 years ago
Alexandre AGOSTINHO c3794e303e change on build
continuous-integration/drone/push Build is failing Details
2 years ago
Alexandre AGOSTINHO 411a1fcebf modif doxygen gen 2
continuous-integration/drone/push Build is passing Details
2 years ago
Alexandre AGOSTINHO be1a169cd8 modif doxygen gen
2 years ago
Alexandre AGOSTINHO f555d3a403 retry
continuous-integration/drone/push Build is passing Details
2 years ago
Alexandre AGOSTINHO 871015731e correction on doxygen.sh
continuous-integration/drone/push Build is passing Details
2 years ago

@ -3,6 +3,8 @@ type: docker
name: build
trigger:
branch:
- build
event:
- push
@ -17,13 +19,11 @@ steps:
- name: docker-build
image: plugins/docker
depends_on:
- key-setup
settings:
dockerfile: Dockerfile
context: .
registry: hub.codefirst.iut.uca.fr
repo: hub.codefirst.iut.uca.fr/maxime.batista/codefirst-docdeployer
repo: hub.codefirst.iut.uca.fr/alexandre.agostinho/codefirst-docdeployer
username:
from_secret: SECRET_REGISTRY_USERNAME
password:

@ -1,16 +1,26 @@
# Docdeployer
Usage:
A Drone CI tool to easily deploy documentation on CodeDoc
## Note
This repo is forked from <https://codefirst.iut.uca.fr/git/maxime.batista/codefirst-docdeployer>.
I only made a few small changes to this repository to adapt it to my way of working.
## Usage:
```yml
steps:
- name: swagger-doc
image: hub.codefirst.iut.uca.fr/maxime.batista/codefirst-docdeployer
- name: generate-and-deploy-docs
image: hub.codefirst.iut.uca.fr/alexandre.agostinho/codefirst-docdeployer:latest
failure: ignore
volumes:
- name: docs
path: /docs
commands:
- /entrypoint.sh <arguments>
```
## `entrypoint.sh`
`entrypoint.sh`
This command generates the documentation and deploys it on your CodeDoc space
### Arguments
@ -20,25 +30,15 @@ This command generates the documentation and deploys it on your CodeDoc space
- `-t --type [docusaurus|doxygen|mdbook|swagger]` type of documentation generator to use. - **required**
- `-d --dest [dir]` path to where to put the documentation outputs in your repository's CodeDoc space - **optional <u>!! cannot be absolute !!</u>**
Note !
For swagger and doxygen, you have to pass the configuration file instead of a directory
Usage examples :
### Examples :
```
/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 -b main -l ./src/Doxyfile -t doxygen -d sourcecode_documentation
/entrypoint.sh -b main -l ./documentation/doxygen/ -t doxygen -d sourcecode_documentation
/entrypoint.sh -l ./doc -t mdbook -d book
```
### How to add a custom documentation generator ?
The `-t <g>` (`--type <g>`) option lookups for a generator script `<g>`.sh to be present in the `/generators`
(ex: `--type doxygen` searchs for a `/generators/doxygen.sh` file script).
You can add your own generator by simply moving your script into the `/generators` folder
---
Furthermore, your generator MUST follow below specifications :
* Define a `generate()` function that will be called, assuming that `$1` equals to the value passed after `-l` (`--loc`) which is the documentation sources location
* Define a `GEN_PATH` variable which is the path of generated outputs
* Place generated outputs in the `GEN_PATH` folder, the caller will then upload generated sources onto the user's CodeDoc space
For more informations, check the [original repository](https://codefirst.iut.uca.fr/git/maxime.batista/codefirst-docdeployer).

@ -56,14 +56,14 @@ fi
RELATIVE_PATH=$(echo "$DRONE_REPO_OWNER/$DRONE_REPO_NAME/$DEST/" | tr -s "/")
. "$GENERATOR_SCRIPT"
generate "$DOC_DIR" # generates doc using the wanted generator
if [[ -n $BRANCH && ! $DRONE_BRANCH =~ $BRANCH ]]; then
echo "ignoring deploy step since current branch doesn't match $BRANCH"
exit
fi
. "$GENERATOR_SCRIPT"
generate "$DOC_DIR" # generates doc using the wanted generator
SERVER_TARGET="/usr/share/nginx/html/$RELATIVE_PATH"
# launches rsync in archive, verbose and compression mode

@ -7,9 +7,7 @@ generate() {
exit 1
fi
doxygen -u
doxygen "$1"
mkdir -p $GEN_PATH
mv html/* $GEN_PATH
cd "$1"
(cat Doxyfile; echo -e "\nOUTPUT_DIRECTORY = \nHTML_OUTPUT = $GEN_PATH") | doxygen -
}

Loading…
Cancel
Save