Red Hat Training
A Red Hat training course is available for OpenShift Container Platform
8.5.4. パイプラインストラテジーのオプション
以下のオプションは、パイプラインビルドストラテジー に固有のオプションです。
8.5.4.1. Jenkinsfile の提供
Jenkinsfile は、以下の 2 つの方法のどちらかで提供できます。
- ビルド設定に Jenkinsfile を埋め込む
- 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 に設定されます。