From b1b6ac80aadd00a9d659093856afd194d7e2b50c Mon Sep 17 00:00:00 2001 From: Luc Weinbrecht Date: Fri, 21 Jun 2024 10:06:35 +0200 Subject: [PATCH] deploying model via zeebe worker --- .../FibonacciWorkerApplication.kt | 2 + .../resources/bpmn}/Fibonacciprocess.bpmn | 0 tf/camunda.tf | 65 ------------------- 3 files changed, 2 insertions(+), 65 deletions(-) rename src/{fibonacci-process => fibonacci-worker/src/main/resources/bpmn}/Fibonacciprocess.bpmn (100%) diff --git a/src/fibonacci-worker/src/main/kotlin/de/envite/greenbpm/camunda_process_carbon_pricing/fibonacci_worker/FibonacciWorkerApplication.kt b/src/fibonacci-worker/src/main/kotlin/de/envite/greenbpm/camunda_process_carbon_pricing/fibonacci_worker/FibonacciWorkerApplication.kt index 9093310..fe6eaee 100644 --- a/src/fibonacci-worker/src/main/kotlin/de/envite/greenbpm/camunda_process_carbon_pricing/fibonacci_worker/FibonacciWorkerApplication.kt +++ b/src/fibonacci-worker/src/main/kotlin/de/envite/greenbpm/camunda_process_carbon_pricing/fibonacci_worker/FibonacciWorkerApplication.kt @@ -1,9 +1,11 @@ package de.envite.greenbpm.camunda_process_carbon_pricing.fibonacci_worker +import io.camunda.zeebe.spring.client.annotation.Deployment import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication @SpringBootApplication +@Deployment(resources = ["classpath*:/bpmn/**/*.bpmn"]) class FibonacciWorkerApplication fun main(args: Array) { diff --git a/src/fibonacci-process/Fibonacciprocess.bpmn b/src/fibonacci-worker/src/main/resources/bpmn/Fibonacciprocess.bpmn similarity index 100% rename from src/fibonacci-process/Fibonacciprocess.bpmn rename to src/fibonacci-worker/src/main/resources/bpmn/Fibonacciprocess.bpmn diff --git a/tf/camunda.tf b/tf/camunda.tf index 4b30ff3..189e3d5 100644 --- a/tf/camunda.tf +++ b/tf/camunda.tf @@ -26,70 +26,6 @@ data "http" "latest_camunda_values" { } } -// deploy configmap with process via zbctl -resource "kubernetes_job_v1" "bpmnmodeldeployment" { - depends_on = [ kubernetes_config_map_v1.bpmnmodel, helm_release.camunda-platform ] - metadata { - name = "bpmndeployment" - namespace = "camunda" - } - spec { - template { - metadata {} - spec { - container { - name = "bpmndeployment" - image = "sitapati/zbctl:8.2.10" - - - env { - name = "ZEEBE_ADDRESS" - value = "camunda-platform-zeebe-gateway:26500" - } - - command = ["/zbctl"] - args = [ "deploy", "resource", "/process/Fibonacciprocess.bpmn" , "--insecure"] - - // for future testing purposes I'll leave this here: - //image = "alpine:3.14" - //command = ["bin/cat"] - //args = [ "/process/example_process.bpmn" ] - - volume_mount { - name = "bpmnmodelvolume" - mount_path = "/process" - } - } - - restart_policy = "Never" - - volume { - name = "bpmnmodelvolume" - config_map { - name = "bpmnmodeldata" - } - } - } - } - backoff_limit = 1 - } - wait_for_completion = true -} - -// create configmap to hold process file -resource "kubernetes_config_map_v1" "bpmnmodel" { - depends_on = [ helm_release.camunda-platform ] - metadata { - name = "bpmnmodeldata" - namespace = "camunda" - } - - data = { - "Fibonacciprocess.bpmn" = file("${abspath(path.module)}/../src/fibonacci-process/Fibonacciprocess.bpmn") - } - -} - /* resource "helm_release" "console-worker" { @@ -103,7 +39,6 @@ resource "helm_release" "console-worker" { resource "kubernetes_job_v1" "processstart" { count = var.create_module ? 1 : 0 - depends_on = [ kubernetes_job_v1.bpmnmodeldeployment ] metadata { name = "processstart" namespace = var.namespace