This backend service of the Influenzanet is responsible to manage a study's lifecycle and participants' state through these studies.
With a running go setup, you can use the command
make test
to execute the test script. Makefile expects the test script to be at test/test.sh. The test script could contain DB secrets therefore are not added to this git repository. An example test script can be found in the test
folder.
Currently the tests also require a working database connection to a mongoDB instance.
Dockerfile(s) are located in build/docker
. The default Dockerfile is using a multistage build and create a minimal image base on scratch
.
To trigger the build process using the default docker file call:
make docker
This will use the most recent git tag to tag the docker image.
Feel free to create your own Dockerfile (e.g. compiling and deploying to specific target images), eventually others may need the same.
You can create a pull request with adding the Dockerfile into build/docker
with a good name that it can be identified well, and add a short description to build/docker/readme.md
about the purpose and speciality of it.
An example to run your created docker image - with the set environment variables - can be found here.
API definition and data models for the gRPC service can be found in the api
folder.
To compile the definitions, use:
make api
This generates the go package into pgk/api
.
The repository also contains a Github actions script to build and push a docker image to a dockerhub repository. The action is a manually triggered workflow dispatch that requires the following secrets to be configured in order to run successfully:
Secret Name | Value to be configured |
---|---|
DOCKER_USER | Username of the account authorized to push docker image to the dockerhub repository |
DOCKER_PASSWORD | Password of the account authorized to push docker image to the dockerhub repository |
DOCKER_ORGANIZATION | Organization or collection name that hosts the repository being pushed to |
DOCKER_REPO_NAME | Name of the study-service dockerhub image repository |
Once this is configured, navigate to the Actions tab on Github > Docker Image CI > Run Workflow
By default the version to be tagged is picked from the latest release version, but it can also be overriden by a user specified tag name.