Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup a Build using kodo #25

Merged
merged 14 commits into from
Jun 24, 2020
Merged

Conversation

ranakan19
Copy link
Collaborator

@ranakan19 ranakan19 commented Jun 22, 2020

Fixes #15

What
Supports Building from source with the following command:
kodo build --source=https://github.com/my/app

Assumptions

  • The source has a dockerfile at root itself
  • Can login to cluster
  • The Namespace passed already exists

Working Command

kodo build --source=https://github.com/openshift/ruby-hello-world.git --namespace=test-kanika 
 --token=<Token>--server=https://api.dev-svc-4.5-062213.devcluster.openshift.com:6443

Acceptance Criteria

  • BuildConfig is created (with name: my-app-docker-build)
  • ImageStream is created (with name: my-ruby-image)
  • Able to start Build
  • ImageStreamTag is created after a successful build. (my-ruby-image:latest)

ScreenShots
ImageStreamTag after Build:
Screenshot from 2020-06-19 18-26-21

@sbose78 sbose78 changed the title Solution to Issue#15: Setup a Build using kodo Setup a Build using kodo Jun 22, 2020
@sbose78
Copy link
Contributor

sbose78 commented Jun 22, 2020

Have you tried deploying the built image?

@sbose78
Copy link
Contributor

sbose78 commented Jun 22, 2020

Because of a different PR merged by me, there are conflicts in your PR, please resolve them and push again.

pkg/kodo/cmd/build.go Outdated Show resolved Hide resolved
@ranakan19
Copy link
Collaborator Author

Have you tried deploying the built image?

Yes, did now, was succesfull.
Screenshot from 2020-06-22 18-13-49

@ranakan19 ranakan19 requested a review from sbose78 June 22, 2020 22:30
main.go Outdated Show resolved Hide resolved
pkg/kodo/cmd/build.go Outdated Show resolved Hide resolved
Comment on lines 15 to 44
func getBuildConfig() buildv1api.BuildConfig {
return buildv1api.BuildConfig{
TypeMeta: metav1.TypeMeta{
Kind: "BuildConfig",
APIVersion: "build.openshift.io/v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: "my-app-docker-build",
},
Spec: buildv1api.BuildConfigSpec{
CommonSpec: buildv1api.CommonSpec{
Source: buildv1api.BuildSource{
Type: buildv1api.BuildSourceType("Git"),
Git: &buildv1api.GitBuildSource{
URI: "https://github.com/openshift/ruby-hello-world.git",
},
},
Strategy: buildv1api.BuildStrategy{
Type: buildv1api.BuildStrategyType("Docker"),
},
Output: buildv1api.BuildOutput{
To: &corev1.ObjectReference{
Kind: "ImageStreamTag",
Name: "my-ruby-image:latest",
},
},
},
},
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think a new function is required for this
I think best practice would be for the test cases to be completely isolated and not have any dependence on external functions

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure i understand what you mean by external function. I just followed the way we wrote test cases in the session with gagan.

Copy link
Collaborator

@Shraddhak22 Shraddhak22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ranakan19 ranakan19 requested a review from sbose78 June 23, 2020 17:22
main.go Outdated Show resolved Hide resolved
@reginapizza reginapizza merged commit 910380d into cli-playground:master Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setup a Build using kodo
7 participants