Skip to content

Adapter between Learning Management System and GitLab

Notifications You must be signed in to change notification settings

ai-lenok/gitlab-adapter

Repository files navigation

GitLab Adapter

Build status

Adapter between Learning Management System and GitLab

Features

  • Create repository
  • Delete repository
  • Verify that the latest build in the repository was successful

Ways to work

  • HTTP server
  • Command Line Interface

HTTP examples

RESTful client

Health check

GET http://{{host}}/health

Configuration

All necessary configs you can put to config/application.yaml file

Or put like environment variables with prefix GA_

Or put on command line parameters

Example

Config file

gitlab:
  host: "https://gitlab.com"
  token: "change-me"

Environment variables

export GA_GITLAB_HOST="https://gitlab.com"
export GA_GITLAB_TOKEN="change-me"

Command line parameters

gitlab-adapter start-server --gitlab.host "https://gitlab.com" --gitlab.token "change-me"

Work

Create repository

CLI

gitlab-adapter create-repo --namespace 1234567890 --name test-name --path test-path --description "Description repo"

HTTP

POST http://{{host}}/api/v1/project

Delete repository

CLI

gitlab-adapter delete-repo --project-id 1000000000

HTTP

DELETE http://{{host}}/api/v1/project

Verify that the latest build in the repository was successful

CLI

gitlab-adapter verify-pipeline --project-id 1000000000
  • Return status 0 - success
  • Return status 1 - failed

HTTP

POST http://{{host}}/api/v1/project/verify-pipeline
  • Return status 204 - success
  • Return status 409 - failed

App

Build

make build

Remove all artefacts

make clean

Run server

make start-server

Docker

Build

docker image build --tag IMAGE_NAME .

Run

docker container run --publish 8080:8080 --volume ./config/:/app/config/ ghcr.io/ai-lenok/gitlab-adapter:main

Docker-compose

docker-compose up --detach

Kubernetes

Run

kubectl apply --filename manifest/

Clean

kubectl delete --filename manifest/