Skip to content

Commit

Permalink
fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
briandealwis committed Sep 5, 2019
1 parent 1749cdf commit 0504be7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion integration/testdata/debug/skaffold.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: skaffold/v1beta10
apiVersion: skaffold/v1beta14
kind: Config
build:
artifacts:
Expand Down
2 changes: 1 addition & 1 deletion integration/testdata/jib/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ profiles:
- name: old-jib
patches:
- op: add
path: /build/artifacts/0/jibMaven/args
path: /build/artifacts/0/jib/args
value: ['-Djib.maven-plugin-version=1.3.0']
19 changes: 18 additions & 1 deletion pkg/skaffold/build/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (b *Builder) runBuildForArtifact(ctx context.Context, out io.Writer, artifa
return b.buildBazel(ctx, out, artifact, tag)

case artifact.JibArtifact != nil:
return b.buildJibMaven(ctx, out, artifact.Workspace, artifact.JibArtifact, tag)
return b.buildJib(ctx, out, artifact, tag)

case artifact.CustomArtifact != nil:
return b.buildCustom(ctx, out, artifact, tag)
Expand All @@ -91,6 +91,23 @@ func (b *Builder) runBuildForArtifact(ctx context.Context, out io.Writer, artifa
}
}

func (b *Builder) buildJib(ctx context.Context, out io.Writer, artifact *latest.Artifact, tag string) (string, error) {
t, err := jib.DeterminePluginType(artifact.Workspace, artifact.JibArtifact)
if err != nil {
return "", err
}

switch t {
case jib.JibMaven:
return b.buildJibMaven(ctx,out, artifact.Workspace, artifact.JibArtifact, tag)
case jib.JibGradle:
return b.buildJibGradle(ctx,out, artifact.Workspace, artifact.JibArtifact, tag)
default:
return "", errors.Errorf("Unable to determine Jib builder type for %s", artifact.Workspace)
}

}

func (b *Builder) DependenciesForArtifact(ctx context.Context, a *latest.Artifact) ([]string, error) {
var (
paths []string
Expand Down
1 change: 0 additions & 1 deletion pkg/skaffold/jib/jib.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ var watchedFiles = map[string]filesLists{}

// GetDependencies returns a list of files to watch for changes to rebuild
func GetDependencies(ctx context.Context, workspace string, artifact *latest.JibArtifact) ([]string, error) {
// otherewise guess from artifacgt workspace
t, err := DeterminePluginType(workspace, artifact)
if err != nil {
return nil, err
Expand Down

0 comments on commit 0504be7

Please sign in to comment.