代码拉取完成,页面将自动刷新
同步操作将从 EdgexFoundry/device-mqtt-go 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
.PHONY: build test unittest lint clean prepare update docker
# change the following boolean flag to enable or disable the Full RELRO (RELocation Read Only) for linux ELF (Executable and Linkable Format) binaries
ENABLE_FULL_RELRO=true
# change the following boolean flag to enable or disable PIE for linux binaries which is needed for ASLR (Address Space Layout Randomization) on Linux, the ASLR support on Windows is enabled by default
ENABLE_PIE=true
MICROSERVICES=cmd/device-mqtt
ARCH=$(shell uname -m)
.PHONY: $(MICROSERVICES)
DOCKERS=docker_device_mqtt_go
.PHONY: $(DOCKERS)
VERSION=$(shell cat ./VERSION 2>/dev/null || echo 0.0.0)
GIT_SHA=$(shell git rev-parse HEAD)
ifeq ($(ENABLE_FULL_RELRO), true)
ENABLE_FULL_RELRO_GOFLAGS = -bindnow
endif
SDKVERSION=$(shell cat ./go.mod | grep 'github.com/edgexfoundry/device-sdk-go/v4 v' | awk '{print $$2}')
GOFLAGS=-ldflags "-X github.com/edgexfoundry/device-mqtt-go.Version=$(VERSION) \
-X github.com/edgexfoundry/device-sdk-go/v4/internal/common.SDKVersion=$(SDKVERSION) \
$(ENABLE_FULL_RELRO_GOFLAGS)" \
-trimpath -mod=readonly
ifeq ($(ENABLE_PIE), true)
GOFLAGS += -buildmode=pie
endif
build: $(MICROSERVICES)
build-nats:
make -e ADD_BUILD_TAGS=include_nats_messaging build
tidy:
go mod tidy
cmd/device-mqtt:
CGO_ENABLED=0 go build -tags "$(ADD_BUILD_TAGS)" $(GOFLAGS) -o $@ ./cmd
unittest:
go test ./... -coverprofile=coverage.out ./...
lint:
@which golangci-lint >/dev/null || echo "WARNING: go linter not installed. To install, run make install-lint"
@if [ "z${ARCH}" = "zx86_64" ] && which golangci-lint >/dev/null ; then golangci-lint run --config .golangci.yml ; else echo "WARNING: Linting skipped (not on x86_64 or linter not installed)"; fi
install-lint:
sudo curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.61.0
test: unittest lint
go vet ./...
gofmt -l $$(find . -type f -name '*.go'| grep -v "/vendor/")
[ "`gofmt -l $$(find . -type f -name '*.go'| grep -v "/vendor/")`" = "" ]
./bin/test-attribution-txt.sh
clean:
rm -f $(MICROSERVICES)
run:
cd bin && ./edgex-launch.sh
docker: $(DOCKERS)
docker_device_mqtt_go:
docker build \
--build-arg ADD_BUILD_TAGS=$(ADD_BUILD_TAGS) \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/device-mqtt:$(GIT_SHA) \
-t edgexfoundry/device-mqtt:$(VERSION)-dev \
.
docker-nats:
make -e ADD_BUILD_TAGS=include_nats_messaging docker
vendor:
CGO_ENABLED=0 go mod vendor
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。