diff --git a/README.md b/README.md index 320a0a3..c92c172 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/USAGE.md b/USAGE.md new file mode 100644 index 0000000..e575a75 --- /dev/null +++ b/USAGE.md @@ -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) +--------------------- diff --git a/pkgs/feedback/USAGE.md b/pkgs/feedback/USAGE.md new file mode 100644 index 0000000..0a4eaa2 --- /dev/null +++ b/pkgs/feedback/USAGE.md @@ -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:password@gitlab.com | 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" +``` diff --git a/pkgs/store/README.md b/pkgs/store/README.md index f9ce33e..328db8f 100644 --- a/pkgs/store/README.md +++ b/pkgs/store/README.md @@ -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 |