1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-21 05:55:35 +00:00
catalog/task/github-create-deployment-status/0.1
Quan Zhang e294e1246b [TEP-0110] Update Tekton Catalog installation instructions
Prior to this change, the installation instructions directly use the resource urls in the Catalog repo, which results in tight coupling between the organization and how users fetch resources (as described in TEP-0110). This commit updates the installation guide to install Tekton Catalog resources via Tekton Hub Api: https://github.com/tektoncd/hub/pull/539

This change decouples the Tekton Catalog organization from resouces resolution, which enables Tekton Catalog reorganization.
2022-08-16 16:25:52 +01:00
..
samples Add github-create-deployment-status task 2021-04-02 17:22:46 +01:00
tests Add github-create-deployment-status task 2021-04-02 17:22:46 +01:00
github-create-deployment-status.yaml Add platforms annotation to github- tasks 2021-08-30 09:05:12 +01:00
README.md [TEP-0110] Update Tekton Catalog installation instructions 2022-08-16 16:25:52 +01:00

GitHub Create Deployment Status

The github-create-deployment-status Task lets you create a status for GitHub deployment.

See GitHub's deployment API on Create a deployment status for more information.

Install the Task

kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/github-create-deployment-status/0.1/raw

Secrets

This Task requires access to a GitHub token set via a Kubernetes Secret. By default, the name of this Secret should be github and the secret key should be token, but you can configure this via the GITHUB_TOKEN_SECRET_NAME and GITHUB_TOKEN_SECRET_KEY parameters described below.

To create such a Secret via kubectl:

kubectl create secret generic github --from-literal token="MY_TOKEN"

Token must have repo_deployment scope to create deployment status. See GitHub's documentation on Scopes for OAuth Apps for details.

Parameters

  • GITHUB_HOST_URL: The GitHub host domain. (default: api.github.com)
  • API_PATH_PREFIX: The GitHub Enterprise has a prefix for the API path. (e.g.: /api/v3)
  • REPO_FULL_NAME: The GitHub repository full name. (e.g.: tektoncd/catalog)
  • DEPLOYMENT_ID: The ID of deployment. (e.g.: "1")
  • STATE: The state of the status. This can be one of "error", "failure", "inactive", "in_progress", "queued", "pending" or "success". (e.g.: in_progress)
  • LOG_URL: The full URL of the deployment's output. (default: "")
  • DESCRIPTION: Short description of the status. (default: "")
  • ENVIRONMENT: Name for the target deployment environment. (default: "")
  • ENVIRONMENT_URL: The URL for accessing environment. (default: "")
  • AUTO_INACTIVE: Adds a new inactive status to all prior non-transient, non-production environment deployments with the same repository and environment name as the created status's deployment. (default: "true")
  • GITHUB_TOKEN_SECRET_NAME: The name of the Kubernetes Secret that contains the GitHub token. (default: github).
  • GITHUB_TOKEN_SECRET_KEY: The key within the Kubernetes Secret that contains the GitHub token. (default: token).

Platforms

The Task can be run on linux/amd64, linux/s390x and linux/ppc64le platforms.

Usage

This TaskRun creates a status for the given GitHub deployment.

---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  labels:
    tekton.dev/task: github-create-deployment-status
  name: github-create-tektoncd-catalog-deployment-status
spec:
  taskRef:
    kind: Task
    name: github-create-deployment-status
  params:
    - name: REPO_FULL_NAME
      value: tektoncd/catalog
    - name: DEPLOYMENT_ID
      value: "1"
    - name: STATE
      value: in_progress