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

Add Jib detection to skaffold init #2276

Merged
merged 49 commits into from
Jul 30, 2019
Merged

Add Jib detection to skaffold init #2276

merged 49 commits into from
Jul 30, 2019

Conversation

TadCordle
Copy link
Contributor

@TadCordle TadCordle commented Jun 17, 2019

Review after #2327.

This PR adds Jib detection to skaffold init. Skaffold walks the directory searching for dockerfiles, build.gradles, and pom.xmls. If a build.gradle or a pom.xml is found, skaffold will attempt to run an internal Jib gradle task/maven goal to determine if Jib is configured on any of the projects (Jib v1.3.0 or higher is required for this to work).

If Jib is detected and jib.to.image is configured with an image found in the k8s manifest, the Jib builder is added to the skaffold config automatically.

If Jib is detected but jib.to.image is not configured to build a k8s image, the Jib project is added to the CLI prompt so the user can decide which image Jib should build, and the user's choice is added using the -Djib.to.image=... flag.

Issues left to solve:

  • Configuring to build with Jib via CLI artifacts
  • Gradle/Maven edge cases (config files that don't use the default names, unorthodox project structure, etc.)
  • Generating Jib config automatically if it's missing?

Towards #1264 (probably not completely fixed until there's some idea how to automatically apply Jib to maven/gradle projects).

@codecov
Copy link

codecov bot commented Jun 20, 2019

Codecov Report

Merging #2276 into master will increase coverage by 0.43%.
The diff coverage is 88.31%.

Impacted Files Coverage Δ
pkg/skaffold/schema/latest/config.go 100% <ø> (ø) ⬆️
pkg/skaffold/initializer/init.go 53.6% <81.81%> (+9.62%) ⬆️
pkg/skaffold/jib/jib_init.go 89.39% <89.39%> (ø)
pkg/skaffold/docker/docker_init.go 100% <0%> (+6.66%) ⬆️

Copy link
Member

@chanseokoh chanseokoh left a comment

Choose a reason for hiding this comment

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

Looks good.

pkg/skaffold/jib/jib_init.go Show resolved Hide resolved
pkg/skaffold/jib/jib_init.go Show resolved Hide resolved
pkg/skaffold/jib/jib_init.go Show resolved Hide resolved
pkg/skaffold/jib/jib_init.go Show resolved Hide resolved
@dgageot dgageot merged commit 27f5fe4 into GoogleContainerTools:master Jul 30, 2019
@TadCordle TadCordle deleted the jib-skaffold-init branch September 24, 2019 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants