@@ -34,23 +34,24 @@ DEPS := go.mod go.sum
3434# Docker variables
3535DOCKER_ENV := DOCKER_BUILDKIT=1
3636OCI_REGISTRY ?= 080137407410.dkr.ecr.us-west-2.amazonaws.com
37- OCI_REPOSITORY ?= edge-orch/infra
37+ OCI_REPOSITORY ?= edge-orch
38+ DOCKER_SECTION := infra
3839DOCKER_REGISTRY ?= $(OCI_REGISTRY )
3940DOCKER_REPOSITORY ?= $(OCI_REPOSITORY )
40- DOCKER_TAG := $(DOCKER_REGISTRY ) /$(DOCKER_REPOSITORY ) /$(DOCKER_IMG_NAME ) :$(VERSION )
41- DOCKER_TAG_BRANCH := $(DOCKER_REGISTRY ) /$(DOCKER_REPOSITORY ) /$(DOCKER_IMG_NAME ) :$(DOCKER_VERSION )
41+ DOCKER_TAG := $(DOCKER_REGISTRY ) /$(DOCKER_REPOSITORY ) /$(DOCKER_SECTION ) / $( DOCKER_IMG_NAME ) :$(VERSION )
42+ DOCKER_TAG_BRANCH := $(DOCKER_REGISTRY ) /$(DOCKER_REPOSITORY ) / $( DOCKER_SECTION ) /$(DOCKER_IMG_NAME ) :$(DOCKER_VERSION )
4243# Decides if we shall push image tagged with the branch name or not.
4344DOCKER_TAG_BRANCH_PUSH ?= true
4445LABEL_REPO_URL ?= $(shell git remote get-url $(shell git remote | head -n 1) )
4546LABEL_VERSION ?= $(VERSION )
4647LABEL_REVISION ?= $(GIT_COMMIT )
4748LABEL_BUILD_DATE ?= $(shell date -u "+% Y-% m-% dT% H:% M:% SZ")
4849
49- DB_CONTAINER_NAME := $(PROJECT_NAME ) -db
50+ DB_CONTAINER_NAME := $(PROJECT_NAME ) -db
5051
5152YAML_FILES := $(shell find . -type f \( -name '* .yaml' -o -name '* .yml' \) -print )
5253YAML_IGNORE ?= vendor, .github/workflows, $(VENV_NAME )
53- YAML_LINE_LENGHT ?= 99
54+ YAML_LINE_LENGTH ?= 99
5455
5556# Docker networking flags for the database container.
5657# The problem is as follows: On a local MacOS machine we want to expose the port
@@ -106,7 +107,7 @@ common-docker-build: ## Build Docker image
106107 $(GOCMD ) mod vendor
107108 cp ../common.mk ../version.mk .
108109 docker build . -f Dockerfile \
109- -t $(DOCKER_IMG_NAME ) :$(DOCKER_VERSION ) \
110+ -t $(DOCKER_IMG_NAME ) :$(VERSION ) \
110111 --build-arg http_proxy=" $( http_proxy) " --build-arg HTTP_PROXY=" $( HTTP_PROXY) " \
111112 --build-arg https_proxy=" $( https_proxy) " --build-arg HTTPS_PROXY=" $( HTTPS_PROXY) " \
112113 --build-arg no_proxy=" $( no_proxy) " --build-arg NO_PROXY=" $( NO_PROXY) " \
@@ -119,15 +120,19 @@ common-docker-build: ## Build Docker image
119120common-docker-push : # # Tag and push Docker image
120121 # TODO: remove ecr create
121122 aws ecr create-repository --region us-west-2 --repository-name $(DOCKER_REPOSITORY ) /$(DOCKER_IMG_NAME ) || true
122- docker tag $(DOCKER_IMG_NAME ) :$(DOCKER_VERSION ) $(DOCKER_TAG_BRANCH )
123- docker tag $(DOCKER_IMG_NAME ) :$(DOCKER_VERSION ) $(DOCKER_TAG )
123+ docker tag $(DOCKER_IMG_NAME ) :$(VERSION ) $(DOCKER_TAG_BRANCH )
124+ docker tag $(DOCKER_IMG_NAME ) :$(VERSION ) $(DOCKER_TAG )
124125 docker push $(DOCKER_TAG )
125126ifeq ($(DOCKER_TAG_BRANCH_PUSH ) , true)
126127 docker push $(DOCKER_TAG_BRANCH)
127128endif
128129
129130docker-list : # # Print name of docker container image
130- @echo $(DOCKER_TAG )
131+ @echo " $( DOCKER_IMG_NAME) :"
132+ @echo " name: '$( DOCKER_TAG) '"
133+ @echo " version: '$( VERSION) '"
134+ @echo " gitTagPrefix: '$( GIT_TAG_PREFIX) '"
135+ @echo " buildTarget: '$( PROJECT_NICKNAME) -docker-build'"
131136
132137# ### Python venv Target ####
133138
@@ -169,10 +174,12 @@ checksec: go-build ## Check various security properties that are available for e
169174 checksec --output=json --file=$(OUT_DIR ) /$(BINARY_NAME )
170175 checksec --fortify-file=$(OUT_DIR ) /$(BINARY_NAME )
171176
177+ YAML_FILES := $(shell find . -type f \( -name '* .yaml' -o -name '* .yml' \) -print )
178+ YAML_IGNORE ?= vendor, .github/workflows, $(VENV_NAME )
172179yamllint : $(VENV_NAME ) # # Lint YAML files
173180 . ./$< /bin/activate; set -u ; \
174181 yamllint --version ;\
175- yamllint -d '{extends : default, rules: {line-length: {max: $(YAML_LINE_LENGHT ) }}, ignore: [$(YAML_IGNORE ) ]}' -s $(YAML_FILES )
182+ yamllint -d '{extends : default, rules: {line-length: {max: $(YAML_LINE_LENGTH ) }}, ignore: [$(YAML_IGNORE ) ]}' -s $(YAML_FILES )
176183
177184mdlint : # # Link MD files
178185 markdownlint --version ; \
0 commit comments