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
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:
@@ -13,6 +13,7 @@ env:
|
||||
BACKEND_IMAGE_NAME: ${{ gitea.repository }}-backend
|
||||
FRONTEND_IMAGE_NAME: ${{ gitea.repository }}-frontend
|
||||
INTEGRATOR_IMAGE_NAME: ${{ gitea.repository }}-integrator
|
||||
KESTRA_INIT_IMAGE_NAME: ${{ gitea.repository }}-kestra-init
|
||||
|
||||
jobs:
|
||||
build-backend:
|
||||
@@ -135,10 +136,47 @@ jobs:
|
||||
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
|
||||
|
||||
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:
|
||||
name: Trigger Portainer Update
|
||||
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'
|
||||
steps:
|
||||
- name: Trigger Portainer stack update
|
||||
|
||||
@@ -119,10 +119,8 @@ services:
|
||||
|
||||
# One-shot container: imports flow YAMLs into Kestra after it's healthy
|
||||
kestra-init:
|
||||
image: kestra/kestra:latest
|
||||
image: privaterepo.sitaru.org/tudor/school_compare-kestra-init:latest
|
||||
container_name: schoolcompare_kestra_init
|
||||
volumes:
|
||||
- ./integrator/flows:/flows:ro
|
||||
environment:
|
||||
KESTRA_CONFIGURATION: |
|
||||
datasources:
|
||||
|
||||
3
integrator/Dockerfile.init
Normal file
3
integrator/Dockerfile.init
Normal file
@@ -0,0 +1,3 @@
|
||||
FROM kestra/kestra:latest
|
||||
COPY flows/ /flows/
|
||||
CMD ["flow", "namespace", "update", "schoolcompare.data", "/flows", "--no-delete"]
|
||||
Reference in New Issue
Block a user