Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

8.5.4. 파이프 라인 전략 옵션

다음 옵션은 Pipeline 빌드 전략에 따라 다릅니다.

8.5.4.1. Jenkinsfile 제공

Jenkinsfile은 다음 두 가지 방법 중 하나로 제공할 수 있습니다.

  1. Jenkinsfile을 빌드 구성에 포함합니다.
  2. Jenkinsfile을 포함하는 Git 리포지토리에 대한 참조를 빌드 구성에 포함합니다.

포함된 정의

kind: "BuildConfig"
apiVersion: "v1"
metadata:
  name: "sample-pipeline"
spec:
  strategy:
    jenkinsPipelineStrategy:
      jenkinsfile: |-
        node('agent') {
          stage 'build'
          openshiftBuild(buildConfig: 'ruby-sample-build', showBuildLogs: 'true')
          stage 'deploy'
          openshiftDeploy(deploymentConfig: 'frontend')
        }

Git 리포지토리에 대한 참조

kind: "BuildConfig"
apiVersion: "v1"
metadata:
  name: "sample-pipeline"
spec:
  source:
    git:
      uri: "https://github.com/openshift/ruby-hello-world"
  strategy:
    jenkinsPipelineStrategy:
      jenkinsfilePath: some/repo/dir/filename 1

1
선택적 jenkinsfilePath 필드는 소스 contextDir에 상대적으로 사용할 파일의 이름을 지정합니다. contextDir이 생략된 경우 기본값은 리포지토리의 루트입니다. jenkinsfilePath 가 생략된 경우 기본값은 Jenkinsfile 입니다.