Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Added architcture docs #10

Merged
merged 2 commits into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
![GitHub release (latest by date)](https://img.shields.io/github/v/release/keptn-sandbox/keptn-gitea-provisioner-service)
![Go Report Card](https://goreportcard.com/badge/github.com/keptn-sandbox/keptn-gitea-provisioner-service)

This repository contains a reference implementation for a Keptn service that is able to auto-provision git repositories
in Gitea. This is done by utilizing the extension points for [automatic git provisioning](https://keptn.sh/docs/0.16.x/api/git_provisioning/) in Keptn.
This repository contains a reference implementation for a [Keptn extension which auto-provisions git upstream repositories](https://keptn.sh/docs/0.16.x/api/git_provisioning/) in Gitea.

## Compatibility Matrix

| Keptn Version* | [Keptn-Service-Template-Go Docker Image](https://hub.docker.com/r/keptn-sandbox/keptn-gitea-provisioner-service/tags) |
|:--------------:|:---------------------------------------------------------------------------------------------------------------------:|
| 0.15.1 | keptn-sandbox/keptn-gitea-provisioner-service:0.1.0 |
| 0.15, 0.16 | keptn-sandbox/keptn-gitea-provisioner-service:0.1.0 |

\* This is the Keptn version we aim to be compatible with. Other versions should work too, but there is no guarantee.

Expand Down Expand Up @@ -38,7 +37,7 @@ instance:
*Note*: You can re-use existing credentials by omitting the set parameters of the helm installation; For a full list
of options that can be set see the chart [helm documentation](chart/README.md).

* If there is no Gitea instance installed, an appropriate instance can be created with the following bash script:
* In case you need a simple Gitea instance, you can create it with following bash script:
```bash
#!/bin/bash
NAMESPACE=default #Should be configured to match the GITEA_ENDPOINT environment variable when installing the provisioner
Expand Down Expand Up @@ -98,6 +97,10 @@ To delete a deployed *keptn-gitea-provisioner-service*, use the file `deploy/*.y
helm uninstall -n keptn keptn-gitea-provisioner-service
```

## Architecture

See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).

## License

Please find more information in the [LICENSE](LICENSE) file.
31 changes: 31 additions & 0 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Architecture

Keptn-Gitea-Provisioner-Service is a microservice with a simple job: When a Keptn project without an upstream is created, it creates a git repo and a token on a (remote) Gitea installation, and return the Git Remote URL, username and token, e.g.:

**Request**
```
POST /repository
{
"project": "foobar",
"namespace": "keptn"
}
```

**Response**
```
{
"gitRemoteUrl": "http://gitea-server:3000/xyz/foobar.git",
"gitUser": "xyz",
"gitToken": "<secret-token>"
}
```

See [Keptn API: Repository - addInstance](https://keptn.sh/api/#/repository/addInstance) for more information.

In addition, Keptn-Gitea-Provisioner-Service is also responsible for deleting the upstream repository in Gitea when a Keptn project with an automatic provisioned upstream is deleted.


## Diagram

![Architecture](architecture.png)

Binary file added docs/architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.