1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-25 06:17:50 +00:00
catalog/task/write-file/0.1
PuneetPunamiya 5a3e5f630f Adds category field as an annotation as tekton.dev/categories
- Initially all tags were mapped to categories in Hub,
     for e.g. config.yaml: https://github.com/tektoncd/hub/blob/master/config.yaml,
     so whenever a new tag was added in a task it was mapped to a category called `others`.
     Hence before every release we had to manually map these new tags to some category,
     hence after the discussion in Catalog and Hub WG, a proposal was created for adding
     a category as an annotation.

   - PR to update the TEP-0003-Tekton Catalog Organization: https://github.com/tektoncd/community/pull/352

Signed-off-by: Puneet Punamiya <ppunamiy@redhat.com>
2021-07-26 13:15:08 +01:00
..
tests Remove permission check in write-file task 2021-05-11 08:59:45 +01:00
README.md Change write-file permissions -> mode and follow recommendations.md 2021-05-03 04:45:42 +01:00
write-file.yaml Adds category field as an annotation as tekton.dev/categories 2021-07-26 13:15:08 +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://raw.githubusercontent.com/tektoncd/catalog/main/task/write-file/0.1/write-file.yaml

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.

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)