mirror of
https://github.com/tektoncd/catalog.git
synced 2024-11-23 06:08:46 +00:00
a17a8cf3d4
Changes include: - adds version label - adds a minimum pipeline versions supported by the task - adds display name for task - adds tags for task - modified description to add a summary This patch moves the buildid files to the task directory and renames the yaml file - The yaml filename and directory name is changed to match the resource name. Issue: #386 Signed-off-by: Shivam Mukhade <smukhade@redhat.com>
40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
apiVersion: tekton.dev/v1beta1
|
|
kind: Task
|
|
metadata:
|
|
name: generate-build-id
|
|
labels:
|
|
app.kubernetes.io/version: "0.1"
|
|
annotations:
|
|
tekton.dev/pipelines.minVersion: "0.12.1"
|
|
tekton.dev/tags: build-tool
|
|
tekton.dev/displayName: "buildid"
|
|
spec:
|
|
description: >-
|
|
Given a base version, this task generates a unique build id by appending
|
|
the base-version to the current timestamp.
|
|
|
|
params:
|
|
- name: base-version
|
|
description: Base product version
|
|
type: string
|
|
default: "1.0"
|
|
results:
|
|
- name: timestamp
|
|
description: Current timestamp
|
|
- name: build-id
|
|
description: ID of the current build
|
|
steps:
|
|
- name: get-timestamp
|
|
image: bash:latest
|
|
script: |
|
|
#!/usr/bin/env bash
|
|
ts=`date "+%Y%m%d-%H%M%S"`
|
|
echo "Current Timestamp: ${ts}"
|
|
echo ${ts} | tr -d "\n" | tee $(results.timestamp.path)
|
|
- name: get-buildid
|
|
image: bash:latest
|
|
script: |
|
|
#!/usr/bin/env bash
|
|
ts=`cat $(results.timestamp.path)`
|
|
buildId=$(inputs.params.base-version)-${ts}
|
|
echo ${buildId} | tr -d "\n" | tee $(results.build-id.path) |