CI&CD
Git代码仓库
Drone
关联GOGS
Jenkins安装
Jenkins问题
JDK及Maven安装
插件安装
创建示例项目
CI流程
Tekton安装
tekton yaml文件
dashboard yaml文件
trigger yaml文件
Tekton使用(demo)
ArgoCD安装
ArgoCD使用
Tekton结合ArgoCD流水线
git-clone.yaml
docker-build.yaml
git-docker-build-pipline.yaml
helm-change-config.yaml
webhook触发器
本文档使用MrDoc发布
返回首页
-
+
helm-change-config.yaml
2023年6月21日 15:40
admin
####需要根据实际修改以下参数 - CONTEXT:工作区需要更改的git项目目录,这个git必须是argocd监听的项目 - CONFIG_FILE:deployment资源定义文件名,必须是位于argocd设置的`path`下 - EXPRESSION:yq表达式, --- vim helm-change-config.yaml --- apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: config-change namespace: default spec: description: >- This task can be used to replace fields in YAML files. For example for altering helm charts on GitOps repos. workspaces: - name: source description: A workspace that contains the file which needs to be altered. params: - name: CONFIG_FILE type: string description: A config file - name: EXPRESSION type: string description: The yq expression to apply. Can be used to replace yaml fields. - description: The project name. name: CONTEXT type: string steps: - name: replace-in-yaml image: 192.168.31.49:81/library/tool-image:1.0.0 securityContext: runAsUser: 0 workingDir: $(workspaces.source.path)/$(params.CONTEXT) imagePullPolicy: IfNotPresent script: | #yq eval -i '(.image.tag)|="1.2.8"' values.yaml yq eval -i "$(params.EXPRESSION)" "$(params.CONFIG_FILE)" #yq --version --- ##Taskrun vim helm-change-config-task-run.yaml --- apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: helm-change-config-task-run namespace: default spec: params: - name: CONFIG_FILE value: values.yaml - name: EXPRESSION #value: (.image.tag.[]|select(.name == \"api\").image)|="新构建的镜像" value: (.image.tag)|=\"1.3.0\" - name: CONTEXT value: testnginx resources: {} serviceAccountName: default taskRef: kind: Task name: config-change timeout: 1h0m0s #workspaces: #- name: output # volumeClaimTemplate: # spec: # #storageClassName: storage01 # accessModes: # - ReadWriteOnce # resources: # requests: # storage: 10Gi workspaces: - name: source persistentVolumeClaim: claimName: pvc-acf7964944 #这里要修改为helm-git-clone后生成的pvc名称
分享到: