{"id":17284650,"url":"https://github.com/exu/testkube-executor-keptn","last_synced_at":"2025-03-26T16:25:59.942Z","repository":{"id":141117987,"uuid":"455520570","full_name":"exu/testkube-executor-keptn","owner":"exu","description":"Executor for Keptn events","archived":false,"fork":false,"pushed_at":"2022-02-04T11:21:32.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-31T21:06:59.745Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/exu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-04T11:21:31.000Z","updated_at":"2022-02-04T11:21:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"322538ed-7580-4a1d-889c-4eaca471861b","html_url":"https://github.com/exu/testkube-executor-keptn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"keptn-sandbox/keptn-service-template-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exu%2Ftestkube-executor-keptn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exu%2Ftestkube-executor-keptn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exu%2Ftestkube-executor-keptn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exu%2Ftestkube-executor-keptn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exu","download_url":"https://codeload.github.com/exu/testkube-executor-keptn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245691048,"owners_count":20656694,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T09:54:38.531Z","updated_at":"2025-03-26T16:25:59.923Z","avatar_url":"https://github.com/exu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README\n\n**BEFORE YOU START**, please be aware that there are more ways to integrate with your service that don't require creating a service from this template, see https://keptn.sh/docs/0.10.x/integrations/how_integrate/ for more details.\n\nExamples:\n\n* Webhooks: https://keptn.sh/docs/0.10.x/integrations/webhooks/\n* Job-Executor-Service: https://github.com/keptn-sandbox/job-executor-service\n\n---\n\nThis is a Keptn Service Template written in GoLang. Follow the instructions below for writing your own Keptn integration.\n\nQuick start:\n\n1. In case you want to contribute your service to keptn-sandbox or keptn-contrib, make sure you have read and understood the [Contributing Guidelines](https://github.com/keptn-sandbox/contributing).\n1. Click [Use this template](https://github.com/keptn-sandbox/keptn-service-template-go/generate) on top of the repository, or download the repo as a zip-file, extract it into a new folder named after the service you want to create (e.g., simple-service) \n1. Replace every occurrence of (docker) image names and tags from `keptnsandbox/keptn-service-template-go` to your docker organization and image name (e.g., `yourorganization/simple-service`)\n1. Replace every occurrence of `keptn-service-template-go` with the name of your service (e.g., `simple-service`)\n1. Optional (but recommended): Create a git repo (e.g., on `github.com/your-username/simple-service`)\n1. Adapt the [go.mod](go.mod) file and change `example.com/` to the actual package name (e.g., `github.com/your-username/simple-service`)\n1. Add yourself to the [CODEOWNERS](CODEOWNERS) file\n1. Initialize a git repository (you can skip this step if you have created your service by clicking on the `Use this template` button): \n  * `git init .`\n  * `git add .`\n  * `git commit -m \"Initial Commit\"`\n1. Optional: Push your code an upstream git repo (e.g., GitHub) and adapt all links that contain `github.com` (e.g., to `github.com/your-username/simple-service`)\n1. Figure out whether your Kubernetes Deployment requires [any RBAC rules or a different service-account](https://github.com/keptn-sandbox/contributing#rbac-guidelines), and adapt [deploy/service.yaml](deploy/service.yaml) accordingly (initial setup is `serviceAccountName: keptn-default`).\n1. Last but not least: Remove this intro within the README file and make sure the README file properly states what this repository is about\n\n---\n\n# keptn-service-template-go\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/keptn-sandbox/keptn-service-template-go)\n[![Go Report Card](https://goreportcard.com/badge/github.com/keptn-sandbox/keptn-service-template-go)](https://goreportcard.com/report/github.com/keptn-sandbox/keptn-service-template-go)\n\nThis implements a keptn-service-template-go for Keptn. If you want to learn more about Keptn visit us on [keptn.sh](https://keptn.sh)\n\n## Compatibility Matrix\n\n*Please fill in your versions accordingly*\n\n| Keptn Version    | [Keptn-Service-Template-Go Docker Image](https://hub.docker.com/r/keptnsandbox/keptn-service-template-go/tags) |\n|:----------------:|:----------------------------------------:|\n|       0.6.1      | keptnsandbox/keptn-service-template-go:0.1.0 |\n|       0.7.1      | keptnsandbox/keptn-service-template-go:0.1.1 |\n|       0.7.2      | keptnsandbox/keptn-service-template-go:0.1.2 |\n\n## Installation\n\nThe *keptn-service-template-go* can be installed as a part of [Keptn's uniform](https://keptn.sh).\n\n### Deploy in your Kubernetes cluster\n\nTo deploy the current version of the *keptn-service-template-go* in your Keptn Kubernetes cluster use the [`helm chart`](chart/Chart.yaml) file,\nfor example:\n\n```console\nhelm install -n keptn keptn-service-template-go chart/\n```\n\nThis should install the `keptn-service-template-go` together with a Keptn `distributor` into the `keptn` namespace, which you can verify using\n\n```console\nkubectl -n keptn get deployment keptn-service-template-go -o wide\nkubectl -n keptn get pods -l run=keptn-service-template-go\n```\n\n### Up- or Downgrading\n\nAdapt and use the following command in case you want to up- or downgrade your installed version (specified by the `$VERSION` placeholder):\n\n```console\nhelm upgrade -n keptn --set image.tag=$VERSION keptn-service-template-go chart/\n```\n\n### Uninstall\n\nTo delete a deployed *keptn-service-template-go*, use the file `deploy/*.yaml` files from this repository and delete the Kubernetes resources:\n\n```console\nhelm uninstall -n keptn keptn-service-template-go\n```\n\n## Development\n\nDevelopment can be conducted using any GoLang compatible IDE/editor (e.g., Jetbrains GoLand, VSCode with Go plugins).\n\nIt is recommended to make use of branches as follows:\n\n* `master` contains the latest potentially unstable version\n* `release-*` contains a stable version of the service (e.g., `release-0.1.0` contains version 0.1.0)\n* create a new branch for any changes that you are working on, e.g., `feature/my-cool-stuff` or `bug/overflow`\n* once ready, create a pull request from that branch back to the `master` branch\n\nWhen writing code, it is recommended to follow the coding style suggested by the [Golang community](https://github.com/golang/go/wiki/CodeReviewComments).\n\n### Where to start\n\nIf you don't care about the details, your first entrypoint is [eventhandlers.go](eventhandlers.go). Within this file \n you can add implementation for pre-defined Keptn Cloud events.\n \nTo better understand all variants of Keptn CloudEvents, please look at the [Keptn Spec](https://github.com/keptn/spec).\n \nIf you want to get more insights into processing those CloudEvents or even defining your own CloudEvents in code, please \n look into [main.go](main.go) (specifically `processKeptnCloudEvent`), [deploy/service.yaml](deploy/service.yaml),\n consult the [Keptn docs](https://keptn.sh/docs/) as well as existing [Keptn Core](https://github.com/keptn/keptn) and\n [Keptn Contrib](https://github.com/keptn-contrib/) services.\n\n### Common tasks\n\n* Build the binary: `go build -ldflags '-linkmode=external' -v -o keptn-service-template-go`\n* Run tests: `go test -race -v ./...`\n* Build the docker image: `docker build . -t keptnsandbox/keptn-service-template-go:dev` (Note: Ensure that you use the correct DockerHub account/organization)\n* Run the docker image locally: `docker run --rm -it -p 8080:8080 keptnsandbox/keptn-service-template-go:dev`\n* Push the docker image to DockerHub: `docker push keptnsandbox/keptn-service-template-go:dev` (Note: Ensure that you use the correct DockerHub account/organization)\n* Deploy the service using `kubectl`: `kubectl apply -f deploy/`\n* Delete/undeploy the service using `kubectl`: `kubectl delete -f deploy/`\n* Watch the deployment using `kubectl`: `kubectl -n keptn get deployment keptn-service-template-go -o wide`\n* Get logs using `kubectl`: `kubectl -n keptn logs deployment/keptn-service-template-go -f`\n* Watch the deployed pods using `kubectl`: `kubectl -n keptn get pods -l run=keptn-service-template-go`\n* Deploy the service using [Skaffold](https://skaffold.dev/): `skaffold run --default-repo=your-docker-registry --tail` (Note: Replace `your-docker-registry` with your DockerHub username; also make sure to adapt the image name in [skaffold.yaml](skaffold.yaml))\n\n\n### Testing Cloud Events\n\nWe have dummy cloud-events in the form of [RFC 2616](https://ietf.org/rfc/rfc2616.txt) requests in the [test-events/](test-events/) directory. These can be easily executed using third party plugins such as the [Huachao Mao REST Client in VS Code](https://marketplace.visualstudio.com/items?itemName=humao.rest-client).\n\n## Automation\n\n### GitHub Actions: Automated Pull Request Review\n\nThis repo uses [reviewdog](https://github.com/reviewdog/reviewdog) for automated reviews of Pull Requests. \n\nYou can find the details in [.github/workflows/reviewdog.yml](.github/workflows/reviewdog.yml).\n\n### GitHub Actions: Unit Tests\n\nThis repo has automated unit tests for pull requests. \n\nYou can find the details in [.github/workflows/CI.yml](.github/workflows/CI.yml).\n\n### GH Actions/Workflow: Build Docker Images\n\nThis repo uses GH Actions and Workflows to test the code and automatically build docker images.\n\nDocker Images are automatically pushed based on the configuration done in [.ci_env](.ci_env) and the two [GitHub Secrets](https://github.com/keptn-sandbox/keptn-service-template-go/settings/secrets/actions)\n* `REGISTRY_USER` - your DockerHub username\n* `REGISTRY_PASSWORD` - a DockerHub [access token](https://hub.docker.com/settings/security) (alternatively, your DockerHub password)\n\n## How to release a new version of this service\n\nIt is assumed that the current development takes place in the master branch (either via Pull Requests or directly).\n\nTo make use of the built-in automation using GH Actions for releasing a new version of this service, you should\n\n* branch away from master to a branch called `release-x.y.z` (where `x.y.z` is your version),\n* write release notes in the [releasenotes/](releasenotes/) folder,\n* check the output of GH Actions builds for the release branch, \n* verify that your image was built and pushed to DockerHub with the right tags,\n* update the image tags in [deploy/service.yaml], and\n* test your service against a working Keptn installation.\n\nIf any problems occur, fix them in the release branch and test them again.\n\nOnce you have confirmed that everything works and your version is ready to go, you should\n\n* create a new release on the release branch using the [GitHub releases page](https://github.com/keptn-sandbox/keptn-service-template-go/releases), and\n* merge any changes from the release branch back to the master branch.\n\n## License\n\nPlease find more information in the [LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexu%2Ftestkube-executor-keptn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexu%2Ftestkube-executor-keptn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexu%2Ftestkube-executor-keptn/lists"}