1 Star 0 Fork 10

jhhe66/EdgeX Foundry

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 6.36 KB
一键复制 编辑 原始数据 按行查看 历史
Ernesto Ojeda 提交于 2021-10-06 15:26 . ci: changes required for Jakara LTS
#
# Copyright (c) 2018 Cavium
#
# SPDX-License-Identifier: Apache-2.0
#
.PHONY: build clean unittest hadolint lint test docker run
GO=CGO_ENABLED=0 GO111MODULE=on go
GOCGO=CGO_ENABLED=1 GO111MODULE=on go
DOCKERS= \
docker_core_data \
docker_core_metadata \
docker_core_command \
docker_support_notifications \
docker_sys_mgmt_agent \
docker_support_scheduler \
docker_security_proxy_setup \
docker_security_secretstore_setup \
docker_security_bootstrapper
.PHONY: $(DOCKERS)
MICROSERVICES= \
cmd/core-data/core-data \
cmd/core-metadata/core-metadata \
cmd/core-command/core-command \
cmd/support-notifications/support-notifications \
cmd/sys-mgmt-executor/sys-mgmt-executor \
cmd/sys-mgmt-agent/sys-mgmt-agent \
cmd/support-scheduler/support-scheduler \
cmd/security-proxy-setup/security-proxy-setup \
cmd/security-secretstore-setup/security-secretstore-setup \
cmd/security-file-token-provider/security-file-token-provider \
cmd/secrets-config/secrets-config \
cmd/security-bootstrapper/security-bootstrapper
.PHONY: $(MICROSERVICES)
VERSION=$(shell cat ./VERSION 2>/dev/null || echo 0.0.0)
DOCKER_TAG=$(VERSION)-dev
GOFLAGS=-ldflags "-X github.com/edgexfoundry/edgex-go.Version=$(VERSION)"
GOTESTFLAGS?=-race
GIT_SHA=$(shell git rev-parse HEAD)
ARCH=$(shell uname -m)
build: $(MICROSERVICES)
tidy:
go mod tidy
cmd/core-metadata/core-metadata:
$(GO) build $(GOFLAGS) -o $@ ./cmd/core-metadata
cmd/core-data/core-data:
$(GOCGO) build $(GOFLAGS) -o $@ ./cmd/core-data
cmd/core-command/core-command:
$(GO) build $(GOFLAGS) -o $@ ./cmd/core-command
cmd/support-notifications/support-notifications:
$(GO) build $(GOFLAGS) -o $@ ./cmd/support-notifications
cmd/sys-mgmt-executor/sys-mgmt-executor:
$(GO) build $(GOFLAGS) -o $@ ./cmd/sys-mgmt-executor
cmd/sys-mgmt-agent/sys-mgmt-agent:
$(GO) build $(GOFLAGS) -o $@ ./cmd/sys-mgmt-agent
cmd/support-scheduler/support-scheduler:
$(GO) build $(GOFLAGS) -o $@ ./cmd/support-scheduler
cmd/security-proxy-setup/security-proxy-setup:
$(GO) build $(GOFLAGS) -o ./cmd/security-proxy-setup/security-proxy-setup ./cmd/security-proxy-setup
cmd/security-secretstore-setup/security-secretstore-setup:
$(GO) build $(GOFLAGS) -o ./cmd/security-secretstore-setup/security-secretstore-setup ./cmd/security-secretstore-setup
cmd/security-file-token-provider/security-file-token-provider:
$(GO) build $(GOFLAGS) -o ./cmd/security-file-token-provider/security-file-token-provider ./cmd/security-file-token-provider
cmd/secrets-config/secrets-config:
$(GO) build $(GOFLAGS) -o ./cmd/secrets-config ./cmd/secrets-config
cmd/security-bootstrapper/security-bootstrapper:
$(GO) build $(GOFLAGS) -o ./cmd/security-bootstrapper/security-bootstrapper ./cmd/security-bootstrapper
clean:
rm -f $(MICROSERVICES)
unittest:
go mod tidy
GO111MODULE=on go test $(GOTESTFLAGS) -coverprofile=coverage.out ./...
hadolint:
if which hadolint > /dev/null ; then hadolint --config .hadolint.yml `find * -type f -name 'Dockerfile*' -print` ; elif test "${ARCH}" = "x86_64" && which docker > /dev/null ; then docker run --rm -v `pwd`:/host:ro,z --entrypoint /bin/hadolint hadolint/hadolint:latest --config /host/.hadolint.yml `find * -type f -name 'Dockerfile*' | xargs -i echo '/host/{}'` ; fi
lint:
@which golangci-lint >/dev/null || echo "WARNING: go linter not installed. To install, run\n curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b \$$(go env GOPATH)/bin v1.42.1"
@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
test: unittest hadolint lint
GO111MODULE=on 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
docker: $(DOCKERS)
docker_core_metadata:
docker build \
--build-arg http_proxy \
--build-arg https_proxy \
-f cmd/core-metadata/Dockerfile \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/core-metadata:$(GIT_SHA) \
-t edgexfoundry/core-metadata:$(DOCKER_TAG) \
.
docker_core_data:
docker build \
--build-arg http_proxy \
--build-arg https_proxy \
-f cmd/core-data/Dockerfile \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/core-data:$(GIT_SHA) \
-t edgexfoundry/core-data:$(DOCKER_TAG) \
.
docker_core_command:
docker build \
--build-arg http_proxy \
--build-arg https_proxy \
-f cmd/core-command/Dockerfile \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/core-command:$(GIT_SHA) \
-t edgexfoundry/core-command:$(DOCKER_TAG) \
.
docker_support_notifications:
docker build \
--build-arg http_proxy \
--build-arg https_proxy \
-f cmd/support-notifications/Dockerfile \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/support-notifications:$(GIT_SHA) \
-t edgexfoundry/support-notifications:$(DOCKER_TAG) \
.
docker_support_scheduler:
docker build \
--build-arg http_proxy \
--build-arg https_proxy \
-f cmd/support-scheduler/Dockerfile \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/support-scheduler:$(GIT_SHA) \
-t edgexfoundry/support-scheduler:$(DOCKER_TAG) \
.
docker_sys_mgmt_agent:
docker build \
--build-arg http_proxy \
--build-arg https_proxy \
-f cmd/sys-mgmt-agent/Dockerfile \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/sys-mgmt-agent:$(GIT_SHA) \
-t edgexfoundry/sys-mgmt-agent:$(DOCKER_TAG) \
.
docker_security_proxy_setup:
docker build \
--build-arg http_proxy \
--build-arg https_proxy \
-f cmd/security-proxy-setup/Dockerfile \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/security-proxy-setup:$(GIT_SHA) \
-t edgexfoundry/security-proxy-setup:$(DOCKER_TAG) \
.
docker_security_secretstore_setup:
docker build \
--build-arg http_proxy \
--build-arg https_proxy \
-f cmd/security-secretstore-setup/Dockerfile \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/security-secretstore-setup:$(GIT_SHA) \
-t edgexfoundry/security-secretstore-setup:$(DOCKER_TAG) \
.
docker_security_bootstrapper:
docker build \
--build-arg http_proxy \
--build-arg https_proxy \
-f cmd/security-bootstrapper/Dockerfile \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/security-bootstrapper:$(GIT_SHA) \
-t edgexfoundry/security-bootstrapper:$(DOCKER_TAG) \
.
vendor:
$(GO) mod vendor
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jhhe66/Edgex-foundry.git
git@gitee.com:jhhe66/Edgex-foundry.git
jhhe66
Edgex-foundry
EdgeX Foundry
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385