Skip to content

Commit

Permalink
WIP: swf-builder generate manifests using kn-workflow
Browse files Browse the repository at this point in the history
Generate manifests and save them in the runtime image.

The manifests will be under /deployment/manifests directory and they can
be extracted for example by echoing them from the image:

  podman run builder:latest cat /deployment/manifests/* >
  manifests-all.yaml

or by podman cp:

  podman cp $(podman create builder:latest):/deployment/manifests .

Signed-off-by: Roy Golan <rgolan@redhat.com>
  • Loading branch information
rgolangh committed Feb 28, 2024
1 parent ce62b9d commit 87b04b1
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions kogito-swf-builder-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
- name: org.kie.kogito.project.versions
- name: org.kie.kogito.swf.common.scripts
- name: org.kie.kogito.swf.builder.runtime.community
- name: org.kie.kogito.workflow-manifests

run:
workdir: "/home/kogito/${PROJECT_ARTIFACT_ID}"
Expand Down
2 changes: 2 additions & 0 deletions modules/kogito-workflow-manifests/added/kn-workflow.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh

35 changes: 35 additions & 0 deletions modules/kogito-workflow-manifests/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh -e
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#

set -x

MANIFESTS_SOURCE_DIR=/deployments
MANIFESTS_TARGET_DIR=/deployments

mkdir -p "${KOGITO_HOME}"/generate
mkdir -p "${MANIFESTS_TARGET_DIR}"

curl -L https://github.com/rgolangh/kie-tools/releases/download/0.0.2/kn-workflow-linux-amd64 -o "${KOGITO_HOME}"/generate/kn-workflow
chmod +x-w "${KOGITO_HOME}"/generate/kn-workflow

cd "${MANIFESTS_SOURCE_DIR}"
"${KOGITO_HOME}"/generate/kn-workflow gen-manifest --custom-generated-manifests-dir="${MANIFESTS_TARGET_DIR}"

24 changes: 24 additions & 0 deletions modules/kogito-workflow-manifests/module.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
schema_version: 1
name: org.kie.kogito.workflow-manifests
version: "999-SNAPSHOT"
description: Module to generate the workflow manifests
execute:
- script: install.sh

0 comments on commit 87b04b1

Please sign in to comment.