initial commit
This commit is contained in:
21
dev/tekton/tasks/timestamp/timestamp-task.yaml
Normal file
21
dev/tekton/tasks/timestamp/timestamp-task.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: Task
|
||||
metadata:
|
||||
name: timestamp
|
||||
spec:
|
||||
results:
|
||||
- name: timestamp
|
||||
steps:
|
||||
- name: timestamp
|
||||
image: busybox
|
||||
script: |
|
||||
#!/bin/sh
|
||||
# Get the current date-time in YYYYMMDD_HHMMSS format
|
||||
TIMESTAMP=$(date +"%d%h%m%s")
|
||||
echo $TIMESTAMP > $(results.timestamp.path)
|
||||
echo "TIMESTAMP= " $TIMESTAMP
|
||||
if [[ "$TIMESTAMP" =~ ^[a-zA-Z0-9_.-]+$ ]]; then
|
||||
echo "TIMESTAMP is valid"
|
||||
else
|
||||
echo "TIMESTAMP is invalid"
|
||||
fi
|
||||
Reference in New Issue
Block a user