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

34
.forgejo/workflows/ci.yml Normal file
View file

@ -0,0 +1,34 @@
on:
push:
branches:
- master
workflow_dispatch:
jobs:
buildx:
runs-on: docker
platforms: linux/amd64,linux/arm64
steps:
-
name: Checkout
uses: actions/checkout@v4
- name: Login to Registry
uses: docker/login-action@v3
with:
registry: ${{ vars.CONTAINER_REGISTRY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ vars.CONTAINER_REGISTRY }}/${{ github.repository }}:latest

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
build/
*.d
debian/changelog

11
Dockerfile Normal file
View file

@ -0,0 +1,11 @@
FROM debian:bookworm-slim
WORKDIR /work
ADD . /work
RUN apt-get update && apt-get -y install build-essential debhelper
RUN make debian-package
FROM debian:bookworm-slim
COPY --from=0 tellusagent_*.deb /
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get install -y ./tellusagent_*.deb && rm ./tellusagent_*.deb
ENTRYPOINT ["/opt/TellusAgent/tellusagent"]

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

2
debian/compat vendored
View file

@ -1 +1 @@
7
9