Skip to content

Commit

Permalink
docs: (#12) Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
keskad committed Nov 8, 2023
1 parent 787b163 commit c077016
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,10 @@ This repository contains a exemplary and fully functional implementation for bas
-----------

[See development API for developing integrations or whole custom controllers](./DEVELOPMENT.md)

[Usage](./USAGE.md)
-------

For end users - `pipelines-feedback-core` is an opinionated framework, so the usage could be different depending on the controller you are going to use.

Check [generic usage](./USAGE.md) tips for common parts of every controller.
14 changes: 14 additions & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Generic usage tips
==================

**Pipelines Feedback** can integrate any CI/CD with any external system to report Pipelines status into. Please choose an implementation you wish to use.

**Known implementations:**
- [For Tekton Pipelines](https://github.com/kube-cicd/pipelines-feedback-tekton)
- [For Kubernetes `kind: Job`](https://github.com/kube-cicd/pipelines-feedback-core/tree/main/pkgs/implementation/batchjob)

[Choosing Store type](./pkgs/store/README.md)
-------------------

[Configuring Feedback Provider (external system link)](./pkgs/feedback/USAGE.md)
---------------------
46 changes: 46 additions & 0 deletions pkgs/feedback/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Feedback Receiver
=================

Configures a connection to external system which will act as a Feedback Receiver.

**Examples:**
- GIT: Update commit status
- JIRA: Update release info


jx-scm
------

Jenkins X go-scm library provides a support for multiple GIT servers like Gitlab.com, Gitlab Self-hosted, GitHub, Gitea self-hosted, Bitbucket.
JX-SCM is configured via `kind: PFConfig` or using a JSON loaded locally at controller startup.

| Name | Example value | Description |
|------------------------------|--------------------------------------|-------------------------------------------------------------------------------------------------------------|
| jxscm.token | glpat-blablabla | Plaintext access token. Avoid using this field. Use `token-secret-name` and `token-secret-key` pair instead |
| jxscm.token-secret-name | my-secret-name | `kind: Secret` name placed in same namespace as `kind: PFConfig` and Pipeline is |
| jxscm.token-secret-key | token | Name of the key in `.data` section of the `kind: Secret` |
| jxscm.git-repo-url | https://username:[email protected] | Full SCM url |
| jxscm.git-kind | gitlab | Jenkins X go-scm git-kind parameter |
| jxscm.git-token | glpat-blablabla | Same as `token` |
| jxscm.git-user | __token__ | |
| jxscm.bb-oauth-client-id | | |
| jxscm.bb-oauth-client-secret | | |
| jxscm.progress-comment | | Go template formatted PR progress comment |
| jxscm.finished-comment | | Go template formatted PR summary comment |


**Example configuration:**

```yaml
---
apiVersion: pipelinesfeedback.keskad.pl/v1alpha1
kind: PFConfig
metadata:
name: keskad-sample-1
namespace: team-1
spec:
jobDiscovery: {}
data:
jxscm.token-secret-name: "some-secret"
jxscm.token-secret-key: "token"
```
31 changes: 30 additions & 1 deletion pkgs/store/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
Store
=====

Stores state. Example: counters how many times a resource was retrieved
Stores state, controller needs a cache. There are so many events being sent to the controller, but not every one deserves processing. That's why Pipelines Feedback is using strong caching.

Choosing a store
----------------

```bash
# use a commandline switch
-s, --store string Sets a Store adapter (default "redis")
```

Memory
------

Stores configuration in Pod's memory. Whole cache is wiped on controller restart. There is no configuration needed.

Redis
-----

Connects to a Redis instance for a persistent cache. Configurable using environment variables.

```bash
# use commandline switch to activate
pipelines-feedback-tekton --store redis
```

| Environment variable name | Default value | Description |
|---------------------------|----------------|-------------------|
| REDIS_HOST | localhost:6379 | Host + port |
| REDIS_DB | 0 | Database number |
| REDIS_PASSWORD | | Optional password |

0 comments on commit c077016

Please sign in to comment.