Merge pull request #2600 from JordanSussman/master
feat(s3): allow user to specify s3 endpoint for non aws usage
This commit is contained in:
commit
02df116424
10 changed files with 22 additions and 18 deletions
|
@ -332,6 +332,7 @@ type (
|
|||
S3 struct {
|
||||
Bucket string `envconfig:"DRONE_S3_BUCKET"`
|
||||
Prefix string `envconfig:"DRONE_S3_PREFIX"`
|
||||
Endpoint string `envconfig:"DRONE_S3_ENDPOINT"`
|
||||
}
|
||||
|
||||
// HTTP provides http configuration.
|
||||
|
|
|
@ -85,6 +85,7 @@ func provideLogStore(db *db.DB, config config.Config) core.LogStore {
|
|||
return logs.NewS3Env(
|
||||
config.S3.Bucket,
|
||||
config.S3.Prefix,
|
||||
config.S3.Endpoint,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
FROM alpine:3.6 as alpine
|
||||
FROM alpine:3.9 as alpine
|
||||
RUN apk add -U --no-cache ca-certificates
|
||||
|
||||
FROM alpine:3.6
|
||||
FROM alpine:3.9
|
||||
ENV GODEBUG netdns=go
|
||||
ENV DRONE_RUNNER_OS=linux
|
||||
ENV DRONE_RUNNER_ARCH=amd64
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
FROM alpine:3.6 as alpine
|
||||
FROM alpine:3.9 as alpine
|
||||
RUN apk add -U --no-cache ca-certificates
|
||||
|
||||
FROM alpine:3.6
|
||||
FROM alpine:3.9
|
||||
ENV GODEBUG netdns=go
|
||||
ENV DRONE_RUNNER_OS=linux
|
||||
ENV DRONE_RUNNER_ARCH=amd64
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
FROM alpine:3.6 as alpine
|
||||
FROM alpine:3.9 as alpine
|
||||
RUN apk add -U --no-cache ca-certificates
|
||||
|
||||
FROM alpine:3.6
|
||||
FROM alpine:3.9
|
||||
ENV GODEBUG=netdns=go
|
||||
ENV DRONE_RUNNER_OS=linux
|
||||
ENV DRONE_RUNNER_ARCH=arm
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
FROM alpine:3.6 as alpine
|
||||
FROM alpine:3.9 as alpine
|
||||
RUN apk add -U --no-cache ca-certificates
|
||||
|
||||
FROM alpine:3.6
|
||||
FROM alpine:3.9
|
||||
ENV GODEBUG=netdns=go
|
||||
ENV DRONE_RUNNER_OS=linux
|
||||
ENV DRONE_RUNNER_ARCH=arm64
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# docker build --rm -f docker/Dockerfile -t drone/drone .
|
||||
|
||||
FROM alpine:3.6 as alpine
|
||||
FROM alpine:3.9 as alpine
|
||||
RUN apk add -U --no-cache ca-certificates
|
||||
|
||||
FROM alpine:3.6
|
||||
FROM alpine:3.9
|
||||
EXPOSE 80 443
|
||||
VOLUME /data
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# docker build --rm -f docker/Dockerfile -t drone/drone .
|
||||
|
||||
FROM alpine:3.6 as alpine
|
||||
FROM alpine:3.9 as alpine
|
||||
RUN apk add -U --no-cache ca-certificates
|
||||
|
||||
FROM alpine:3.6
|
||||
FROM alpine:3.9
|
||||
EXPOSE 80 443
|
||||
VOLUME /data
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# docker build --rm -f docker/Dockerfile -t drone/drone .
|
||||
|
||||
FROM alpine:3.6 as alpine
|
||||
FROM alpine:3.9 as alpine
|
||||
RUN apk add -U --no-cache ca-certificates
|
||||
|
||||
FROM alpine:3.6
|
||||
FROM alpine:3.9
|
||||
EXPOSE 80 443
|
||||
VOLUME /data
|
||||
|
||||
|
|
|
@ -22,12 +22,14 @@ import (
|
|||
// s3gof3r as an alternate. github.com/rlmcpherson/s3gof3r
|
||||
|
||||
// NewS3Env returns a new S3 log store.
|
||||
func NewS3Env(bucket, prefix string) core.LogStore {
|
||||
func NewS3Env(bucket, prefix, endpoint string) core.LogStore {
|
||||
return &s3store{
|
||||
bucket: bucket,
|
||||
prefix: prefix,
|
||||
session: session.Must(
|
||||
session.NewSession(),
|
||||
session.NewSession(&aws.Config{
|
||||
Endpoint: aws.String(endpoint),
|
||||
}),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue