Seadistus

gtm-sync and gtm-api hooks setup

On new repo created

Every time new repo is created in group it should be added to gtm-sync so that we could start gathering data.
Request to make:

curl -H "Content-Type: application/json" \
  --request POST \
  --data '{"url": "<ssh_clone_url>"}' \
  http://<target_url>:<target_port>/repositories

Currently, target port is 8090.
Example:

curl -H "Content-Type: application/json" \
  --request POST \
  --data '{"url": "git@gitlab.cs.ttu.ee:taannu/gtm-taltech.git"}' \
  https://cs.ttu.ee/services/gtm/sync/repositories

To automatically add a newly created repo to group (organise tracking info) you need one more request:

curl -H "Content-Type: application/json" \
  --request POST \
  --data '{ "children": ["<existing_child_group_name>"]}' \
  http://<target_host>:<target_port>/api/groups/<group_name>/children

Currently, target port is 8000
Parent group name is group_name. (Group is created automatically if it does not exist)
Child group name is existing_child_group_name and only already existing groups are allowed there.

Example:

curl -H "Content-Type: application/json" \
  --request POST \
  --data '{ "children": ["gitlab.cs.ttu.ee-taannu-gtm-taltech"]}' \
 https://cs.ttu.ee/services/gtm/api/groups/test_group/children

On every push

A signal must be sent to gtm-sync to indicate new sync is needed.

curl http://<target_host>:<target_port>/repositories/<provider>/<user>/<repo>/sync

Currently, target port is 8090.

Example:

curl https://cs.ttu.ee/services/gtm/sync/repositories/gitlab.cs.ttu.ee/taannu/gtm-taltech/sync