This commit is contained in:
@@ -4,6 +4,10 @@ import (
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/credentials"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
s3 "github.com/fclairamb/afero-s3"
|
||||
"github.com/go-ini/ini"
|
||||
"github.com/spf13/afero"
|
||||
"golang.org/x/crypto/openpgp"
|
||||
@@ -18,7 +22,7 @@ import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
var VERSION = "1.4.0"
|
||||
var VERSION = "1.4.1"
|
||||
|
||||
func packageName(name string) string {
|
||||
if index := strings.Index(name, "_"); index != -1 {
|
||||
@@ -71,7 +75,30 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
fs = afero.NewBasePathFs(afero.NewOsFs(), conf.Repo.Root)
|
||||
|
||||
switch conf.Fs.Driver {
|
||||
case "s3":
|
||||
awsConfig := &aws.Config{
|
||||
Region: aws.String(conf.Fs.S3.Region),
|
||||
Credentials: credentials.NewStaticCredentials(conf.Fs.S3.ID, conf.Fs.S3.Secret, ""),
|
||||
}
|
||||
|
||||
if conf.Fs.S3.Endpoint != "" {
|
||||
awsConfig.Endpoint = aws.String(conf.Fs.S3.Endpoint)
|
||||
}
|
||||
|
||||
sess, err := session.NewSession(awsConfig)
|
||||
|
||||
if err != nil {
|
||||
log.Fatalln("Unable to create S3 session:", err)
|
||||
}
|
||||
|
||||
fs = s3.NewFs(conf.Fs.S3.Bucket, sess)
|
||||
case "local":
|
||||
fallthrough
|
||||
default:
|
||||
fs = afero.NewBasePathFs(afero.NewOsFs(), conf.Repo.Root)
|
||||
}
|
||||
|
||||
if err := createDirs(conf); err != nil {
|
||||
log.Println(err)
|
||||
|
||||
Reference in New Issue
Block a user