- Updated acb-eventsensor.yml to ensure acb-build trigger is present - Push will trigger webhook → acb-build → builds all ACB images including enrichment - Workflow will update declarative-config with real image SHA
160 lines
4.7 KiB
YAML
160 lines
4.7 KiB
YAML
# Argo Events resources for AI Code Battle CI triggers
|
|
# Deployed to: declarative-config/k8s/iad-ci/argo-events/
|
|
#
|
|
# Components:
|
|
# 1. forgejo-eventsource.yml — Forgejo generic webhook listener for push events
|
|
# 2. ai-code-battle-sensor.yml — routes push events to the appropriate WorkflowTemplates
|
|
#
|
|
# The sensor triggers on every push to master:
|
|
# - acb-images-build: builds all Go service images (matchmaker, worker, evolver, etc.)
|
|
# - acb-site-build: builds web SPA and wraps as container image artifact
|
|
# - acb-bots-build: builds all 6 strategy bot images, pushes to Docker Hub,
|
|
# updates declarative-config deployment tags
|
|
#
|
|
# Webhook to register in Forgejo (jedarden/ai-code-battle):
|
|
# Settings → Webhooks → Add Webhook → Gitea
|
|
# URL: https://webhooks-ci.ardenone.com/ai-code-battle
|
|
# Content type: application/json
|
|
# Trigger: Push events
|
|
#
|
|
---
|
|
# EventSource (deployed as forgejo-eventsource.yml in declarative-config)
|
|
apiVersion: argoproj.io/v1alpha1
|
|
kind: EventSource
|
|
metadata:
|
|
name: forgejo-webhooks
|
|
namespace: argo-events
|
|
spec:
|
|
eventBusName: default
|
|
webhook:
|
|
ai-code-battle:
|
|
port: "12000"
|
|
endpoint: /ai-code-battle
|
|
method: POST
|
|
service:
|
|
ports:
|
|
- port: 12000
|
|
targetPort: 12000
|
|
---
|
|
# Sensor (deployed as ai-code-battle-sensor.yml in declarative-config)
|
|
apiVersion: argoproj.io/v1alpha1
|
|
kind: Sensor
|
|
metadata:
|
|
name: ai-code-battle-ci-sensor
|
|
namespace: argo-events
|
|
spec:
|
|
eventBusName: default
|
|
dependencies:
|
|
- name: acb-push
|
|
eventSourceName: forgejo-webhooks
|
|
eventName: ai-code-battle
|
|
filters:
|
|
data:
|
|
- path: headers.X-Forgejo-Event
|
|
type: string
|
|
value:
|
|
- push
|
|
- path: body.ref
|
|
type: string
|
|
value:
|
|
- refs/heads/master
|
|
triggers:
|
|
- template:
|
|
name: acb-images-trigger
|
|
argoWorkflow:
|
|
operation: submit
|
|
source:
|
|
resource:
|
|
apiVersion: argoproj.io/v1alpha1
|
|
kind: Workflow
|
|
metadata:
|
|
generateName: acb-images-build-
|
|
namespace: argo-workflows
|
|
spec:
|
|
workflowTemplateRef:
|
|
name: acb-images-build
|
|
arguments:
|
|
parameters:
|
|
- name: commit-sha
|
|
value: ""
|
|
parameters:
|
|
- src:
|
|
dependencyName: acb-push
|
|
dataKey: body.after
|
|
dest: spec.arguments.parameters.0.value
|
|
conditions: acb-push
|
|
|
|
- template:
|
|
name: acb-site-trigger
|
|
argoWorkflow:
|
|
operation: submit
|
|
source:
|
|
resource:
|
|
apiVersion: argoproj.io/v1alpha1
|
|
kind: Workflow
|
|
metadata:
|
|
generateName: acb-site-build-
|
|
namespace: argo-workflows
|
|
spec:
|
|
workflowTemplateRef:
|
|
name: acb-site-build
|
|
arguments:
|
|
parameters:
|
|
- name: commit-sha
|
|
value: ""
|
|
parameters:
|
|
- src:
|
|
dependencyName: acb-push
|
|
dataKey: body.after
|
|
dest: spec.arguments.parameters.0.value
|
|
conditions: acb-push
|
|
|
|
- template:
|
|
name: acb-bots-trigger
|
|
argoWorkflow:
|
|
operation: submit
|
|
source:
|
|
resource:
|
|
apiVersion: argoproj.io/v1alpha1
|
|
kind: Workflow
|
|
metadata:
|
|
generateName: acb-bots-build-
|
|
namespace: argo-workflows
|
|
spec:
|
|
workflowTemplateRef:
|
|
name: acb-bots-build
|
|
arguments:
|
|
parameters:
|
|
- name: commit-sha
|
|
value: ""
|
|
parameters:
|
|
- src:
|
|
dependencyName: acb-push
|
|
dataKey: body.after
|
|
dest: spec.arguments.parameters.0.value
|
|
conditions: acb-push
|
|
|
|
- template:
|
|
name: acb-trigger
|
|
argoWorkflow:
|
|
operation: submit
|
|
source:
|
|
resource:
|
|
apiVersion: argoproj.io/v1alpha1
|
|
kind: Workflow
|
|
metadata:
|
|
generateName: acb-build-
|
|
namespace: argo-workflows
|
|
spec:
|
|
workflowTemplateRef:
|
|
name: acb-build
|
|
arguments:
|
|
parameters:
|
|
- name: commit-sha
|
|
value: ""
|
|
parameters:
|
|
- src:
|
|
dependencyName: acb-push
|
|
dataKey: body.after
|
|
dest: spec.arguments.parameters.0.value
|
|
conditions: acb-push
|