{
"kind": "BuildConfig",
"apiVersion": "v1",
"metadata": {
"name": "ruby-sample-build" (1)
},
"spec": {
"triggers": [ (2)
{
"type": "GitHub",
"github": {
"secret": "secret101"
}
},
{
"type": "Generic",
"generic": {
"secret": "secret101"
}
},
{
"type": "ImageChange"
}
],
"source": { (3)
"type": "Git",
"git": {
"uri": "https://github.com/openshift/ruby-hello-world"
}
},
"strategy": { (4)
"type": "Source",
"sourceStrategy": {
"from": {
"kind": "ImageStreamTag",
"name": "ruby-20-centos7:latest"
}
}
},
"output": { (5)
"to": {
"kind": "ImageStreamTag",
"name": "origin-ruby-sample:latest"
}
}
}
}
1 | This specification will create a new BuildConfig named
ruby-sample-build. |
2 | You can specify a list of triggers, which cause a new build to be created. |
3 | The source section defines the source code repository location. You can
provide additional options, such as sourcesecret or contextDir here. |
4 | The strategy section describes the build strategy used to execute the
build. You can specify Source , Docker and Custom strategies here.
This above example uses the ruby-20-centos7 Docker image that
Source-To-Image will use for the application build. |
5 | After the Docker image is successfully built, it will be pushed into the
repository described in the output section. |