Skip to content
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ docker-push: ## push all docker containers
for dir in $(DOCKER_PROJECTS); do $(MAKE) -C $$dir $@; done

docker-list: ## list all docker containers
@echo "images:"
@for dir in $(DOCKER_PROJECTS); do $(MAKE) -C $$dir $@; done

test: ## test in all subprojects
Expand All @@ -68,7 +69,7 @@ bit-%: ## Run bulk-import-tools subproject's tasks, e.g. bit-test
$(MAKE) -C bulk-import-tools $*

einv-%: ## Run exporters-inventory subproject's tasks, e.g. einv-test
$(MAKE) -C exporter-inventory $*
$(MAKE) -C exporters-inventory $*

inv-%: ## Run inventory subproject's tasks, e.g. inv-test
$(MAKE) -C inventory $*
Expand Down
2 changes: 2 additions & 0 deletions api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ SWAGGERCLI := true

# Project variables
PROJECT_NAME := api
PROJECT_NICKNAME := api
BINARY_NAME := $(PROJECT_NAME)

# Code versions, tags, and so on
Expand All @@ -31,6 +32,7 @@ VERSION_MAJOR := 0
DOCKER_IMG_NAME := $(PROJECT_NAME)
DOCKER_VERSION ?= $(shell git branch --show-current | sed 's/\//_/g')
GIT_COMMIT ?= $(shell git rev-parse HEAD)
GIT_TAG_PREFIX := $(PROJECT_NAME)/v

# Test variables
# Set TEST_TARGET to '<testname1>' or '<testname1\|testname2>' to run specific tests or use other regex '<testname.*>' - example:
Expand Down
2 changes: 1 addition & 1 deletion api/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.33.0
1.33.1-dev
6 changes: 4 additions & 2 deletions bulk-import-tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ PROTOCGENDOC := true

# Project variables
PROJECT_NAME := bulk-import-tools
PROJECT_NICKNAME := bit
BULK_IMPORT_BINARY_NAME := orch-host-bulk-import
PREFLIGHT_BINARY_NAME := orch-host-preflight

# Versioning variables
VERSION := $(shell cat VERSION)
GIT_COMMIT ?= $(shell git rev-parse --short HEAD)
VERSION := $(shell cat VERSION)
GIT_COMMIT ?= $(shell git rev-parse --short HEAD)
GIT_TAG_PREFIX := $(PROJECT_NAME)/v

# Test variables
# Set TEST_TARGET to '<testname1>' or '<testname1\|testname2>' to run specific tests or use regex '<testname.*>' - example:
Expand Down
27 changes: 17 additions & 10 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,24 @@ DEPS := go.mod go.sum
# Docker variables
DOCKER_ENV := DOCKER_BUILDKIT=1
OCI_REGISTRY ?= 080137407410.dkr.ecr.us-west-2.amazonaws.com
OCI_REPOSITORY ?= edge-orch/infra
OCI_REPOSITORY ?= edge-orch
DOCKER_SECTION := infra
DOCKER_REGISTRY ?= $(OCI_REGISTRY)
DOCKER_REPOSITORY ?= $(OCI_REPOSITORY)
DOCKER_TAG := $(DOCKER_REGISTRY)/$(DOCKER_REPOSITORY)/$(DOCKER_IMG_NAME):$(VERSION)
DOCKER_TAG_BRANCH := $(DOCKER_REGISTRY)/$(DOCKER_REPOSITORY)/$(DOCKER_IMG_NAME):$(DOCKER_VERSION)
DOCKER_TAG := $(DOCKER_REGISTRY)/$(DOCKER_REPOSITORY)/$(DOCKER_SECTION)/$(DOCKER_IMG_NAME):$(VERSION)
DOCKER_TAG_BRANCH := $(DOCKER_REGISTRY)/$(DOCKER_REPOSITORY)/$(DOCKER_SECTION)/$(DOCKER_IMG_NAME):$(DOCKER_VERSION)
# Decides if we shall push image tagged with the branch name or not.
DOCKER_TAG_BRANCH_PUSH ?= true
LABEL_REPO_URL ?= $(shell git remote get-url $(shell git remote | head -n 1))
LABEL_VERSION ?= $(VERSION)
LABEL_REVISION ?= $(GIT_COMMIT)
LABEL_BUILD_DATE ?= $(shell date -u "+%Y-%m-%dT%H:%M:%SZ")

DB_CONTAINER_NAME := $(PROJECT_NAME)-db
DB_CONTAINER_NAME := $(PROJECT_NAME)-db

YAML_FILES := $(shell find . -type f \( -name '*.yaml' -o -name '*.yml' \) -print )
YAML_IGNORE ?= vendor, .github/workflows, $(VENV_NAME)
YAML_LINE_LENGHT ?= 99
YAML_LINE_LENGTH ?= 99

