Skip to content

Adding a new repository

a-a-hofmann edited this page Aug 26, 2020 · 4 revisions

To add a new repository, first create the repo and push at least 1 commit to it

Afterwards add the repository URL (for private repos use SSH, see Private repositories) to repository.json. There are two ways to update the repository.jsonfile:

Directly on the server

  1. navigate to project root (where the docker-compose.yml file is):
  2. Run
docker-compose exec course-service /bin/bash

# Install nano, vi or similar as there is no editor already installed e.g.
apt install nano

# add the repository to the json file, with nano
nano access/repositories.json

  1. Exit the container (CTRL+D or exit)
  2. Restart container
docker-compose restart course-service

You can see the server logs with:

docker-compose logs -f course-service

Push to master

Update and push the repository.json https://github.com/mp-access/Course-Service/blob/master/src/main/resources/repositories.json, CI/CD will then deploy the newer version (takes longer)

Webhooks

In order to auto-deploy changes to a course, we need to configure a webhook.

For Github: Settings -> Webhooks -> Add webhook As payload URL: /courses/update/github Set Content type: application/json