Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ai-lenok/gitlab-adapter
Adapter between Learning Management System and GitLab
https://github.com/ai-lenok/gitlab-adapter
cobra-cli docker docker-compose ghcr gin gitlab golang kubernetes viper
Last synced: about 1 month ago
JSON representation
Adapter between Learning Management System and GitLab
- Host: GitHub
- URL: https://github.com/ai-lenok/gitlab-adapter
- Owner: ai-lenok
- Created: 2023-06-08T13:18:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-10T17:59:50.000Z (over 1 year ago)
- Last Synced: 2024-06-21T08:22:29.632Z (6 months ago)
- Topics: cobra-cli, docker, docker-compose, ghcr, gin, gitlab, golang, kubernetes, viper
- Language: Go
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitLab Adapter
[![Build status](https://github.com/ai-lenok/gitlab-adapter/actions/workflows/workflow.yml/badge.svg?branch=main)](https://github.com/ai-lenok/gitlab-adapter/actions/workflows/workflow.yml)
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](test-http-client/client.http)
### Health check
```shell
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
```yaml
gitlab:
host: "https://gitlab.com"
token: "change-me"
```#### Environment variables
```shell
export GA_GITLAB_HOST="https://gitlab.com"
export GA_GITLAB_TOKEN="change-me"
```#### Command line parameters
```shell
gitlab-adapter start-server --gitlab.host "https://gitlab.com" --gitlab.token "change-me"
```## Work
### Create repository
### CLI
```shell
gitlab-adapter create-repo --namespace 1234567890 --name test-name --path test-path --description "Description repo"
```### HTTP
```shell
POST http://{{host}}/api/v1/project
```### Delete repository
### CLI
```shell
gitlab-adapter delete-repo --project-id 1000000000
```### HTTP
```shell
DELETE http://{{host}}/api/v1/project
```### Verify that the latest build in the repository was successful
### CLI
```shell
gitlab-adapter verify-pipeline --project-id 1000000000
```* Return status 0 - success
* Return status 1 - failed### HTTP
```shell
POST http://{{host}}/api/v1/project/verify-pipeline
```* Return status 204 - success
* Return status 409 - failed## App
### Build
```shell
make build
```### Remove all artefacts
```shell
make clean
```### Run server
```shell
make start-server
```## Docker
### Build
```shell
docker image build --tag IMAGE_NAME .
```### Run
```shell
docker container run --publish 8080:8080 --volume ./config/:/app/config/ ghcr.io/ai-lenok/gitlab-adapter:main
```#### Docker-compose
```shell
docker-compose up --detach
```## Kubernetes
### Run
```shell
kubectl apply --filename manifest/
```### Clean
```shell
kubectl delete --filename manifest/
```