[#2] Update building

Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
Denis Kirillov 2022-12-16 15:41:49 +03:00 committed by Alex Vanin
parent 24817701ee
commit 61c51ce5a2
7 changed files with 15 additions and 15 deletions

View file

@ -21,7 +21,7 @@ FROM scratch
WORKDIR /
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
ENTRYPOINT ["/bin/neofs-rest-gw"]
ENTRYPOINT ["/bin/frostfs-rest-gw"]

View file

@ -3,6 +3,6 @@ RUN apk add --update --no-cache bash ca-certificates
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"]

View file

@ -8,7 +8,7 @@ BUILD_ARCH ?= amd64
GO_VERSION ?= 1.19
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//')"
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.
BINDIR = bin
DIRS = "$(BINDIR)"
BINS = "$(BINDIR)/neofs-rest-gw"
BINS = "$(BINDIR)/frostfs-rest-gw"
.PHONY: help all dep clean format test cover lint docker/lint
@ -45,7 +45,7 @@ $(BINS): $(DIRS) dep
GOARCH=$(BUILD_ARCH) \
go build -v -trimpath \
-ldflags "-X main.Version=$(VERSION)" \
-o $@ ./cmd/neofs-rest-gw
-o $@ ./cmd/frostfs-rest-gw
$(DIRS):
@echo "⇒ Ensure dir: $@"
@ -91,7 +91,7 @@ format:
# Build clean Docker image
image:
@echo "⇒ Build NeoFS REST Gateway docker image "
@echo "⇒ Build FrostFS REST Gateway docker image "
@docker build \
--build-arg REPO=$(REPO) \
--build-arg VERSION=$(VERSION) \
@ -106,7 +106,7 @@ image-push:
# Build dirty Docker image
image-dirty:
@echo "⇒ Build NeoFS REST Gateway dirty docker image "
@echo "⇒ Build FrostFS REST Gateway dirty docker image "
@docker build \
--build-arg REPO=$(REPO) \
--build-arg VERSION=$(VERSION) \
@ -139,7 +139,7 @@ docker/generate-server:
--env HOME=/src \
quay.io/goswagger/swagger:$(SWAGGER_VERSION) generate server \
-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
# Run linters in Docker

View file

@ -84,7 +84,7 @@ generate-server Generate boilerplate by spec
### 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).
## Execution

View file

@ -117,7 +117,7 @@ func config() *viper.Viper {
flagSet.Duration(cmdHealthcheckTimeout, defaultHealthcheckTimeout, "gRPC healthcheck timeout")
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
restapi.BindDefaultFlags(flagSet)
@ -146,7 +146,7 @@ func config() *viper.Viper {
switch {
case help != nil && *help:
fmt.Printf("NeoFS REST Gateway %s\n", Version)
fmt.Printf("FrostFS REST Gateway %s\n", Version)
flagSet.PrintDefaults()
fmt.Println()
@ -166,7 +166,7 @@ func config() *viper.Viper {
os.Exit(0)
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)
case configFlag != nil && *configFlag != "":
if cfgFile, err := os.Open(*configFlag); err != nil {

View file

@ -20,7 +20,7 @@ func main() {
neofsAPI, err := newNeofsAPI(ctx, logger, v)
if err != nil {
logger.Fatal("init neofs", zap.Error(err))
logger.Fatal("init frostfs", zap.Error(err))
}
swaggerSpec, err := loads.Analyzed(restapi.SwaggerJSON, "")