Skip to content

Commit

Permalink
gen-manifests: use the workflow folder name, not the workflow_id
Browse files Browse the repository at this point in the history
Use an argument to represent the workflow folder, and use it where
expected, for example to generate the container image name and so on.

This is now separate from the workflow_id we extract form the yaml
spec to operate on the manifest files (stuff like yq replacement we
perform)

Signed-off-by: Roy Golan <[email protected]>
  • Loading branch information
rgolangh committed Jul 15, 2024
1 parent ed22ee0 commit 9d6fe98
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/gen_manifests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

WORKFLOW_ID=$1
WORKFLOW_FOLDER=$1

if [ ! -f kn ]; then
echo "Installing kn-workflow CLI"
Expand All @@ -10,7 +10,7 @@ else
echo "kn cli already available"
fi

cd "${WORKFLOW_ID}" || exit
cd "${WORKFLOW_FOLDER}" || exit

echo -e "\nquarkus.flyway.migrate-at-start=true" >> application.properties

Expand Down Expand Up @@ -40,7 +40,7 @@ fi
SONATAFLOW_CR=manifests/01-sonataflow_${workflow_id}.yaml
yq --inplace eval '.metadata.annotations["sonataflow.org/profile"] = "prod"' "${SONATAFLOW_CR}"

yq --inplace ".spec.podTemplate.container.image=\"quay.io/orchestrator/serverless-workflow-${workflow_id}:latest\"" "${SONATAFLOW_CR}"
yq --inplace ".spec.podTemplate.container.image=\"quay.io/orchestrator/serverless-workflow-${WORKFLOW_FOLDER}:latest\"" "${SONATAFLOW_CR}"

if [ "${ENABLE_PERSISTENCE}" = true ]; then
yq --inplace ".spec |= (
Expand All @@ -56,7 +56,7 @@ if [ "${ENABLE_PERSISTENCE}" = true ]; then
\"name\": \"sonataflow-psql-postgresql\",
\"port\": 5432,
\"databaseName\": \"sonataflow\",
\"databaseSchema\": \"${WORKFLOW_ID}\"
\"databaseSchema\": \"${WORKFLOW_FOLDER}\"
}
}
}
Expand Down

0 comments on commit 9d6fe98

Please sign in to comment.