Skip to content

Commit

Permalink
Recreate org.kie.kogito.pkg-update and org.kie.kogito.image.dependenc…
Browse files Browse the repository at this point in the history
…ies modules removed from upstream (#33)

Those modules are still used by the productized images.

- org.kie.kogito.pkg-update module was introduced in the past to make sure all the rpms of the images are updated
  and  avoid any issues related to CVEs on RHEL layer.
- org.kie.kogito.image.dependencies module is required as unzip is required in productized images
  • Loading branch information
rgdoliveira authored Apr 18, 2024
1 parent 0572a25 commit 48797bf
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 0 deletions.
22 changes: 22 additions & 0 deletions modules/prod/kogito-image-dependencies/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/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.
#

microdnf clean all
rm -rf /var/cache/yum
29 changes: 29 additions & 0 deletions modules/prod/kogito-image-dependencies/module.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#
# 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.image.dependencies
version: "1.32.0"
description: holds common dependencies across images

execute:
- script: clean.sh

packages:
install:
- unzip
32 changes: 32 additions & 0 deletions modules/prod/kogito-pkg-update/configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/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 -euo pipefail

for candidate in yum dnf microdnf; do
if command -v "$candidate"; then
mgr="$(command -v "$candidate")"
"$mgr" update -y
"$mgr" -y clean all
exit
fi
done

echo "cannot find a package manager" >&2
exit 1
25 changes: 25 additions & 0 deletions modules/prod/kogito-pkg-update/module.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# 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.pkg-update
version: "1.32.0"
description: "Perform a system update via the package manager."

execute:
- script: configure

0 comments on commit 48797bf

Please sign in to comment.