y155.第九章 GitOps从入门到精通 -- Tekton Pipelines快速入门(四)

3.6 在Step中运行脚本

  • 需要在Step中执行复杂操作时,可以使用“script”直接指定要运行的脚本
    • 多行脚本,可以使用“|”启用
    • script同command互斥
root@k8s-master01:~/tekton-and-argocd-in-practise/02-tekton-basics# cat 04-task-step-with-script.yaml 
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: script
spec:
  steps:
    - name: step-with-script
      image: alpine:3.15
      script: |
        #!/bin/sh
        echo "Step with Script..."
        echo "Installing necessary tooling"
        sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g'

猜你喜欢

转载自blog.csdn.net/qq_25599925/article/details/126332112