cli-playground / kodo

MIT License
0 stars 6 forks source link

Setup a Build using kodo #15

Closed sbose78 closed 4 years ago

sbose78 commented 4 years ago

What

Optionally support building from source:

kodo build --source=https://github.com/my/app 

How

Assumption: The source code repo already has a Dockerfile. Example: https://github.com/openshift/ruby-hello-world.git

Create an ImageStream

apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
  name: my-ruby-image
  namespace: NAMESPACE

For Golang APIs, use the following imports

  1. imagev1client https://github.com/openshift/client-go/image/clientset/versioned/typed/image/v1
  2. imagev1 "github.com/openshift/api/image/v1"

As a pre-req,

apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
  name: my-app-docker-build
spec:
  source:
    type: Git
    git:
      uri: 'https://github.com/openshift/ruby-hello-world.git'
  strategy:
    type: Docker
  output:
    to:
      kind: ImageStreamTag
      name: 'my-ruby-image:latest'

For Golang APIs, use the following imports

  1. buildv1client https://github.com/openshift/client-go/build/clientset/versioned/typed/image/v1
  2. buildv1 "github.com/openshift/api/image/v1"
sbose78 commented 4 years ago

This PR shows how to create ImageStreams and Builds. https://github.com/cli-playground/kodo/pull/16