Skip to content

Commit 95dbca4

Browse files
committed
chore(controller-sdk-go): store the raw dockerfile file
1 parent 640c290 commit 95dbca4

2 files changed

Lines changed: 10 additions & 13 deletions

File tree

hooks/hooks.go

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,15 @@ func GetAppConfig(c *drycc.Client, username, app string) (api.Config, error) {
5454
// gitSha should be the first 8 characters of the git commit sha. Image is either the docker image
5555
// location for the dockerfile app the absolute url to the tar file for a buldpack app.
5656
func CreateBuild(c *drycc.Client, username, app, image, stack, gitSha string, procfile api.ProcessType,
57-
usingDockerifle bool) (int, error) {
57+
dockerfile string) (int, error) {
5858
req := api.BuildHookRequest{
59-
Sha: gitSha,
60-
User: username,
61-
App: app,
62-
Image: image,
63-
Stack: stack,
64-
Procfile: procfile,
65-
}
66-
67-
if usingDockerifle {
68-
req.Dockerfile = "true"
59+
Sha: gitSha,
60+
User: username,
61+
App: app,
62+
Image: image,
63+
Stack: stack,
64+
Procfile: procfile,
65+
Dockerfile: dockerfile,
6966
}
7067

7168
b, err := json.Marshal(req)

hooks/hooks_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const buildFixture = `
5555
const (
5656
testingClientFingerprint = `78:b9:21:20:1a:ed:e6:10:05:35:47:da:d4:1f:b6:73`
5757
configHookExpected = `{"receive_user":"test","receive_repo":"example-go"}`
58-
buildHookExpected = `{"sha":"abc123","receive_user":"test","receive_repo":"example-go","image":"test:abc123","stack":"heroku-18","procfile":{"web":"./run"},"dockerfile":"true"}`
58+
buildHookExpected = `{"sha":"abc123","receive_user":"test","receive_repo":"example-go","image":"test:abc123","stack":"heroku-18","procfile":{"web":"./run"},"dockerfile":""}`
5959
)
6060

6161
type fakeHTTPServer struct{}
@@ -204,7 +204,7 @@ func TestBuildHook(t *testing.T) {
204204

205205
expected := 2
206206

207-
actual, err := CreateBuild(drycc, "test", "example-go", "test:abc123", "heroku-18", "abc123", map[string]string{"web": "./run"}, true)
207+
actual, err := CreateBuild(drycc, "test", "example-go", "test:abc123", "heroku-18", "abc123", map[string]string{"web": "./run"}, "")
208208

209209
if err != nil {
210210
t.Error(err)

0 commit comments

Comments
 (0)