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 provides the storage configuration.
S3 struct { S3 struct {
Bucket string `envconfig:"DRONE_S3_BUCKET"` Bucket string `envconfig:"DRONE_S3_BUCKET"`
Prefix string `envconfig:"DRONE_S3_PREFIX"` Prefix string `envconfig:"DRONE_S3_PREFIX"`
Endpoint string `envconfig:"DRONE_S3_ENDPOINT"`
} }
// HTTP provides http configuration. // HTTP provides http configuration.

View File

@ -85,6 +85,7 @@ func provideLogStore(db *db.DB, config config.Config) core.LogStore {
return logs.NewS3Env( return logs.NewS3Env(
config.S3.Bucket, config.S3.Bucket,
config.S3.Prefix, 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 RUN apk add -U --no-cache ca-certificates
FROM alpine:3.6 FROM alpine:3.9
ENV GODEBUG netdns=go ENV GODEBUG netdns=go
ENV DRONE_RUNNER_OS=linux ENV DRONE_RUNNER_OS=linux
ENV DRONE_RUNNER_ARCH=amd64 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 RUN apk add -U --no-cache ca-certificates
FROM alpine:3.6 FROM alpine:3.9
ENV GODEBUG netdns=go ENV GODEBUG netdns=go
ENV DRONE_RUNNER_OS=linux ENV DRONE_RUNNER_OS=linux
ENV DRONE_RUNNER_ARCH=amd64 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 RUN apk add -U --no-cache ca-certificates
FROM alpine:3.6 FROM alpine:3.9
ENV GODEBUG=netdns=go ENV GODEBUG=netdns=go
ENV DRONE_RUNNER_OS=linux ENV DRONE_RUNNER_OS=linux
ENV DRONE_RUNNER_ARCH=arm 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 RUN apk add -U --no-cache ca-certificates
FROM alpine:3.6 FROM alpine:3.9
ENV GODEBUG=netdns=go ENV GODEBUG=netdns=go
ENV DRONE_RUNNER_OS=linux ENV DRONE_RUNNER_OS=linux
ENV DRONE_RUNNER_ARCH=arm64 ENV DRONE_RUNNER_ARCH=arm64

View File

@ -1,9 +1,9 @@
# docker build --rm -f docker/Dockerfile -t drone/drone . # 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 RUN apk add -U --no-cache ca-certificates
FROM alpine:3.6 FROM alpine:3.9
EXPOSE 80 443 EXPOSE 80 443
VOLUME /data VOLUME /data

View File

@ -1,9 +1,9 @@
# docker build --rm -f docker/Dockerfile -t drone/drone . # 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 RUN apk add -U --no-cache ca-certificates
FROM alpine:3.6 FROM alpine:3.9
EXPOSE 80 443 EXPOSE 80 443
VOLUME /data VOLUME /data

View File

@ -1,9 +1,9 @@
# docker build --rm -f docker/Dockerfile -t drone/drone . # 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 RUN apk add -U --no-cache ca-certificates
FROM alpine:3.6 FROM alpine:3.9
EXPOSE 80 443 EXPOSE 80 443
VOLUME /data VOLUME /data

View File

@ -22,12 +22,14 @@ import (
// s3gof3r as an alternate. github.com/rlmcpherson/s3gof3r // s3gof3r as an alternate. github.com/rlmcpherson/s3gof3r
// NewS3Env returns a new S3 log store. // NewS3Env returns a new S3 log store.
func NewS3Env(bucket, prefix string) core.LogStore { func NewS3Env(bucket, prefix, endpoint string) core.LogStore {
return &s3store{ return &s3store{
bucket: bucket, bucket: bucket,
prefix: prefix, prefix: prefix,
session: session.Must( session: session.Must(
session.NewSession(), session.NewSession(&aws.Config{
Endpoint: aws.String(endpoint),
}),
), ),
} }
} }