Microservice API to publish DOIs on Datacite.
This service works in tandem with the email relay server Catapulte.
The EnviDat email microservice can be found here.
-
Configure environment variables for use only in local development
- Make a file named
.envin the root directory - Generate the variables using
env.exampleas a reference - New environment variables must be added to:
env.examplebecause this file is used for validationenvironmentsection of thedoi-apicontainers in thedocker-compose.<branch>.ymlfiles
- Make a file named
-
Clone project, make sure virtual environment is installed and activated, and execute the following command:
pdm sync --dev
-
Run the FastAPI development server:
pdm run dev
-
Access local server at: http://127.0.0.1:8000
-
Configure environment variables used in production
-
Create individual CI/CD variables for each variable listed in
env.example -
APP_VERSIONmust be incremented so that a new image is built and the application includes the updated code- Create a git tag for the commit that corresponds to the
APP_VERSION - Update the
versionvalue inpyproject.toml - Also create an entry in the
CHANGELOG
- Create a git tag for the commit that corresponds to the
-
ROOT_PATHis an optional environment variable and should only be used to if the application uses a proxy- Be sure to include a
/before theROOT_PATHvalue - Example configuration:
ROOT_PATH=/doi-api - Click here for the FastAPI documentation about using a proxy server
- Be sure to include a
-
Create individual CI/CD variables for each the following variables (apart from the ones in env.example) that are used for deployment:
Key Example Value APP_VERSION1.1.2ROOT_PATH""INTERNAL_REGregistry-gitlab.org.ch/orgnameEXTERNAL_REGdocker.ioNGINX_IMG_TAG1.25PYTHON_IMG_TAG3.10
-
-
Merge feature/development branch to
maindefault branch- The image related variables can be group variables inherited from the parent group
- To run the pre-commit hooks manually open app in terminal and execute:
pre-commit run --all-files - These hooks ensure that the application uses standard stylistic conventions
- To view or alter the pre-commit hooks see:
.pre-commit-config.yaml
- Tests are located in
tests - To run tests manually open app in terminal and execute:
pytest
- Scripts are located in the
scriptsdirectory
The following employees of the Swiss Federal Institute for Forest, Snow and Landscape Research WSL:
- Ranita Pal
- Rebecca Buchholz
- Sam Woodcock