mirror of
https://github.com/labring/sealos.git
synced 2026-09-21 13:51:32 +08:00
fix: concat ldflags str (#4893)
This commit is contained in:
@@ -64,7 +64,7 @@ test: manifests generate fmt vet envtest ## Run tests.
|
||||
.PHONY: build
|
||||
build: ## Build manager binary.
|
||||
LD_FLAGS="-s -w"; \
|
||||
[ -n "$(CRYPTOKEY)" ] && LD_FLAGS+="-X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY} -X github.com/labring/sealos/controllers/pkg/database.cryptoKey=${CRYPTOKEY}"; \
|
||||
[ -n "$(CRYPTOKEY)" ] && LD_FLAGS+=" -X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY} -X github.com/labring/sealos/controllers/pkg/database.cryptoKey=${CRYPTOKEY}"; \
|
||||
CGO_ENABLED=0 GOOS=linux go build -ldflags "$${LD_FLAGS}" -trimpath -o bin/manager main.go
|
||||
|
||||
.PHONY: run
|
||||
|
||||
@@ -51,7 +51,7 @@ CONTROLLER_PKG=github.com/labring/sealos/controllers/pkg
|
||||
CONTROLLER_LICENSE=github.com/labring/sealos/controllers/license/internal/controller
|
||||
build: fmt vet ## Build manager binary.
|
||||
LD_FLAGS="-s -w"; \
|
||||
[ -n "$(CRYPTOKEY)" ] && LD_FLAGS+="-X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY} -X github.com/labring/sealos/controllers/pkg/database.cryptoKey=${CRYPTOKEY}"; \
|
||||
[ -n "$(CRYPTOKEY)" ] && LD_FLAGS+=" -X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY} -X github.com/labring/sealos/controllers/pkg/database.cryptoKey=${CRYPTOKEY}"; \
|
||||
CGO_ENABLED=0 GOOS=linux go build -ldflags "$${LD_FLAGS}" -trimpath -o bin/preset-${GOARCH} cmd/preset/main.go && chmod +x bin/preset-${GOARCH} && cp bin/preset-${GOARCH} bin/manager
|
||||
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ CONTROLLER_PKG=github.com/labring/sealos/controllers/pkg
|
||||
CONTROLLER_LICENSE=github.com/labring/sealos/controllers/license/internal
|
||||
build: manifests generate fmt vet ## Build manager binary.
|
||||
LD_FLAGS="-s -w"; \
|
||||
[ -n "$(CRYPTOKEY)" ] && LD_FLAGS+="-X ${CONTROLLER_PKG}/crypto.encryptionKey=${CRYPTOKEY} -X ${CONTROLLER_PKG}/database.cryptoKey=${CRYPTOKEY}"; \
|
||||
[ -n "$(CRYPTOKEY)" ] && LD_FLAGS+=" -X ${CONTROLLER_PKG}/crypto.encryptionKey=${CRYPTOKEY} -X ${CONTROLLER_PKG}/database.cryptoKey=${CRYPTOKEY}"; \
|
||||
[ -n "$(LICENSE_KEY)" ] && LD_FLAGS+=" -X ${CONTROLLER_LICENSE}/util/key.EncryptionKey=${LICENSE_KEY}"; \
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -ldflags "$${LD_FLAGS}" -trimpath -o bin/manager cmd/manager/main.go
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ test: manifests generate fmt vet envtest ## Run tests.
|
||||
.PHONY: build
|
||||
build: ## Build manager binary.
|
||||
LD_FLAGS="-s -w"; \
|
||||
[ -n "$(CRYPTOKEY)" ] && LD_FLAGS+="-X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY} -X github.com/labring/sealos/controllers/pkg/database.cryptoKey=${CRYPTOKEY}"; \
|
||||
[ -n "$(CRYPTOKEY)" ] && LD_FLAGS+=" -X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY} -X github.com/labring/sealos/controllers/pkg/database.cryptoKey=${CRYPTOKEY}"; \
|
||||
CGO_ENABLED=0 GOOS=linux go build -ldflags "$${LD_FLAGS}" -trimpath -o bin/manager main.go
|
||||
|
||||
.PHONY: run
|
||||
|
||||
@@ -64,7 +64,7 @@ test: manifests generate fmt vet envtest ## Run tests.
|
||||
.PHONY: build
|
||||
build: ## Build manager binary.
|
||||
LD_FLAGS="-s -w"; \
|
||||
[ -n "$(CRYPTOKEY)" ] && LD_FLAGS+="-X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY} -X github.com/labring/sealos/controllers/pkg/database.cryptoKey=${CRYPTOKEY}"; \
|
||||
[ -n "$(CRYPTOKEY)" ] && LD_FLAGS+=" -X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY} -X github.com/labring/sealos/controllers/pkg/database.cryptoKey=${CRYPTOKEY}"; \
|
||||
CGO_ENABLED=0 GOOS=linux go build -ldflags "$${LD_FLAGS}" -trimpath -o bin/manager main.go
|
||||
|
||||
.PHONY: run
|
||||
|
||||
@@ -44,7 +44,7 @@ clean:
|
||||
.PHONY: build
|
||||
build: ## Build service-hub binary.
|
||||
LD_FLAGS="-s -w"; \
|
||||
[ -n "$(CRYPTOKEY)" ] && LD_FLAGS+="-X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY}"; \
|
||||
[ -n "$(CRYPTOKEY)" ] && LD_FLAGS+=" -X github.com/labring/sealos/controllers/pkg/crypto.encryptionKey=${CRYPTOKEY}"; \
|
||||
CGO_ENABLED=0 GOOS=linux go build -ldflags "$${LD_FLAGS}" -trimpath -o bin/manager main.go
|
||||
|
||||
.PHONY: docker-build
|
||||
|
||||
Reference in New Issue
Block a user