-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: swf-builder generate manifests using kn-workflow
Generate manifests and save them in the runtime image. Generating manifests is an opt-in as part of the build ran by /launch/build-app.sh When setting GEN_MANIFESTS=true during container build the build-app.sh script will call a new generate-manifests.sh script that will use _kn-workflow_ cli and will store the manifests under $KOGITO_HOME/build/manifests Later in the runtime image user can copy and store those manifests for later use: COPY --from=builder --chown=185 /home/kogito/build/manifests /deployments/manifests The manifests 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 <[email protected]>
- Loading branch information
Showing
6 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
modules/kogito-workflow-manifests/added/generate-manifests.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
resource_dir="${1:-${KOGITO_HOME}/serverless-workflow-project/src/main/resources}" | ||
target_dir="${KOGITO_HOME}/build/manifests" | ||
if [ "${GEN_MANIFESTS}" = "true" ]; then | ||
# kn-workflow doesn't support source dir yet, we have to get in | ||
pushd "${resource_dir}" || exit | ||
$KN_CLI gen-manifests --custom-generated-manifests-dir "${target_dir}" | ||
popd || exit | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# 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 | ||
|
||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
INSTALL_DIR=/usr/local/bin | ||
curl -L https://github.com/rgolangh/kie-tools/releases/download/0.0.2/kn-workflow-linux-amd64 -o "${INSTALL_DIR}"/kn-workflow | ||
chmod +x-w "${INSTALL_DIR}"/kn-workflow | ||
|
||
cp -v "${SCRIPT_DIR}"/added/* "${KOGITO_HOME}"/launch | ||
|
||
chown -R 1001:0 "${KOGITO_HOME}"/launch | ||
chmod -R ug+rwX "${KOGITO_HOME}"/launch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# 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 | ||
|
||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
ADDED_DIR="${SCRIPT_DIR}"/added | ||
LAUNCH_DIR="${KOGITO_HOME}"/launch | ||
KN_HOME=/usr/local/bin | ||
curl -L https://github.com/rgolangh/kie-tools/releases/download/0.0.2/kn-workflow-linux-amd64 -o "${KN_HOME}"/kn-workflow | ||
chmod +x-w "${KN_HOME}"/kn-workflow | ||
cp "${ADDED_DIR}"/generate-manifests.sh "${LAUNCH_DIR}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# | ||
# 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 install kn-workflow tool and scripts | ||
execute: | ||
- script: configure | ||
envs: | ||
- name: KN_CLI | ||
value: /usr/local/bin/kn-workflow | ||
- name: GEN_MANIFESTS | ||
value: false | ||
|