Update deployment configuration to enable prefixes
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Rob Watson 2022-01-18 17:56:37 +01:00
parent fbbb2e2fda
commit 58bbc06e6f
4 changed files with 11 additions and 16 deletions

View File

@ -30,6 +30,6 @@ COPY --from=go-builder /app/clipper /bin/clipper
COPY --from=go-builder /root/go/bin/migrate /bin/migrate COPY --from=go-builder /root/go/bin/migrate /bin/migrate
COPY --from=node-builder /app/build /app/assets COPY --from=node-builder /app/build /app/assets
ENV ASSETS_HTTP_ROOT "/app/assets" ENV CLIPPER_ASSETS_HTTP_ROOT "/app/assets"
ENTRYPOINT ["/bin/clipper"] ENTRYPOINT ["/bin/clipper"]

View File

@ -1,33 +1,33 @@
ENV=development # or production CLIPPER_ENV=development # or production
BIND_ADDR=localhost:8888 CLIPPER_BIND_ADDR=localhost:8888
# PostgreSQL connection string. # PostgreSQL connection string.
DATABASE_URL= CLIPPER_DATABASE_URL=
# Optional. If set, files in this location will be served over HTTP at /. # Optional. If set, files in this location will be served over HTTP at /.
# Mostly useful for deployment. # Mostly useful for deployment.
ASSETS_HTTP_ROOT= CLIPPER_ASSETS_HTTP_ROOT=
# Set the store type - either s3 or filesystem. Defaults to filesystem. The S3 # Set the store type - either s3 or filesystem. Defaults to filesystem. The S3
# store is recommended for production usage. # store is recommended for production usage.
# #
# NOTE: Enabling the file system store will disable serving assets over HTTP. # NOTE: Enabling the file system store will disable serving assets over HTTP.
FILE_STORE=filesystem CLIPPER_FILE_STORE=filesystem
# The base URL used for serving file store assets. # The base URL used for serving file store assets.
# Example: http://localhost:8888 # Example: http://localhost:8888
FILE_STORE_HTTP_BASE_URL= CLIPPER_FILE_STORE_HTTP_BASE_URL=
# The root directory for the file system store. # The root directory for the file system store.
FILE_STORE_HTTP_ROOT=data/ CLIPPER_FILE_STORE_HTTP_ROOT=data/
# AWS credentials, required for the S3 store. # AWS credentials, required for the S3 store.
AWS_ACCESS_KEY_ID= AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY= AWS_SECRET_ACCESS_KEY=
AWS_REGION= AWS_REGION=
S3_BUCKET= CLIPPER_S3_BUCKET=
# The number of concurrent FFMPEG processes that will be permitted. # The number of concurrent FFMPEG processes that will be permitted.
# Defaults to runtime.NumCPU(): # Defaults to runtime.NumCPU():
FFMPEG_WORKER_POOL_SIZE= CLIPPER_FFMPEG_WORKER_POOL_SIZE=

View File

@ -43,8 +43,7 @@ type Config struct {
FFmpegWorkerPoolSize int FFmpegWorkerPoolSize int
} }
// TODO: update deployment and add prefix. const Prefix = "CLIPPER_"
var Prefix = ""
func envPrefix(k string) string { return Prefix + k } func envPrefix(k string) string { return Prefix + k }
func getenvPrefix(k string) string { return os.Getenv(Prefix + k) } func getenvPrefix(k string) string { return os.Getenv(Prefix + k) }

View File

@ -12,10 +12,6 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
func init() {
config.Prefix = "CLIPPER_"
}
type env map[string]string type env map[string]string
// clearenv clears prefixed keys from the environment. Currently it does not // clearenv clears prefixed keys from the environment. Currently it does not