forked from TrueCloudLab/frostfs-rest-gw
[#2] Update building
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
parent
24817701ee
commit
61c51ce5a2
7 changed files with 15 additions and 15 deletions
|
@ -21,7 +21,7 @@ FROM scratch
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
|
|
||||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
COPY --from=builder /src/bin/neofs-rest-gw /bin/neofs-rest-gw
|
COPY --from=builder /src/bin/frostfs-rest-gw /bin/frostfs-rest-gw
|
||||||
COPY --from=builder /src/static /static
|
COPY --from=builder /src/static /static
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/neofs-rest-gw"]
|
ENTRYPOINT ["/bin/frostfs-rest-gw"]
|
||||||
|
|
|
@ -3,6 +3,6 @@ RUN apk add --update --no-cache bash ca-certificates
|
||||||
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
|
|
||||||
COPY bin/neofs-rest-gw /bin/neofs-rest-gw
|
COPY bin/frostfs-rest-gw /bin/frostfs-rest-gw
|
||||||
|
|
||||||
CMD ["neofs-rest-gw"]
|
CMD ["frostfs-rest-gw"]
|
||||||
|
|
12
Makefile
12
Makefile
|
@ -8,7 +8,7 @@ BUILD_ARCH ?= amd64
|
||||||
GO_VERSION ?= 1.19
|
GO_VERSION ?= 1.19
|
||||||
LINT_VERSION ?= v1.49.0
|
LINT_VERSION ?= v1.49.0
|
||||||
|
|
||||||
HUB_IMAGE ?= nspccdev/neofs-rest-gw
|
HUB_IMAGE ?= truecloudlab/frostfs-rest-gw
|
||||||
HUB_TAG ?= "$(shell echo ${VERSION} | sed 's/^v//')"
|
HUB_TAG ?= "$(shell echo ${VERSION} | sed 's/^v//')"
|
||||||
|
|
||||||
SWAGGER_VERSION ?= v0.29.0
|
SWAGGER_VERSION ?= v0.29.0
|
||||||
|
@ -31,7 +31,7 @@ SWAGGER_URL ?= "https://github.com/go-swagger/go-swagger/releases/download/$(SWA
|
||||||
# List of binaries to build. For now just one.
|
# List of binaries to build. For now just one.
|
||||||
BINDIR = bin
|
BINDIR = bin
|
||||||
DIRS = "$(BINDIR)"
|
DIRS = "$(BINDIR)"
|
||||||
BINS = "$(BINDIR)/neofs-rest-gw"
|
BINS = "$(BINDIR)/frostfs-rest-gw"
|
||||||
|
|
||||||
.PHONY: help all dep clean format test cover lint docker/lint
|
.PHONY: help all dep clean format test cover lint docker/lint
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ $(BINS): $(DIRS) dep
|
||||||
GOARCH=$(BUILD_ARCH) \
|
GOARCH=$(BUILD_ARCH) \
|
||||||
go build -v -trimpath \
|
go build -v -trimpath \
|
||||||
-ldflags "-X main.Version=$(VERSION)" \
|
-ldflags "-X main.Version=$(VERSION)" \
|
||||||
-o $@ ./cmd/neofs-rest-gw
|
-o $@ ./cmd/frostfs-rest-gw
|
||||||
|
|
||||||
$(DIRS):
|
$(DIRS):
|
||||||
@echo "⇒ Ensure dir: $@"
|
@echo "⇒ Ensure dir: $@"
|
||||||
|
@ -91,7 +91,7 @@ format:
|
||||||
|
|
||||||
# Build clean Docker image
|
# Build clean Docker image
|
||||||
image:
|
image:
|
||||||
@echo "⇒ Build NeoFS REST Gateway docker image "
|
@echo "⇒ Build FrostFS REST Gateway docker image "
|
||||||
@docker build \
|
@docker build \
|
||||||
--build-arg REPO=$(REPO) \
|
--build-arg REPO=$(REPO) \
|
||||||
--build-arg VERSION=$(VERSION) \
|
--build-arg VERSION=$(VERSION) \
|
||||||
|
@ -106,7 +106,7 @@ image-push:
|
||||||
|
|
||||||
# Build dirty Docker image
|
# Build dirty Docker image
|
||||||
image-dirty:
|
image-dirty:
|
||||||
@echo "⇒ Build NeoFS REST Gateway dirty docker image "
|
@echo "⇒ Build FrostFS REST Gateway dirty docker image "
|
||||||
@docker build \
|
@docker build \
|
||||||
--build-arg REPO=$(REPO) \
|
--build-arg REPO=$(REPO) \
|
||||||
--build-arg VERSION=$(VERSION) \
|
--build-arg VERSION=$(VERSION) \
|
||||||
|
@ -139,7 +139,7 @@ docker/generate-server:
|
||||||
--env HOME=/src \
|
--env HOME=/src \
|
||||||
quay.io/goswagger/swagger:$(SWAGGER_VERSION) generate server \
|
quay.io/goswagger/swagger:$(SWAGGER_VERSION) generate server \
|
||||||
-t gen -f ./spec/rest.yaml --exclude-main \
|
-t gen -f ./spec/rest.yaml --exclude-main \
|
||||||
-A neofs-rest-gw -P models.Principal \
|
-A frostfs-rest-gw -P models.Principal \
|
||||||
-C templates/server-config.yaml --template-dir templates
|
-C templates/server-config.yaml --template-dir templates
|
||||||
|
|
||||||
# Run linters in Docker
|
# Run linters in Docker
|
||||||
|
|
|
@ -84,7 +84,7 @@ generate-server Generate boilerplate by spec
|
||||||
|
|
||||||
### Docker
|
### Docker
|
||||||
|
|
||||||
Or you can also use a [Docker image](https://hub.docker.com/r/nspccdev/neofs-rest-gw) provided for released
|
Or you can also use a [Docker image](https://hub.docker.com/r/truecloudlab/frostfs-rest-gw) provided for released
|
||||||
(and occasionally unreleased) versions of gateway (`:latest` points to the latest stable release).
|
(and occasionally unreleased) versions of gateway (`:latest` points to the latest stable release).
|
||||||
|
|
||||||
## Execution
|
## Execution
|
||||||
|
|
|
@ -117,7 +117,7 @@ func config() *viper.Viper {
|
||||||
flagSet.Duration(cmdHealthcheckTimeout, defaultHealthcheckTimeout, "gRPC healthcheck timeout")
|
flagSet.Duration(cmdHealthcheckTimeout, defaultHealthcheckTimeout, "gRPC healthcheck timeout")
|
||||||
flagSet.Duration(cmdRebalance, defaultRebalanceTimer, "gRPC connection rebalance timer")
|
flagSet.Duration(cmdRebalance, defaultRebalanceTimer, "gRPC connection rebalance timer")
|
||||||
|
|
||||||
peers := flagSet.StringArrayP(cmdPeers, "p", nil, "NeoFS nodes")
|
peers := flagSet.StringArrayP(cmdPeers, "p", nil, "FrostFS nodes")
|
||||||
|
|
||||||
// init server flags
|
// init server flags
|
||||||
restapi.BindDefaultFlags(flagSet)
|
restapi.BindDefaultFlags(flagSet)
|
||||||
|
@ -146,7 +146,7 @@ func config() *viper.Viper {
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case help != nil && *help:
|
case help != nil && *help:
|
||||||
fmt.Printf("NeoFS REST Gateway %s\n", Version)
|
fmt.Printf("FrostFS REST Gateway %s\n", Version)
|
||||||
flagSet.PrintDefaults()
|
flagSet.PrintDefaults()
|
||||||
|
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
@ -166,7 +166,7 @@ func config() *viper.Viper {
|
||||||
|
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
case version != nil && *version:
|
case version != nil && *version:
|
||||||
fmt.Printf("NeoFS REST Gateway\nVersion: %s\nGoVersion: %s\n", Version, runtime.Version())
|
fmt.Printf("FrostFS REST Gateway\nVersion: %s\nGoVersion: %s\n", Version, runtime.Version())
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
case configFlag != nil && *configFlag != "":
|
case configFlag != nil && *configFlag != "":
|
||||||
if cfgFile, err := os.Open(*configFlag); err != nil {
|
if cfgFile, err := os.Open(*configFlag); err != nil {
|
|
@ -20,7 +20,7 @@ func main() {
|
||||||
|
|
||||||
neofsAPI, err := newNeofsAPI(ctx, logger, v)
|
neofsAPI, err := newNeofsAPI(ctx, logger, v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Fatal("init neofs", zap.Error(err))
|
logger.Fatal("init frostfs", zap.Error(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
swaggerSpec, err := loads.Analyzed(restapi.SwaggerJSON, "")
|
swaggerSpec, err := loads.Analyzed(restapi.SwaggerJSON, "")
|
Loading…
Reference in a new issue