1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-24 06:15:46 +00:00
catalog/task/write-file/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
..
tests
README.md [TEP-0110] Update Tekton Catalog installation instructions 2022-08-16 16:25:52 +01:00
write-file.yaml Add platforms annotation to several tasks 2021-10-18 15:35:34 +01:00

Write a file to a workspace

This task can be used to write a file onto the output workspace. Use parameter expansion to insert variable content into the written file. It can also set specific permissions on the file.

Install the Task

kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/write-file/0.1/raw

Parameters

  • path: Relative path to create within the workspace. Directories will be created as necessary.
  • mode: chmod-style mode string to apply to the file. Note that mode will not be applied to created directories.
  • contents: Contents of the file to create. Note that octal numbers need quoting in YAML.

Platforms

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

Usage

This example task generates a random password from the pipeline run's unique id.

- name: output-credentials
  taskRef:
    name: write-file
    kind: Task
  workspaces:
    - name: output
      workspace: shared-workspace
  params:
    - name: path
      value: ./config/login.ini
    - name: mode
      value: "0400"
    - name: contents
      value: |
        [credentials]
        user = ze-user
        password = $(context.pipelineRun.uid)