-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from krateoplatformops/41-docs-update
41 docs update
- Loading branch information
Showing
20 changed files
with
857 additions
and
399 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Test and coverage | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: 'stable' | ||
- name: Gather dependencies | ||
run: go mod download | ||
- name: Run coverage | ||
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,73 @@ | ||
# Git Provider | ||
|
||
This is a [Krateo](https://krateoplatformops.github.io/) Provider that clones git repositories (eventually applying templates). | ||
This is a [Krateo](https://krateo.io) Provider that clones git repositories (eventually applying templates). | ||
|
||
## Getting Started | ||
## Summary | ||
|
||
You’ll need a Kubernetes cluster to run against. | ||
- [Summary](#summary) | ||
- [Overview](#overview) | ||
- [Examples](#examples) | ||
- [Configuration](#configuration) | ||
|
||
|
||
> You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster. | ||
## Overview | ||
|
||
Git Provider clones git repositories and may apply [Mustache templates](https://mustache.github.io). It then pushes the cloned and modified repository to a different location. The templating values are retrieved in a configmap referenced in the custom resource. | ||
It provides automatic reconciliation when changes are retrieved from the original repository. | ||
|
||
### Running on the cluster | ||
Git Provider leverages Krateo [provider-runtime](https://docs.krateo.io/key-concepts/kco/#provider-runtime) a production-grade version of the controller-runtime. | ||
|
||
1. Install the provider: | ||
## Examples | ||
|
||
```sh | ||
### Provider Installation | ||
|
||
```bash | ||
$ helm repo add krateo https://charts.krateo.io | ||
$ helm repo update krateo | ||
$ helm install git-provider krateo/git-provider | ||
``` | ||
|
||
2. Install Instances of Custom Resources: | ||
|
||
```sh | ||
$ kubectl apply -f samples/ | ||
``` | ||
|
||
### Test It Out | ||
|
||
1. Start a local cluster using [KIND](https://sigs.k8s.io/kind): | ||
|
||
```sh | ||
$ make kind-up | ||
``` | ||
|
||
2. Run your provider (this will run in the foreground, so switch to a new terminal if you want to leave it running): | ||
|
||
```sh | ||
$ make dev | ||
``` | ||
|
||
### Modifying the API definitions | ||
If you are editing the API definitions, generate the CRDs using: | ||
|
||
```sh | ||
$ make generate | ||
### Manifest application | ||
|
||
```yaml | ||
apiVersion: git.krateo.io/v1alpha1 | ||
kind: Repo | ||
metadata: | ||
name: git-azuredevops-branch-5 | ||
spec: | ||
enableUpdate: false | ||
configMapKeyRef: | ||
key: values | ||
name: filename-replace-values | ||
namespace: default | ||
deletionPolicy: Delete | ||
fromRepo: | ||
authMethod: generic | ||
branch: main | ||
path: skeleton/ | ||
usernameRef: | ||
key: username | ||
name: github-user | ||
namespace: default | ||
secretRef: | ||
key: token | ||
name: github-token | ||
namespace: default | ||
url: https://github.com/matteogastaldello/fromRepo | ||
toRepo: | ||
authMethod: generic | ||
branch: test-5 | ||
usernameRef: | ||
key: username | ||
name: azure-user | ||
namespace: default | ||
secretRef: | ||
key: token | ||
name: azure-token | ||
namespace: default | ||
url: https://matteogastaldello-org@dev.azure.com/matteogastaldello-org/teamproject/_git/repo-generated | ||
unsupportedCapabilities: true | ||
``` | ||
**NOTE:** Run `make help` for more information on all potential `make` targets | ||
## Configuration | ||
To view the CR configuration visit [this link](https://doc.crds.dev/github.com/krateoplatformops/git-provider). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# sample regex patterns | ||
ignore: | ||
- "internal/controllers/repo/repo.go" | ||
- "internal/controllers/repo/setup.go" | ||
- "internal/controllers/git.go" | ||
- "apis" | ||
- "cmd/*.go" |
Oops, something went wrong.