@@ -89,6 +89,21 @@ func build(conf *Config, builderKey, gitSha string) error {
8989 tarURL := fmt .Sprintf ("%s://%s:%s/git/home/%s/tar" , storage .schema (), storage .host (), storage .port (), slugName )
9090 pushURL := fmt .Sprintf ("%s://%s:%s/git/home/%s/push" , storage .schema (), storage .host (), storage .port (), slugName )
9191
92+ // Ensure that the app config can be gotten from workflow. We don't do anything with this information
93+ appConf , err := getAppConfig (conf , builderKey , conf .Username , appName )
94+ if err != nil {
95+ return fmt .Errorf ("getting app config for %s (%s)" , appName , err )
96+ }
97+ log .Debug ("got the following config back for app %s: %+v" , appName , * appConf )
98+ buildPackURLInterface , ok := appConf .Values ["BUILDPACK_URL" ]
99+ if ! ok {
100+ return fmt .Errorf ("BUILDPACK_URL not found in returned app config" )
101+ }
102+ buildPackURL , ok := buildPackURLInterface .(string )
103+ if ! ok {
104+ return fmt .Errorf ("BUILDPACK_URL not returned as a string" )
105+ }
106+
92107 // build a tarball from the new objects
93108 gitArchiveCmd := repoCmd (repoDir , "git" , "archive" , "--format=tar.gz" , fmt .Sprintf ("--output=%s.tar.gz" , appName ), gitSha )
94109 gitArchiveCmd .Stdout = os .Stdout
@@ -154,6 +169,7 @@ func build(conf *Config, builderKey, gitSha string) error {
154169 finalManifest = strings .Replace (string (fileBytes ), "repo_name" , buildPodName , - 1 )
155170 finalManifest = strings .Replace (finalManifest , "puturl" , pushURL , - 1 )
156171 finalManifest = strings .Replace (finalManifest , "tar-url" , tarURL , - 1 )
172+ finalManifest = strings .Replace (finalManifest , "buildurl" , buildPackURL , - 1 )
157173 }
158174
159175 log .Debug ("writing builder manifest to %s" , finalManifestFileLocation )
@@ -240,12 +256,6 @@ func build(conf *Config, builderKey, gitSha string) error {
240256 }
241257
242258 log .Info ("Build complete." )
243- log .Info ("Launching app." )
244-
245- // Ensure that the app config can be gotten from workflow. We don't do anything with this information
246- if _ , err := getAppConfig (conf , builderKey , conf .Username , appName ); err != nil {
247- return fmt .Errorf ("getting app config for %s (%s)" , appName , err )
248- }
249259
250260 log .Info ("Launching..." )
251261
0 commit comments