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

On-cluster build: Implement --git flag for func deploy #765

Closed
Tracked by #620
omerbensaadon opened this issue Jan 18, 2022 · 6 comments · Fixed by #844
Closed
Tracked by #620

On-cluster build: Implement --git flag for func deploy #765

omerbensaadon opened this issue Jan 18, 2022 · 6 comments · Fixed by #844
Assignees

Comments

@omerbensaadon
Copy link

omerbensaadon commented Jan 18, 2022

  • If the user uses func deploy --git <GIT_REPO>
    • the func.yaml will automatically set build to git and specify the git repository

In other words, I will be defaulting the following information to avoid manually editing func.yaml:

build: git                                          # required, specify `git` build type
git:
  url: https://github.com/my-repo/my-function.git   # required, git repository with the function source code
  revision: main                                    # optional, git revision to be used (branch, tag, commit)
  # contextDir: myfunction                          # optional, needed only if the function is not located
                                                    # in the repository root folder

I will update this issue if I find more details and consequences of using --git

@omerbensaadon omerbensaadon mentioned this issue Jan 18, 2022
29 tasks
@salaboy
Copy link
Member

salaboy commented Jan 25, 2022

@omerbensaadon did you created this one for me? @omerbensaadon do you know what kind of permissions do I need to be able to create issues like this from the check list?

@omerbensaadon
Copy link
Author

I think it's just OWNERS? I'm still an owner on knative-sandbox so the feature shows up for me

@salaboy
Copy link
Member

salaboy commented Feb 1, 2022

Looking at this comment in functions_buildtype.go:

	BuildTypeGit      = "git"
	//BuildTypeRemote   = "remote"	// TODO not supported yet

It seems that we are using BuildType git for remote builds.. which I think is fine.. so to avoid confusion I think that removing BuildTypeRemote comment will make sense..

Is there any other way to do a git build without being remote? Is there a local remote git build? meaning that a git repo is cloned locally and built?
Does it make sense to implement as part of this issue something like:

func deploy --build remote --git <GIT_REPO>

??
This goes against the guide: https://github.com/knative-sandbox/kn-plugin-func/blob/main/docs/guides/on-cluster-build.md where the build type git is used.

@zroubalik any comments?

@zroubalik
Copy link
Contributor

@salaboy the idea is to use git type for the current git based workflow and remote for the approach, where on cluster build is being executed from the source code directly uploaded to the cluster (ie. without git), ie. usecase 2 from https://docs.google.com/document/d/1iQFVtfsrYb4pp616h3B_IXQB1Cck1oxt7ypZyU8ChzE/edit#heading=h.pvswm4g8giw9

@pseudorandoom
Copy link
Contributor

I see we are using --build and --git but we still need to specify the git revision (branch) too. Is that going to be a new flag for the command or is there another way it should be specified? @zroubalik @salaboy

@zroubalik
Copy link
Contributor

https://docs.google.com/document/d/1iQFVtfsrYb4pp616h3B_IXQB1Cck1oxt7ypZyU8ChzE/edit#heading=h.y2uopsqzp10k

As proposed there ^, it could be: --git-url=https://github.com/zroubalik/test-function.git#mybranch or it could be --git-url=https://github.com/zroubalik/test-function.git --git-branch=mybranch or maybe both? 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants