Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/openshift-pipelines/setup-tektoncd
GitHub Action to rollout Tekton Pipeline and auxiliary components
https://github.com/openshift-pipelines/setup-tektoncd
actions pipeline tektoncd
Last synced: 13 days ago
JSON representation
GitHub Action to rollout Tekton Pipeline and auxiliary components
- Host: GitHub
- URL: https://github.com/openshift-pipelines/setup-tektoncd
- Owner: openshift-pipelines
- License: apache-2.0
- Created: 2023-03-14T09:52:22.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-02T10:36:26.000Z (about 1 month ago)
- Last Synced: 2025-01-02T11:29:01.739Z (about 1 month ago)
- Topics: actions, pipeline, tektoncd
- Language: Shell
- Homepage: https://github.com/tektoncd/pipeline
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![use-action][useActionWorkflowBadge]][useActionWorkflow]
`setup-tektoncd`
----------------Action to rollout [Tekton Pipeline][githubTektonPipeline], [CLI (`tkn`)][githubTektonCLI] and a [Container-Registry][containerRegistry] instance, setting up the environment for testing using these components.
# GitHub Action Usage
Example usage below with inputs using default values:
```yaml
---
jobs:
setup-tektoncd:
steps:
# using KinD to provide the Kubernetes instance and kubectl
- uses: helm/[email protected]
with:
cluster_name: kind# setting up Tekton Pipelines, CLI and additional components...
- uses: openshift-pipelines/setup-tektoncd@v1
with:
pipeline_version: latest
feature_flags: '{}'
cli_version: latest
setup_registry: "true"
patch_etc_hosts: "true"
```The action uses the current Kubernetes instance available ([KinD][sigsKinD] for example), thus requires `kubectl` on the `${PATH}`.
## Inputs
| Input | Required | Description |
|:--------------------|:--------:|:------------------------------------------------|
| `pipeline_version` | `false` | Tekton Pipeline version |
| `feature_flags` | `false` | Tekton Pipeline feature flags (JSON) payload |
| `cli_version` | `false` | Tekton CLI (tkn) version |
| `setup_registry` | `false` | Rollout a Container-Registry (v2) |
| `patch_etc_hosts` | `false` | Add Container-Registry hostname to `/etc/hosts` |# Components
## Tekton Pipelines
[Tekton Pipelines][githubTektonPipeline] is deployed on the namespace `tekton-pipelines` and the involved deployments are followed until completion, so the setup process waits until the instances are available and in case of error the workflow is interrupted.
### Feature-Flags
Tekton Pipelines exposes [feature-flags][githubTektonFeatureFlags] using a `ConfigMap` named `feature-flags`. These flags can be set using the the input `feature_flags`, a JSON formated string containing the the respective flags and values. For example:
```yaml
---
jobs:
setup-tektoncd:
steps:
- uses: openshift-pipelines/setup-tektoncd@v1
with:
feature_flags: '{ "enable-custom-tasks": "true" }'
```The result is observed on the following example:
```
$ kubectl --namespace=tekton-pipelines get configmap feature-flags --output=json |jq '.data'
{
// ...
"enable-custom-tasks": "true",
// ...
}
```## CLI (`tkn`)
[Tekton CLI][githubTektonCLI] is installed on `/usr/local/bin` directory and uses the same Kubernetes context than `kubectl`.
## Container-Registry
A [Container-Registry][containerRegistry] instance is deployed on the `registry` namespace using the same rollout approach than Tekton Pipelines.
The registry is available on port `32222` and uses the Kubernetes internal service hostname, `registry.registry.svc.cluster.local`, which means the fully qualified container images (plus tag) will look like the example below:
```text
registry.registry.svc.cluster.local:32222/namespace/project:tag
```The registry does not require authentication, uses HTTP protocol, is available outside of the Kubernetes instance as well. The Action Input `patch_etc_hosts` makes the registry hostname resolve to `127.0.0.1` and the service exposes the port `32222` as a `hostPort` too.
# Scripts
Alternatively, you can run the scripts directly to rollout Tekton Pipelines and the other components, the recommended approach is using a `.env` file with the required [inputs](./inputs.sh).
```bash
cat >.env <