Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add acl option for s3 #732

Merged
merged 1 commit into from Jul 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions config/config.go
Expand Up @@ -281,6 +281,7 @@ type S3 struct {
Folder string
Profile string
Endpoint string // used for minio for example
ACL string
}

// Put HTTP upload configuration
Expand Down
4 changes: 4 additions & 0 deletions pipeline/s3/s3.go
Expand Up @@ -38,6 +38,9 @@ func (Pipe) Default(ctx *context.Context) error {
if s3.Region == "" {
s3.Region = "us-east-1"
}
if s3.ACL == "" {
s3.ACL = "private"
}
}
return nil
}
Expand Down Expand Up @@ -99,6 +102,7 @@ func upload(ctx *context.Context, conf config.S3) error {
Bucket: aws.String(conf.Bucket),
Key: aws.String(filepath.Join(folder, artifact.Name)),
Body: f,
ACL: aws.String(conf.ACL),
})
return err
})
Expand Down
1 change: 1 addition & 0 deletions pipeline/s3/s3_test.go
Expand Up @@ -49,6 +49,7 @@ func TestDefaults(t *testing.T) {
Bucket: "foo",
Region: "us-east-1",
Folder: "{{ .ProjectName }}/{{ .Tag }}",
ACL: "private",
}}, ctx.Config.S3)
}

Expand Down
4 changes: 4 additions & 0 deletions www/content/s3.md
Expand Up @@ -39,9 +39,13 @@ s3:
# want to push your artifacts to a minio server for example.
# Default is AWS S3 URL.
endpoint: "http://minio.foo.com"
# Sets the ACL of the object using the specified canned ACL.
# Default is private.
acl: public-read
```

> Learn more about the [name template engine](/templates).
> Learn more about the [acl](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUTacl.html).

## Authentication

Expand Down