Skip to content

Commit

Permalink
docs: Added architcture docs (#10)
Browse files Browse the repository at this point in the history
* docs: Added architcture docs

Signed-off-by: Christian Kreuzberger <[email protected]>

* review

Signed-off-by: Christian Kreuzberger <[email protected]>
  • Loading branch information
christian-kreuzberger-dtx authored Jul 8, 2022
1 parent 42c847b commit 86b5315
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
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.

0 comments on commit 86b5315

Please sign in to comment.