Merge pull request #2600 from JordanSussman/master

feat(s3): allow user to specify s3 endpoint for non aws usage
This commit is contained in:
Brad Rydzewski 2019-02-21 12:24:46 -08:00 committed by GitHub
commit 02df116424
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 22 additions and 18 deletions

View file

@ -330,8 +330,9 @@ type (
// S3 provides the storage configuration.
S3 struct {
Bucket string `envconfig:"DRONE_S3_BUCKET"`
Prefix string `envconfig:"DRONE_S3_PREFIX"`
Bucket string `envconfig:"DRONE_S3_BUCKET"`
Prefix string `envconfig:"DRONE_S3_PREFIX"`
Endpoint string `envconfig:"DRONE_S3_ENDPOINT"`
}
// HTTP provides http configuration.

View file

@ -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,
)
}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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),
}),
),
}
}