@@ -53,7 +53,7 @@ func build(conf *Config, s3Client *s3.S3, builderKey, rawGitSha string) error {
5353 repoDir := filepath .Join (conf .GitHome , repo )
5454 buildDir := filepath .Join (repoDir , "build" )
5555
56- slugName := fmt .Sprintf ("%s:git-%s" , appName , gitSha .Short )
56+ slugName := fmt .Sprintf ("%s:git-%s" , appName , gitSha .Short () )
5757 imageName := strings .Replace (slugName , ":" , "-" , - 1 )
5858 if err := os .MkdirAll (buildDir , os .ModeDir ); err != nil {
5959 return fmt .Errorf ("making the build directory %s (%s)" , buildDir , err )
@@ -78,7 +78,7 @@ func build(conf *Config, s3Client *s3.S3, builderKey, rawGitSha string) error {
7878
7979 // build a tarball from the new objects
8080 appTgz := fmt .Sprintf ("%s.tar.gz" , appName )
81- gitArchiveCmd := repoCmd (repoDir , "git" , "archive" , "--format=tar.gz" , fmt .Sprintf ("--output=%s" , appTgz ), gitSha .Full )
81+ gitArchiveCmd := repoCmd (repoDir , "git" , "archive" , "--format=tar.gz" , fmt .Sprintf ("--output=%s" , appTgz ), gitSha .Full () )
8282 gitArchiveCmd .Stdout = os .Stdout
8383 gitArchiveCmd .Stderr = os .Stderr
8484 if err := run (gitArchiveCmd ); err != nil {
@@ -137,15 +137,15 @@ func build(conf *Config, s3Client *s3.S3, builderKey, rawGitSha string) error {
137137 var finalManifest string
138138 uid := uuid .New ()[:8 ]
139139 if usingDockerfile {
140- buildPodName = fmt .Sprintf ("dockerbuild-%s-%s-%s" , appName , gitSha .Short , uid )
140+ buildPodName = fmt .Sprintf ("dockerbuild-%s-%s-%s" , appName , gitSha .Short () , uid )
141141 finalManifest = strings .Replace (string (fileBytes ), "repo_name" , buildPodName , - 1 )
142- finalManifest = strings .Replace (finalManifest , "puturl" , slugBuilderInfo .PushURL , - 1 )
143- finalManifest = strings .Replace (finalManifest , "tar-url" , slugBuilderInfo .TarURL , - 1 )
142+ finalManifest = strings .Replace (finalManifest , "puturl" , slugBuilderInfo .PushURL () , - 1 )
143+ finalManifest = strings .Replace (finalManifest , "tar-url" , slugBuilderInfo .TarURL () , - 1 )
144144 } else {
145- buildPodName = fmt .Sprintf ("slugbuild-%s-%s-%s" , appName , gitSha .Short , uid )
145+ buildPodName = fmt .Sprintf ("slugbuild-%s-%s-%s" , appName , gitSha .Short () , uid )
146146 finalManifest = strings .Replace (string (fileBytes ), "repo_name" , buildPodName , - 1 )
147- finalManifest = strings .Replace (finalManifest , "puturl" , slugBuilderInfo .PushURL , - 1 )
148- finalManifest = strings .Replace (finalManifest , "tar-url" , slugBuilderInfo .TarURL , - 1 )
147+ finalManifest = strings .Replace (finalManifest , "puturl" , slugBuilderInfo .PushURL () , - 1 )
148+ finalManifest = strings .Replace (finalManifest , "tar-url" , slugBuilderInfo .TarURL () , - 1 )
149149 finalManifest = strings .Replace (finalManifest , "buildurl" , buildPackURL , - 1 )
150150 }
151151
@@ -164,9 +164,9 @@ func build(conf *Config, s3Client *s3.S3, builderKey, rawGitSha string) error {
164164 return fmt .Errorf ("opening %s for read (%s)" , appTgz , err )
165165 }
166166
167- log .Debug ("Uploading tar to %s/%s/%s" , s3Client .Endpoint , bucketName , slugBuilderInfo .TarKey )
168- if err := storage .UploadObject (s3Client , bucketName , slugBuilderInfo .TarKey , appTgzReader ); err != nil {
169- return fmt .Errorf ("uploading %s to %s/%s (%v)" , absAppTgz , bucketName , slugBuilderInfo .TarKey , err )
167+ log .Debug ("Uploading tar to %s/%s/%s" , s3Client .Endpoint , bucketName , slugBuilderInfo .TarKey () )
168+ if err := storage .UploadObject (s3Client , bucketName , slugBuilderInfo .TarKey () , appTgzReader ); err != nil {
169+ return fmt .Errorf ("uploading %s to %s/%s (%v)" , absAppTgz , bucketName , slugBuilderInfo .TarKey () , err )
170170 }
171171
172172 log .Info ("Starting build... but first, coffee!" )
@@ -219,9 +219,9 @@ func build(conf *Config, s3Client *s3.S3, builderKey, rawGitSha string) error {
219219 // poll the s3 server to ensure the slug exists
220220 // TODO: time out looking
221221 for {
222- exists , err := storage .ObjectExists (s3Client , bucketName , slugBuilderInfo .PushKey )
222+ exists , err := storage .ObjectExists (s3Client , bucketName , slugBuilderInfo .PushKey () )
223223 if err != nil {
224- return fmt .Errorf ("Checking if object %s/%s exists (%s)" , bucketName , slugBuilderInfo .PushKey , err )
224+ return fmt .Errorf ("Checking if object %s/%s exists (%s)" , bucketName , slugBuilderInfo .PushKey () , err )
225225 }
226226 if exists {
227227 break
@@ -233,7 +233,7 @@ func build(conf *Config, s3Client *s3.S3, builderKey, rawGitSha string) error {
233233 log .Info ("Launching..." )
234234
235235 buildHook := & pkg.BuildHook {
236- Sha : gitSha .Full ,
236+ Sha : gitSha .Full () ,
237237 ReceiveUser : conf .Username ,
238238 ReceiveRepo : appName ,
239239 Image : appName ,
0 commit comments