File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,16 +60,7 @@ func run(cmd *exec.Cmd) error {
6060 return cmd .Run ()
6161}
6262
63- func build (conf * Config , builderKey , gitSha string ) error {
64- storage , err := getStorageConfig ()
65- if err != nil {
66- return err
67- }
68- creds , err := getStorageCreds ()
69- if err == errMissingKey || err == errMissingSecret {
70- return err
71- }
72-
63+ func build (conf * Config , s3Client * s3.Client , builderKey , gitSha string ) error {
7364 repo := conf .Repository
7465 if len (gitSha ) <= shortShaIdx {
7566 return errGitShaTooShort {sha : gitSha }
Original file line number Diff line number Diff line change 88 "strings"
99
1010 "github.com/deis/builder/pkg/gitreceive/log"
11+ "github.com/deis/builder/pkg/gitreceive/storage"
1112)
1213
1314const (
@@ -30,6 +31,12 @@ func Run(conf *Config) error {
3031 return fmt .Errorf ("couldn't get builder key from %s (%s)" , builderKeyLocation , err )
3132 }
3233 builderKey := string (builderKeyBytes )
34+
35+ s3Client , err := storage .GetClient ()
36+ if err != nil {
37+ return fmt .Errorf ("configuring S3 client (%s)" , err )
38+ }
39+
3340 scanner := bufio .NewScanner (os .Stdin )
3441 for scanner .Scan () {
3542 line := scanner .Text ()
@@ -46,7 +53,7 @@ func Run(conf *Config) error {
4653 }
4754 // if we're processing a receive-pack on an existing repo, run a build
4855 if strings .HasPrefix (conf .SSHOriginalCommand , "git-receive-pack" ) {
49- if err := build (conf , builderKey , newRev ); err != nil {
56+ if err := build (conf , s3Client , builderKey , newRev ); err != nil {
5057 return err
5158 }
5259 }
You can’t perform that action at this time.
0 commit comments