[#54] Build and host OCI images on our own infra

Similar to TrueCloudLab/frostfs-s3-gw#587
this PR introduces a CI pipeline that builds Docker images and pushes them
to our selfhosted registry.

Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
This commit is contained in:
Vitaliy Potyarkin 2025-01-09 11:11:03 +03:00
parent cac77b7c5e
commit dab7824b21
3 changed files with 35 additions and 2 deletions

2
.env
View file

@ -1,5 +1,5 @@
FROSTFS_HUB_IMAGE=truecloudlab/frostfs
AIO_IMAGE=truecloudlab/frostfs-aio
AIO_IMAGE=git.frostfs.info/truecloudlab/frostfs-aio
AIO_VERSION=1.6.5
FROSTFS_CORE_TAG=0.42.15

View file

@ -0,0 +1,27 @@
on:
pull_request:
push:
workflow_dispatch:
jobs:
image:
name: OCI image
runs-on: docker
container: git.frostfs.info/truecloudlab/env:oci-image-builder-bookworm
steps:
- name: Clone git repo
uses: actions/checkout@v3
- name: Build OCI image
run: make image-aio
- name: Push image to OCI registry
run: |
echo "$REGISTRY_PASSWORD" \
| docker login --username truecloudlab --password-stdin git.frostfs.info
make image-push
if: >-
startsWith(github.ref, 'refs/tags/v') &&
(github.event_name == 'workflow_dispatch' || github.event_name == 'push')
env:
REGISTRY_PASSWORD: ${{secrets.FORGEJO_OCI_REGISTRY_PUSH_TOKEN}}

View file

@ -8,7 +8,7 @@ REPO=$(notdir $(shell pwd))
VERSION ?= "$(shell git describe --tags --match "v*" 2>/dev/null || git rev-parse --short HEAD | sed 's/^v//')"
# Variables for docker
AIO_IMAGE ?= "truecloudlab/frostfs-aio"
AIO_IMAGE ?= "git.frostfs.info/truecloudlab/frostfs-aio"
LOG_DIR ?= "/var/log"
# Variables for compose
@ -61,6 +61,12 @@ image-aio-custom:
--build-arg NEOGO_TAG=$(NEOGO_TAG) \
-t $(AIO_IMAGE):$(AIO_VERSION) .
# Push aio Docker image to the registry
.PHONY: image-push
image-push:
@echo "⇒ Publish image"
@docker push $(AIO_IMAGE):$(AIO_VERSION)
# Start AIO
up:
@$(COMPOSE_CMD_UP)