This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.
3.2.2.3. 파이프라인
파이프라인은 특정 실행 순서대로 정렬된 Task 리소스 컬렉션입니다. 애플리케이션 빌드, 배포 및 제공 작업을 자동화하는 복잡한 워크플로를 구성하기 위해 실행됩니다. 하나 이상의 작업이 포함된 파이프라인을 사용하여 애플리케이션에 대한 CI/CD 워크플로를 정의할 수 있습니다.
Pipeline 리소스 정의는 함께 사용하면 파이프라인에서 특정 목표를 달성할 수 있는 여러 필드 또는 특성으로 구성됩니다. 각 Pipeline 리소스 정의에는 특정 입력을 수집하고 특정 출력을 생성하는 Task가 하나 이상 포함되어야 합니다. 또한 파이프라인 정의에는 애플리케이션 요구 사항에 따라 Conditions, Workspaces, Parameters 또는 Resources가 선택적으로 포함될 수 있습니다.
다음 예제에서는 buildahClusterTask 리소스를 사용하여 Git 리포지토리에서 애플리케이션 이미지를 빌드하는 build-and-deploy 파이프라인을 보여줍니다.
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: build-and-deploy
spec:
workspaces:
- name: shared-workspace
params:
- name: deployment-name
type: string
description: name of the deployment to be patched
- name: git-url
type: string
description: url of the git repo for the code of deployment
- name: git-revision
type: string
description: revision to be used from repo of the code for deployment
default: "pipelines-1.4"
- name: IMAGE
type: string
description: image to be built from the code
tasks:
- name: fetch-repository
taskRef:
name: git-clone
kind: ClusterTask
workspaces:
- name: output
workspace: shared-workspace
params:
- name: url
value: $(params.git-url)
- name: subdirectory
value: ""
- name: deleteExisting
value: "true"
- name: revision
value: $(params.git-revision)
- name: build-image
taskRef:
name: buildah
kind: ClusterTask
params:
- name: TLSVERIFY
value: "false"
- name: IMAGE
value: $(params.IMAGE)
workspaces:
- name: source
workspace: shared-workspace
runAfter:
- fetch-repository
- name: apply-manifests
taskRef:
name: apply-manifests
workspaces:
- name: source
workspace: shared-workspace
runAfter:
- build-image
- name: update-deployment
taskRef:
name: update-deployment
workspaces:
- name: source
workspace: shared-workspace
params:
- name: deployment
value: $(params.deployment-name)
- name: IMAGE
value: $(params.IMAGE)
runAfter:
- apply-manifests
apiVersion: tekton.dev/v1beta1
1
kind: Pipeline
2
metadata:name: build-and-deploy
3
spec:
4
workspaces:
5
-name: shared-workspace
params:
6
-name: deployment-name
type: string
description: name of the deployment to be patched
-name: git-url
type: string
description: url of the git repo for the code of deployment
-name: git-revision
type: string
description: revision to be used from repo of the code for deployment
default:"pipelines-1.4"-name: IMAGE
type: string
description: image to be built from the code
tasks: