Skip to content

Commit

Permalink
Finish dist spec and build plan changes
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Levine <stephen.levine@gmail.com>
  • Loading branch information
sclevine committed Jul 9, 2019
1 parent 3eab338 commit decb68d
Show file tree
Hide file tree
Showing 22 changed files with 368 additions and 348 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export GO111MODULE = on

GOCMD=go
GOENV=GO111MODULE=on GOOS=linux GOARCH=amd64 CGO_ENABLED=0
GOENV=GOOS=linux GOARCH=amd64 CGO_ENABLED=0
GOBUILD=$(GOCMD) build -mod=vendor
GOTEST=$(GOCMD) test -mod=vendor
LIFECYCLE_VERSION?=dev
Expand Down
4 changes: 2 additions & 2 deletions analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

type Analyzer struct {
Buildpacks []*Buildpack
Buildpacks []Buildpack
AppDir string
LayersDir string
In []byte
Expand All @@ -26,7 +26,7 @@ func (a *Analyzer) Analyze(image imgutil.Image) error {
return err
}
for _, buildpack := range a.Buildpacks {
cache, err := readBuildpackLayersDir(a.LayersDir, *buildpack)
cache, err := readBuildpackLayersDir(a.LayersDir, buildpack)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func testAnalyzer(t *testing.T, when spec.G, it spec.S) {

stdout, stderr = &bytes.Buffer{}, &bytes.Buffer{}
analyzer = &lifecycle.Analyzer{
Buildpacks: []*lifecycle.Buildpack{{ID: "metdata.buildpack"}, {ID: "no.cache.buildpack"}, {ID: "no.metadata.buildpack"}},
Buildpacks: []lifecycle.Buildpack{{ID: "metdata.buildpack"}, {ID: "no.cache.buildpack"}, {ID: "no.metadata.buildpack"}},
AppDir: appDir,
LayersDir: layerDir,
Out: log.New(stdout, "", 0),
Expand Down Expand Up @@ -165,7 +165,7 @@ func testAnalyzer(t *testing.T, when spec.G, it spec.S) {
})

it("should only write layer TOML files that correspond to detected buildpacks", func() {
analyzer.Buildpacks = []*lifecycle.Buildpack{{ID: "no.cache.buildpack"}}
analyzer.Buildpacks = []lifecycle.Buildpack{{ID: "no.cache.buildpack"}}

if err := analyzer.Analyze(image); err != nil {
t.Fatalf("Error: %s\n", err)
Expand Down
8 changes: 0 additions & 8 deletions bin/format

This file was deleted.

4 changes: 2 additions & 2 deletions builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ func (b *Builder) Build() (*BuildMetadata, error) {
return nil, err
}
cmd := exec.Command(filepath.Join(bpInfo.Path, "bin", "build"), bpLayersDir, platformDir, bpPlanPath)
cmd.Env = append(b.Env.List(), "BP_ID="+bpInfo.ID)
cmd.Env = append(os.Environ(),
cmd.Env = append(b.Env.List(),
"BP_ID="+bpInfo.ID,
"BP_VERSION="+bpInfo.Version,
"BP_PATH="+bpInfo.Path,
Expand Down Expand Up @@ -148,6 +147,7 @@ func (p DetectPlan) toBuild(bp Buildpack) buildPlan {
return buildPlan{Entries: out}
}

// TODO: ensure at least one claimed entry of each name is provided by the BP
func (p DetectPlan) filter(bp Buildpack, plan buildPlan) (DetectPlan, []BOMEntry) {
var out []DetectPlanEntry
for _, entry := range p.Entries {
Expand Down
Loading

0 comments on commit decb68d

Please sign in to comment.