# Docker networking flags for the database container.
# The problem is as follows: On a local MacOS machine we want to expose the port
Expand Down Expand Up @@ -106,7 +107,7 @@ common-docker-build: ## Build Docker image
$(GOCMD) mod vendor
cp ../common.mk ../version.mk .
docker build . -f Dockerfile \
-t $(DOCKER_IMG_NAME):$(DOCKER_VERSION) \
-t $(DOCKER_IMG_NAME):$(VERSION) \
--build-arg http_proxy="$(http_proxy)" --build-arg HTTP_PROXY="$(HTTP_PROXY)" \
--build-arg https_proxy="$(https_proxy)" --build-arg HTTPS_PROXY="$(HTTPS_PROXY)" \
--build-arg no_proxy="$(no_proxy)" --build-arg NO_PROXY="$(NO_PROXY)" \
Expand All @@ -119,15 +120,19 @@ common-docker-build: ## Build Docker image
common-docker-push: ## Tag and push Docker image
# TODO: remove ecr create
aws ecr create-repository --region us-west-2 --repository-name $(DOCKER_REPOSITORY)/$(DOCKER_IMG_NAME) || true
docker tag $(DOCKER_IMG_NAME):$(DOCKER_VERSION) $(DOCKER_TAG_BRANCH)
docker tag $(DOCKER_IMG_NAME):$(DOCKER_VERSION) $(DOCKER_TAG)
docker tag $(DOCKER_IMG_NAME):$(VERSION) $(DOCKER_TAG_BRANCH)
docker tag $(DOCKER_IMG_NAME):$(VERSION) $(DOCKER_TAG)
docker push $(DOCKER_TAG)
ifeq ($(DOCKER_TAG_BRANCH_PUSH), true)
docker push $(DOCKER_TAG_BRANCH)
endif

docker-list: ## Print name of docker container image
@echo $(DOCKER_TAG)
@echo " $(DOCKER_IMG_NAME):"
@echo " name: '$(DOCKER_TAG)'"
@echo " version: '$(VERSION)'"
@echo " gitTagPrefix: '$(GIT_TAG_PREFIX)'"
@echo " buildTarget: '$(PROJECT_NICKNAME)-docker-build'"

#### Python venv Target ####

Expand Down Expand Up @@ -169,10 +174,12 @@ checksec: go-build ## Check various security properties that are available for e
checksec --output=json --file=$(OUT_DIR)/$(BINARY_NAME)
checksec --fortify-file=$(OUT_DIR)/$(BINARY_NAME)

YAML_FILES := $(shell find . -type f \( -name '*.yaml' -o -name '*.yml' \) -print )
YAML_IGNORE ?= vendor, .github/workflows, $(VENV_NAME)
yamllint: $(VENV_NAME) ## Lint YAML files
. ./$</bin/activate; set -u ;\
yamllint --version ;\
yamllint -d '{extends: default, rules: {line-length: {max: $(YAML_LINE_LENGHT)}}, ignore: [$(YAML_IGNORE)]}' -s $(YAML_FILES)
yamllint -d '{extends: default, rules: {line-length: {max: $(YAML_LINE_LENGTH)}}, ignore: [$(YAML_IGNORE)]}' -s $(YAML_FILES)

mdlint: ## Link MD files
markdownlint --version ;\
Expand Down
2 changes: 2 additions & 0 deletions exporters-inventory/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ GOCOBERTURA := true

# Project variables
PROJECT_NAME := exporter
PROJECT_NICKNAME := einv
BINARY_NAME := $(PROJECT_NAME)

# Code versions, tags, and so on
Expand All @@ -26,6 +27,7 @@ VERSION_MAJOR := $(shell cut -c 1 VERSION)
DOCKER_IMG_NAME := $(PROJECT_NAME)
DOCKER_VERSION ?= $(shell git branch --show-current | sed 's/\//_/g')
GIT_COMMIT ?= $(shell git rev-parse HEAD)
GIT_TAG_PREFIX := exporters-inventory/v

# Test variables
# Set TEST_TARGET to '<testname1>' or '<testname1\|testname2>' to run specific tests or use regex '<testname.*>' - example:
Expand Down
2 changes: 1 addition & 1 deletion exporters-inventory/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.18.1
1.18.2-dev
2 changes: 2 additions & 0 deletions inventory/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ PROTOCGENGOGRPC := true

# Project variables
PROJECT_NAME := inventory
PROJECT_NICKNAME := inv
BINARY_NAME := $(PROJECT_NAME)

# Code versions, tags, and so on
Expand All @@ -35,6 +36,7 @@ VERSION_MAJOR := $(shell cut -c 1 VERSION)
DOCKER_IMG_NAME := $(PROJECT_NAME)
DOCKER_VERSION ?= $(shell git branch --show-current | sed 's/\//_/g')
GIT_COMMIT ?= $(shell git rev-parse HEAD)
GIT_TAG_PREFIX := $(PROJECT_NAME)/v

