Skip to content
Snippets Groups Projects
README.md 2.36 KiB
Newer Older
# Data Provider

Jan-Niclas Strüwer's avatar
Jan-Niclas Strüwer committed

1. Start the database docker service in `tools/db`.
2. Install [OCCMD](https://gitlab.opencode.de/opencode-analyzer/occmd-public.git) and edit the
Jan-Niclas Strüwer's avatar
Jan-Niclas Strüwer committed
   script `resources/scripts/occmd.sh` to point at the executable.
   The default implementation of the script expects a docker container with the name occmd to be present. A Dockerfile
   is contained in this repository in `tools/occmd`.
3. Set the necessary environment variables, which are used in the application.properties:
Jan-Niclas Strüwer's avatar
Jan-Niclas Strüwer committed
opencode.access-token=${OC_GL_APIKEY} // this is the api key for opencode
# DB Login data
Jan-Niclas Strüwer's avatar
Jan-Niclas Strüwer committed
// either connect to a local postgresql db or the deployed test db
// the test db is a cockroach db and the expected url schema looks as follows:
// #spring.datasource.url=jdbc:postgresql://${host}:26257/${DB_USER}?sslmode=${ssl_mode}&sslrootcert=${ca_crt}&sslcert=${ssl_cert}&sslkey=${ssl_key}
spring.datasource.url=${DB_URL} 
spring.datasource.username=${DB_USER}
spring.datasource.password=${DB_PW}
Jan-Niclas Strüwer's avatar
Jan-Niclas Strüwer committed
# OCCMD specific settings
// path to the occmd tool executable
// this can e.g, be the occmd.sh script in this project
occmd.occmd-path=${OCCMD_PATH}

# API key to access this server's API
Jan-Niclas Strüwer's avatar
Jan-Niclas Strüwer committed
// The api key is needed for all routes.
// the admin password is needed for the repo changed route.
// It is expected as basic auth with the admin username
// details can be found in configuration/security/WebSecurityConfiguration.kt
security.api-key=${API_KEY}
Jan-Niclas Strüwer's avatar
Jan-Niclas Strüwer committed
security.admin-username=${ADMIN_PASSWORD}
security.admin-password=${ADMIN_PASSWORD}
Jan-Niclas Strüwer's avatar
Jan-Niclas Strüwer committed
// a local repository to which the git repositories are temporarily cloned.
// they are automatically deleted after every tool run.
directories.git-clone-target-directory=${GIT_CLONE_TARGET_DIRECTORY}
server.port=${PORT}
```

Make sure that the db settings match the values in the database dockerfile!
If you are using IntelliJ for development it is easiest to create a `.env` file in the `resources` folder.
This file is automatically loaded by the IDE.

4. Import the project into your IDE or use the commandline to build the application and run the server. For details on
   how to run the program manually consider the spring boot documentation.

Jan-Niclas Strüwer's avatar
Jan-Niclas Strüwer committed
### Important Note for the dev deployment and testing.
Jan-Niclas Strüwer's avatar
Jan-Niclas Strüwer committed
The dev ORT API doesn't have results for all projects. Thus make sure to edit the `MetricsService.kt` to
point to the repository with id 106 for testing purposes.

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.