[#54] Build and host OCI images on our own infra
All checks were successful
/ OCI image (pull_request) Successful in 1m31s
All checks were successful
/ OCI image (pull_request) Successful in 1m31s
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:
parent
cac77b7c5e
commit
a2748b35cc
3 changed files with 35 additions and 2 deletions
2
.env
2
.env
|
@ -1,5 +1,5 @@
|
||||||
FROSTFS_HUB_IMAGE=truecloudlab/frostfs
|
FROSTFS_HUB_IMAGE=truecloudlab/frostfs
|
||||||
AIO_IMAGE=truecloudlab/frostfs-aio
|
AIO_IMAGE=git.frostfs.info/truecloudlab/frostfs-aio
|
||||||
AIO_VERSION=1.6.5
|
AIO_VERSION=1.6.5
|
||||||
|
|
||||||
FROSTFS_CORE_TAG=0.42.15
|
FROSTFS_CORE_TAG=0.42.15
|
||||||
|
|
27
.forgejo/workflows/oci-image.yml
Normal file
27
.forgejo/workflows/oci-image.yml
Normal 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}}
|
8
Makefile
8
Makefile
|
@ -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//')"
|
VERSION ?= "$(shell git describe --tags --match "v*" 2>/dev/null || git rev-parse --short HEAD | sed 's/^v//')"
|
||||||
|
|
||||||
# Variables for docker
|
# Variables for docker
|
||||||
AIO_IMAGE ?= "truecloudlab/frostfs-aio"
|
AIO_IMAGE ?= "git.frostfs.info/truecloudlab/frostfs-aio"
|
||||||
LOG_DIR ?= "/var/log"
|
LOG_DIR ?= "/var/log"
|
||||||
|
|
||||||
# Variables for compose
|
# Variables for compose
|
||||||
|
@ -61,6 +61,12 @@ image-aio-custom:
|
||||||
--build-arg NEOGO_TAG=$(NEOGO_TAG) \
|
--build-arg NEOGO_TAG=$(NEOGO_TAG) \
|
||||||
-t $(AIO_IMAGE):$(AIO_VERSION) .
|
-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
|
# Start AIO
|
||||||
up:
|
up:
|
||||||
@$(COMPOSE_CMD_UP)
|
@$(COMPOSE_CMD_UP)
|
||||||
|
|
Loading…
Reference in a new issue