# Test variables
# Set TEST_TARGET to '<testname1>' or '<testname1\|testname2>' to run specific tests or use other regex '<testname.*>' - example:
Expand Down
2 changes: 1 addition & 1 deletion inventory/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.23.1
2.23.2-dev
2 changes: 1 addition & 1 deletion os-profiles/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ALL_PROFILES := $(shell find *.yaml)
include ../common.mk

# Lint variables
YAML_LINE_LENGHT := 150
YAML_LINE_LENGTH := 150

OCI_REPOSITORY := edge-orch/en/files/os-profile

Expand Down
2 changes: 1 addition & 1 deletion os-profiles/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.6
0.2.7-dev
6 changes: 4 additions & 2 deletions os-profiles/template/profile-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ spec:
# human-readable name of OS profile
name:
# OS_TYPE_IMMUTABLE or OS_TYPE_MUTABLE,
# should match values in https://github.com/open-edge-platform/infra-core/blob/main/inventory/api/os/v1/os.proto#L25-L29
# should match values in
# https://github.com/open-edge-platform/infra-core/blob/main/inventory/api/os/v1/os.proto#L25-L29
type:
# must be unique across all files under manifest/en-profile
profileName:
Expand All @@ -20,7 +21,8 @@ spec:
# SHA256 checksum for integrity check
osImageSha256:
# security settings for OS profile,
# should match values in https://github.com/open-edge-platform/infra-core/blob/main/inventory/api/os/v1/os.proto#L18-L22
# should match values in
# https://github.com/open-edge-platform/infra-core/blob/main/inventory/api/os/v1/os.proto#L18-L22
securityFeature:
platformBundle:
installerScript: # URL of the installer script part of the platform bundle
Expand Down
3 changes: 2 additions & 1 deletion os-profiles/ubuntu-22.04-lts-generic-ext.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ spec:
provider: OS_PROVIDER_KIND_INFRA
architecture: x86_64
profileName: ubuntu-22.04-lts-generic-ext
osImageUrl: https://cloud-images.ubuntu.com/releases/22.04/release-20250228/ubuntu-22.04-server-cloudimg-amd64.img
osImageUrl: >-
https://cloud-images.ubuntu.com/releases/22.04/release-20250228/ubuntu-22.04-server-cloudimg-amd64.img
osImageVersion: 22.04.5
osImageSha256: b9b65a7e045ca262ad614cbedeaa1bf34b9325d76f856e85e17b68984e7a4314
osPackageManifestURL: ""
Expand Down
3 changes: 2 additions & 1 deletion os-profiles/ubuntu-22.04-lts-generic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ spec:
provider: OS_PROVIDER_KIND_INFRA
architecture: x86_64
profileName: ubuntu-22.04-lts-generic
osImageUrl: https://cloud-images.ubuntu.com/releases/22.04/release-20250228/ubuntu-22.04-server-cloudimg-amd64.img
osImageUrl: >-
https://cloud-images.ubuntu.com/releases/22.04/release-20250228/ubuntu-22.04-server-cloudimg-amd64.img
osImageVersion: 22.04.5
osImageSha256: b9b65a7e045ca262ad614cbedeaa1bf34b9325d76f856e85e17b68984e7a4314
osPackageManifestURL: ""
Expand Down
8 changes: 5 additions & 3 deletions tenant-controller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ OPA := true
PROTOCGENENT := true

# Project variables
PROJECT_NAME := tenant-controller
BINARY_NAME := $(PROJECT_NAME)
PROJECT_NAME := tenant-controller
PROJECT_NICKNAME := tc
BINARY_NAME := $(PROJECT_NAME)

# Versioning variables
VERSION := $(shell cat VERSION)
VERSION_MAJOR := $(shell cut -c 1 VERSION)
DOCKER_IMG_NAME := $(PROJECT_NAME)
DOCKER_VERSION ?= $(shell git branch --show-current | sed 's/\//_/g')
GIT_COMMIT ?= $(shell git rev-parse HEAD)
GIT_TAG_PREFIX := $(PROJECT_NAME)/v

# Test variables
# Set TEST_TARGET to '<testname1>' or '<testname1\|testname2>' to run specific tests or use regex '<testname.*>' - example:
Expand Down Expand Up @@ -66,7 +68,7 @@ buf-lint: common-buf-lint ## Lint and format protobuf files
#### Development Targets ####

build: go-build ## Build local binaries

lint: $(OUT_DIR) license yamllint hadolint go-lint mdlint ## Run all lint tools

test: $(OUT_DIR) go-test ## Run all unit tests
Expand Down
Loading