Skip to content

Commit

Permalink
Fix makefile build (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
masayag authored Jun 23, 2024
1 parent ee4a4a1 commit 62fc922
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
4 changes: 4 additions & 0 deletions greeting/argfile.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
BUILDER_IMAGE=brew.registry.redhat.io/rh-osbs/openshift-serverless-1-logic-swf-builder-rhel8@sha256:012439f21f964478225a459042f6e1dc14f63fdf4ae089c4ee5e613814682a27
FLOW_NAME=Greeting
FLOW_SUMMARY=Greeting workflow
FLOW_DESCRIPTION=YAML based greeting workflow
24 changes: 21 additions & 3 deletions scripts/gen_manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fi

if [ ! -f kn ]; then
echo "Installing kn-workflow CLI"
KN_CLI_URL="https://mirror.openshift.com/pub/openshift-v4/clients/serverless/latest/kn-linux-amd64.tar.gz"
KN_CLI_URL="https://mirror.openshift.com/pub/openshift-v4/clients/serverless/1.11.2/kn-linux-amd64.tar.gz"
curl -L "$KN_CLI_URL" | tar -xz --no-same-owner && chmod +x kn-linux-amd64 && mv kn-linux-amd64 kn
else
echo "kn cli already available"
Expand All @@ -28,10 +28,28 @@ if [ "$ENABLE_PERSISTENCE" = false ]; then
exit
fi

SONATAFLOW_CR=manifests/01-sonataflow_${WORKFLOW_ID}.yaml
# Find the workflow file with .sw.yaml suffix since kn-cli uses the ID to generate resource names
workflow_file=$(printf '%s\n' ./*.sw.yaml 2>/dev/null | head -n 1)

# Check if the workflow_file was found
if [ -z "$workflow_file" ]; then
echo "No workflow file with .sw.yaml suffix found."
exit 1
fi

# Extract the 'id' property from the YAML file and convert to lowercase
workflow_id=$(grep '^id:' "$workflow_file" | awk '{print $2}' | tr '[:upper:]' '[:lower:]')

# Check if the 'id' property was found
if [ -z "$workflow_id" ]; then
echo "No 'id' property found in the workflow file."
exit 1
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_id}:latest\"" "${SONATAFLOW_CR}"

yq --inplace ".spec |= (
. + {
Expand Down

0 comments on commit 62fc922

Please sign in to comment.