don't use S3 CreateBucket and clean up
Docker server image / build-and-push (push) Successful in 1m6s
Docker server image / build-and-push (push) Successful in 1m6s
This commit is contained in:
@@ -2,7 +2,7 @@ SHELL := /bin/sh
|
||||
|
||||
BUF ?= buf
|
||||
|
||||
.PHONY: buf-lint buf-generate py-sync py-test go-test test compose-up compose-up-dev run-server
|
||||
.PHONY: buf-lint buf-generate py-sync py-test go-test test compose-up compose-up-dev s3-init run-server
|
||||
|
||||
buf-lint:
|
||||
$(BUF) lint
|
||||
@@ -32,7 +32,21 @@ compose-up:
|
||||
compose-up-dev:
|
||||
docker compose --env-file .env.example -f deploy/docker-compose.dev.yml up
|
||||
|
||||
run-server:
|
||||
s3-init:
|
||||
@set -a; \
|
||||
if [ -f .env ]; then . ./.env; fi; \
|
||||
set +a; \
|
||||
endpoint="$${S3_ENDPOINT:-localhost:8333}"; \
|
||||
case "$$endpoint" in seaweedfs:8333) endpoint=localhost:8333 ;; esac; \
|
||||
bucket="$${S3_BUCKET:-officeconvert}"; \
|
||||
access_key="$${S3_ACCESS_KEY:-minioadmin}"; \
|
||||
secret_key="$${S3_SECRET_KEY:-minioadmin}"; \
|
||||
port="$${endpoint#*:}"; \
|
||||
docker run --rm --add-host=host.docker.internal:host-gateway minio/mc:latest /bin/sh -c " \
|
||||
mc alias set local http://host.docker.internal:$$port '$$access_key' '$$secret_key' && \
|
||||
mc mb local/$$bucket --ignore-existing"
|
||||
|
||||
run-server: s3-init
|
||||
@set -a; \
|
||||
if [ -f .env ]; then . ./.env; fi; \
|
||||
set +a; \
|
||||
|
||||
Reference in New Issue
Block a user