fix(kestra): bake flows into kestra-init image to fix empty /flows in container
Some checks failed
Build and Push Docker Images / Build Frontend (Next.js) (push) Has been cancelled
Build and Push Docker Images / Build Integrator (push) Has been cancelled
Build and Push Docker Images / Build Kestra Init (push) Has been cancelled
Build and Push Docker Images / Trigger Portainer Update (push) Has been cancelled
Build and Push Docker Images / Build Backend (FastAPI) (push) Has been cancelled

Bind mounts don't work on the remote Portainer host since the files
aren't present there. Instead, Dockerfile.init copies the flow YAMLs
into a dedicated image (kestra/kestra:latest base) that is built in CI
and pulled by Portainer like the other images.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-24 12:40:43 +00:00
parent eda3444147
commit 6ce52d833c
3 changed files with 43 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ env:
BACKEND_IMAGE_NAME: ${{ gitea.repository }}-backend BACKEND_IMAGE_NAME: ${{ gitea.repository }}-backend
FRONTEND_IMAGE_NAME: ${{ gitea.repository }}-frontend FRONTEND_IMAGE_NAME: ${{ gitea.repository }}-frontend
INTEGRATOR_IMAGE_NAME: ${{ gitea.repository }}-integrator INTEGRATOR_IMAGE_NAME: ${{ gitea.repository }}-integrator
KESTRA_INIT_IMAGE_NAME: ${{ gitea.repository }}-kestra-init
jobs: jobs:
build-backend: build-backend:
@@ -135,10 +136,47 @@ jobs:
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.INTEGRATOR_IMAGE_NAME }}:buildcache cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.INTEGRATOR_IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.INTEGRATOR_IMAGE_NAME }}:buildcache,mode=max cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.INTEGRATOR_IMAGE_NAME }}:buildcache,mode=max
build-kestra-init:
name: Build Kestra Init
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Extract metadata for Kestra Init Docker image
id: meta-kestra-init
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.KESTRA_INIT_IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha,prefix=kestra-init-
type=raw,value=latest,enable=${{ gitea.ref == 'refs/heads/main' }}
- name: Build and push Kestra Init Docker image
uses: docker/build-push-action@v5
with:
context: ./integrator
file: ./integrator/Dockerfile.init
push: ${{ gitea.event_name != 'pull_request' }}
tags: ${{ steps.meta-kestra-init.outputs.tags }}
labels: ${{ steps.meta-kestra-init.outputs.labels }}
trigger-deployment: trigger-deployment:
name: Trigger Portainer Update name: Trigger Portainer Update
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build-backend, build-frontend, build-integrator] needs: [build-backend, build-frontend, build-integrator, build-kestra-init]
if: gitea.event_name != 'pull_request' if: gitea.event_name != 'pull_request'
steps: steps:
- name: Trigger Portainer stack update - name: Trigger Portainer stack update

View File

@@ -119,10 +119,8 @@ services:
# One-shot container: imports flow YAMLs into Kestra after it's healthy # One-shot container: imports flow YAMLs into Kestra after it's healthy
kestra-init: kestra-init:
image: kestra/kestra:latest image: privaterepo.sitaru.org/tudor/school_compare-kestra-init:latest
container_name: schoolcompare_kestra_init container_name: schoolcompare_kestra_init
volumes:
- ./integrator/flows:/flows:ro
environment: environment:
KESTRA_CONFIGURATION: | KESTRA_CONFIGURATION: |
datasources: datasources:

View File

@@ -0,0 +1,3 @@
FROM kestra/kestra:latest
COPY flows/ /flows/
CMD ["flow", "namespace", "update", "schoolcompare.data", "/flows", "--no-delete"]