Skip to content

Commit 5f1e23f

Browse files
committed
chore(buildpack): remove BUILDPACK_URL env when creating app
1 parent d5aaa4b commit 5f1e23f

5 files changed

Lines changed: 5 additions & 21 deletions

File tree

cmd/apps.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import (
77
"strings"
88
"time"
99

10-
"github.com/drycc/controller-sdk-go/api"
1110
"github.com/drycc/controller-sdk-go/apps"
12-
"github.com/drycc/controller-sdk-go/config"
1311
"github.com/drycc/controller-sdk-go/domains"
1412
"github.com/drycc/workflow-cli/pkg/git"
1513
"github.com/drycc/workflow-cli/pkg/logging"
@@ -18,7 +16,7 @@ import (
1816
)
1917

2018
// AppCreate creates an app.
21-
func (d *DryccCmd) AppCreate(id, buildpack, remote string, noRemote bool) error {
19+
func (d *DryccCmd) AppCreate(id, remote string, noRemote bool) error {
2220
s, err := settings.Load(d.ConfigFile)
2321
if err != nil {
2422
return err
@@ -37,17 +35,6 @@ func (d *DryccCmd) AppCreate(id, buildpack, remote string, noRemote bool) error
3735

3836
d.Printf("done, created %s\n", app.ID)
3937

40-
if buildpack != "" {
41-
configValues := api.Config{
42-
Values: map[string]interface{}{
43-
"BUILDPACK_URL": buildpack,
44-
},
45-
}
46-
if _, err = config.Set(s.Client, app.ID, configValues); d.checkAPICompatibility(s.Client, err) != nil {
47-
return err
48-
}
49-
}
50-
5138
if !noRemote {
5239
if err = git.CreateRemote(git.DefaultCmd, s.Client.ControllerURL.Host, remote, app.ID); err != nil {
5340
if strings.Contains(err.Error(), fmt.Sprintf("fatal: remote %s already exists.", remote)) {

cmd/apps_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ func TestRemoteExists(t *testing.T) {
332332
var b bytes.Buffer
333333
cmdr := DryccCmd{WOut: &b, ConfigFile: cf}
334334

335-
err = cmdr.AppCreate("foo", "", "drycc", false)
335+
err = cmdr.AppCreate("foo", "drycc", false)
336336

337337
assert.Equal(t, err.Error(), `A git remote with the name drycc already exists. To overwrite this remote run:
338338
drycc git:remote --force --remote drycc --app foo`,

cmd/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
// Commander is interface definition for running commands
1212
type Commander interface {
13-
AppCreate(string, string, string, bool) error
13+
AppCreate(string, string, bool) error
1414
AppsList(int) error
1515
AppInfo(string) error
1616
AppOpen(string) error

parser/apps.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ Arguments:
7373
Options:
7474
--no-remote
7575
do not create a 'drycc' git remote.
76-
-b --buildpack BUILDPACK
77-
a buildpack url to use for this app
7876
-r --remote REMOTE
7977
name of remote to create. [default: drycc]
8078
`
@@ -86,11 +84,10 @@ Options:
8684
}
8785

8886
id := safeGetValue(args, "<id>")
89-
buildpack := safeGetValue(args, "--buildpack")
9087
remote := safeGetValue(args, "--remote")
9188
noRemote := args["--no-remote"].(bool)
9289

93-
return cmdr.AppCreate(id, buildpack, remote, noRemote)
90+
return cmdr.AppCreate(id, remote, noRemote)
9491
}
9592

9693
func appsList(argv []string, cmdr cmd.Commander) error {

parser/apps_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
// Create fake implementations of each method that return the argument
1313
// we expect to have called the function (as an error to satisfy the interface).
1414

15-
func (d FakeDryccCmd) AppCreate(string, string, string, bool) error {
15+
func (d FakeDryccCmd) AppCreate(string, string, bool) error {
1616
return errors.New("apps:create")
1717
}
1818

0 commit comments

Comments
 (0)