Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Commit

Permalink
Makes start command compatible with new libbuildpack
Browse files Browse the repository at this point in the history
[#168418587]
  • Loading branch information
ForestEckhardt committed Sep 11, 2019
1 parent 80a3b96 commit bf1cdac
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dep/dep.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (c *Contributor) ContributeStartCommand() error {
appName = filepath.Base(c.Targets[0])
}
appBinaryPath := filepath.Join(c.appBinaryLayer.Root, appName)
return c.context.Layers.WriteApplicationMetadata(layers.Metadata{Processes: []layers.Process{{"web", appBinaryPath}}})
return c.context.Layers.WriteApplicationMetadata(layers.Metadata{Processes: []layers.Process{{"web", appBinaryPath, false}}})
}

func (c *Contributor) setPackagesMetadata() error {
Expand Down
17 changes: 8 additions & 9 deletions dep/dep_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package dep_test

import (
"fmt"
"github.com/cloudfoundry/libcfbuildpack/buildpackplan"
"github.com/cloudfoundry/libcfbuildpack/layers"
"io/ioutil"
"os"
"path/filepath"
"testing"

"github.com/cloudfoundry/libcfbuildpack/buildpackplan"
"github.com/cloudfoundry/libcfbuildpack/layers"

"github.com/cloudfoundry/dep-cnb/dep"
"github.com/cloudfoundry/libcfbuildpack/test"
"github.com/golang/mock/gomock"
Expand Down Expand Up @@ -64,11 +65,10 @@ func testDep(t *testing.T, when spec.G, it spec.S) {

it("reads targets from the buildplan", func() {


factory.AddPlan(generateMetadata(
buildpackplan.Metadata{
dep.ImportPath: packageName,
dep.Targets: []interface{}{"first", "second"},
dep.Targets: []interface{}{"first", "second"},
}),
)

Expand All @@ -82,7 +82,7 @@ func testDep(t *testing.T, when spec.G, it spec.S) {

factory.AddPlan(generateMetadata(
buildpackplan.Metadata{
dep.Targets: []interface{}{},
dep.Targets: []interface{}{},
}),
)

Expand Down Expand Up @@ -214,7 +214,7 @@ func testDep(t *testing.T, when spec.G, it spec.S) {
Expect(factory.Build.Layers).To(test.HaveApplicationMetadata(layers.Metadata{
Processes: []layers.Process{
{
"web", appBinaryPath,
"web", appBinaryPath, false,
},
},
}))
Expand Down Expand Up @@ -243,7 +243,7 @@ func testDep(t *testing.T, when spec.G, it spec.S) {
Expect(factory.Build.Layers).To(test.HaveApplicationMetadata(layers.Metadata{
Processes: []layers.Process{
{
"web", appBinaryPath,
"web", appBinaryPath, false,
},
},
}))
Expand Down Expand Up @@ -276,10 +276,9 @@ func testDep(t *testing.T, when spec.G, it spec.S) {
})
}


func generateMetadata(metadata buildpackplan.Metadata) buildpackplan.Plan {
return buildpackplan.Plan{
Name: dep.Dependency,
Name: dep.Dependency,
Metadata: metadata,
}
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/cloudfoundry/dep-cnb
go 1.12

require (
github.com/buildpack/libbuildpack v1.23.0
github.com/buildpack/libbuildpack v1.24.0
github.com/cloudfoundry/dagger v0.0.0-20190910211006-e7385ebe12c4
github.com/cloudfoundry/libcfbuildpack v1.85.0
github.com/golang/mock v1.3.1
Expand All @@ -12,5 +12,5 @@ require (
github.com/pkg/errors v0.8.1
github.com/sclevine/spec v1.2.0
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect
google.golang.org/appengine v1.6.1 // indirect
google.golang.org/appengine v1.6.2 // indirect
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ github.com/buildpack/libbuildpack v1.19.0 h1:HUkaIwuGmPbQhujBjYNpd+E4f0NdAgAgHq7
github.com/buildpack/libbuildpack v1.19.0/go.mod h1:oxgSTzPbWscHs27iuYrctEZpSak2m/qPThA+9JM0Boo=
github.com/buildpack/libbuildpack v1.23.0 h1:J1Bz62zQUeQW/vVzLQrW0DdKgU2P1Aa99nBAigKG11g=
github.com/buildpack/libbuildpack v1.23.0/go.mod h1:Amg0Ygeo8V7Lqr5hJ6TtDG7d2FwY2ZUptLpEnOvyfL4=
github.com/buildpack/libbuildpack v1.24.0 h1:RP03dlPcTNATytgQ0uEpbWMzYtO2CIQyiDnpv7ommNE=
github.com/buildpack/libbuildpack v1.24.0/go.mod h1:mU1sClrWw0/Ua1LB+8+ydtZY5dMsa1nEzVMHhcczNVo=
github.com/cloudfoundry/dagger v0.0.0-20190910211006-e7385ebe12c4 h1:YntXPlrEIZ9/glePgiY0HTecy1EsNhdDz8zFa79tQ6o=
github.com/cloudfoundry/dagger v0.0.0-20190910211006-e7385ebe12c4/go.mod h1:vbeid+MuoJPZXM8fGvJy87lDLvu/q0Rs1NN4M6lFFg4=
github.com/cloudfoundry/libcfbuildpack v1.76.0 h1:oMTv35mjk5Jogzy2sshVXHyolDWnWHMfANQ0UooXJq0=
Expand Down Expand Up @@ -106,6 +108,8 @@ google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO50
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.2 h1:j8RI1yW0SkI+paT6uGwMlrMI/6zwYA6/CFil8rxOzGI=
google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down

0 comments on commit bf1cdac

Please sign in to comment.