CI
All checks were successful
/ buildx (push) Successful in 7m37s

This commit is contained in:
Stefan Saraev 2025-03-23 14:30:28 +02:00
parent 4e0426fb51
commit 55dc434919
5 changed files with 55 additions and 23 deletions

View file

@ -2,11 +2,6 @@ BUILD := $(shell date -u +%Y%m%d-%H%M%S)
OS := $(shell uname -s)
PREFIX = $(DESTDIR)/opt/TellusAgent
TOOLKIT = ../..
DIRECTORIES = \
$(TOOLKIT)/Common \
$(TOOLKIT)/Rewind
ifeq ($(CI_PIPELINE_CREATED_AT), )
VERSION := $(shell date -u +%Y%m%d-%H%M%S)
@ -15,15 +10,10 @@ else
endif
ifeq ($(OS), Linux)
BUILD := $(VERSION)-$(shell lsb_release -i -s | tr '[:upper:]' '[:lower:]')$(shell lsb_release -r -s)
ARCHITECTURE ?= $(shell $(CC) -dumpmachine | grep -o -E '^[^-]+')
ifeq ($(ARCHITECTURE), aarch64)
FLAGS += -march=armv8-a
endif
ifeq ($(ARCHITECTURE), x86_64)
FLAGS += -fPIC
endif
FLAGS += -rdynamic
endif
ifeq ($(OS), Darwin)
@ -35,11 +25,11 @@ OBJECTS = \
FLAGS += -g -fno-omit-frame-pointer -O3 -MMD \
-DVERSION=\"$(VERSION)\" \
$(foreach directory, $(DIRECTORIES), -I$(directory)) -DBUILD=\"$(BUILD)\"
$(foreach directory, $(DIRECTORIES), -I$(directory)) -DBUILD=\"$(VERSION)\"
LIBS += $(foreach library, $(LIBRARIES), -l$(library))
CC = gcc
CC ?= gcc
CFLAGS += $(FLAGS) -std=gnu99
ifneq ($(strip $(DEPENDENCIES)),)
@ -70,19 +60,13 @@ endif
clean:
rm -f $(PREREQUISITES) $(OBJECTS) tellusagent
rm -f *.d $(TOOLKIT)/*/*.d
debian-package:
./UpdateLog.sh tellusagent "Artem Prilutskiy <cyanide.burnout@gmail.com>" $(BUILD) > debian/changelog
ifdef ARCH
dpkg-buildpackage -b -a$(ARCH) -tc
else
dpkg-buildpackage -b -tc
endif
./UpdateLog.sh tellusagent "Artem Prilutskiy <cyanide.burnout@gmail.com>" $(VERSION) > debian/changelog
dpkg-buildpackage --post-clean --no-sign -i -I -b
docker-image: debian-package
DISTRIBUTION=$(shell echo ${ARCHITECTURE} | sed s/aarch64/arm64/ | sed s/x86_64/amd64/)
docker buildx build -t tellusagent:$(VERSION) --platform linux/$(DISTRIBUTION) -o type=tar,dest=- . | gzip > build/tellusagent_$(VERSION)-$(DISTRIBUTION).tar.gz
docker-image:
docker buildx build -t tellusagent:$(VERSION) -o type=tar,dest=tellusagent-docker.tar .
macos-archive: build
zip ../TellusAgent-macOS.zip tellusagent tellusagent.sh tellusagent.conf tellusagent.plist