@@ -142,8 +142,7 @@ func build(
142142 return fmt .Errorf ("running %s (%s)" , strings .Join (tarCmd .Args , " " ), err )
143143 }
144144
145- bType := getBuildType (tmpDir , appConf )
146- usingDockerfile := bType == buildTypeDockerbuilder
145+ stack := getStack (tmpDir , appConf )
147146
148147 appTgzdata , err := ioutil .ReadFile (absAppTgz )
149148 if err != nil {
@@ -165,7 +164,7 @@ func build(
165164 return fmt .Errorf ("error build builder pod node selector %s" , err )
166165 }
167166
168- if usingDockerfile {
167+ if strings . Contains ( stack [ "name" ], "container" ) {
169168 buildPodName = dockerBuilderPodName (appName , gitSha .Short ())
170169 registryLocation := conf .RegistryLocation
171170 registryEnv := make (map [string ]string )
@@ -187,7 +186,7 @@ func build(
187186 gitSha .Short (),
188187 slugName ,
189188 conf .StorageType ,
190- conf . DockerBuilderImage ,
189+ stack [ "image" ] ,
191190 conf .RegistryHost ,
192191 conf .RegistryPort ,
193192 registryEnv ,
@@ -222,7 +221,7 @@ func build(
222221 gitSha .Short (),
223222 buildPackURL ,
224223 conf .StorageType ,
225- conf . SlugBuilderImage ,
224+ stack [ "image" ] ,
226225 slugBuilderImagePullPolicy ,
227226 builderPodNodeSelector ,
228227 )
@@ -297,7 +296,7 @@ func build(
297296 }
298297 log .Debug ("Done" )
299298
300- procType , err := getProcFile (storageDriver , tmpDir , slugBuilderInfo .AbsoluteProcfileKey (), bType )
299+ procType , err := getProcFile (storageDriver , tmpDir , slugBuilderInfo .AbsoluteProcfileKey (), stack )
301300 if err != nil {
302301 return err
303302 }
@@ -306,10 +305,10 @@ func build(
306305
307306 quit := progress ("..." , conf .SessionIdleInterval ())
308307 log .Info ("Launching App..." )
309- if ! usingDockerfile {
308+ if stack [ "name" ] != "container" {
310309 image = slugBuilderInfo .AbsoluteSlugObjectKey ()
311310 }
312- release , err := hooks .CreateBuild (client , conf .Username , conf .App (), image , gitSha .Short (), procType , usingDockerfile )
311+ release , err := hooks .CreateBuild (client , conf .Username , conf .App (), image , gitSha .Short (), procType , stack [ "name" ] == "container" )
313312 quit <- true
314313 <- quit
315314 if controller .CheckAPICompat (client , err ) != nil {
@@ -351,7 +350,7 @@ func prettyPrintJSON(data interface{}) (string, error) {
351350 return formatted .String (), nil
352351}
353352
354- func getProcFile (getter storage.ObjectGetter , dirName , procfileKey string , bType buildType ) (dryccAPI.ProcessType , error ) {
353+ func getProcFile (getter storage.ObjectGetter , dirName , procfileKey string , stack map [ string ] string ) (dryccAPI.ProcessType , error ) {
355354 procType := dryccAPI.ProcessType {}
356355 if _ , err := os .Stat (fmt .Sprintf ("%s/Procfile" , dirName )); err == nil {
357356 rawProcFile , err := ioutil .ReadFile (fmt .Sprintf ("%s/Procfile" , dirName ))
@@ -363,7 +362,7 @@ func getProcFile(getter storage.ObjectGetter, dirName, procfileKey string, bType
363362 }
364363 return procType , nil
365364 }
366- if bType != buildTypeSlugbuilder {
365+ if stack [ "name" ] == "container" {
367366 return procType , nil
368367 }
369368 log .Debug ("Procfile not present. Getting it from the buildpack" )
0 commit comments