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发布
返回首页
-
+
git-docker-build-pipline.yaml
2023年6月19日 17:25
admin
vim git-docker-build-pipline.yaml --- apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: name: git-docker-build spec: description: | cat-branch-readme takes a git repository and a branch name and prints the README.md file from that branch. This is an example Pipeline demonstrating the following: - Using the git-clone catalog Task to clone a branch - Passing a cloned repo to subsequent Tasks using a Workspace. - Ordering Tasks in a Pipeline using "runAfter" so that git-clone completes before we try to read from the Workspace. - Using a volumeClaimTemplate Volume as a Workspace. - Avoiding hard-coded paths by using a Workspace's path variable instead. params: - name: repo-url type: string description: The git repository URL to clone from. - name: branch-name type: string description: The git branch to clone. - name: harbor-image type: string description: out of harbor's image - name: harbor-ip type: string description: harbor ip workspaces: - name: shared-data description: | This workspace will receive the cloned git repo and be passed to the next Task for the repo's README.md file to be read. tasks: - name: fetch-repo taskRef: name: git-clone workspaces: - name: output workspace: shared-data params: - name: url value: $(params.repo-url) - name: revision value: $(params.branch-name) - name: docker-build-push runAfter: ["fetch-repo"] # Wait until the clone is done before reading the readme. taskRef: name: docker-build workspaces: - name: source workspace: shared-data params: - name: image value: $(params.harbor-image) - name: insecure_registry value: $(params.harbor-ip) --- ##PipelineRun vim git-docker-build-pipline-run.yaml --- apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: name: git-docker-build-run spec: pipelineRef: name: git-docker-build workspaces: - name: shared-data volumeClaimTemplate: spec: accessModes: - ReadWriteOnce resources: requests: storage: 20Gi params: - name: repo-url value: http://192.168.31.49:6000/bao/projiect.git - name: branch-name value: master - name: harbor-image value: 192.168.31.49:81/library/test-nginx:1.0.2 - name: harbor-ip value: 192.168.31.49:81 ~
分享到: