From 310b81ecfde6b8b57cdce8eee189f1a4c9d31209 Mon Sep 17 00:00:00 2001 From: Andrea Lamparelli Date: Wed, 14 Dec 2022 15:43:45 +0100 Subject: [PATCH] [KIECLOUD-672] add pkg-update module --- jobss-kie-pkg-update/configure | 14 ++++++++++++++ jobss-kie-pkg-update/module.yaml | 7 +++++++ 2 files changed, 21 insertions(+) create mode 100755 jobss-kie-pkg-update/configure create mode 100644 jobss-kie-pkg-update/module.yaml diff --git a/jobss-kie-pkg-update/configure b/jobss-kie-pkg-update/configure new file mode 100755 index 00000000..32919fa4 --- /dev/null +++ b/jobss-kie-pkg-update/configure @@ -0,0 +1,14 @@ +#!/bin/bash +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 \ No newline at end of file diff --git a/jobss-kie-pkg-update/module.yaml b/jobss-kie-pkg-update/module.yaml new file mode 100644 index 00000000..53c1bb5f --- /dev/null +++ b/jobss-kie-pkg-update/module.yaml @@ -0,0 +1,7 @@ +schema_version: 1 +name: jboss.kie.pkg-update +version: "1.0" +description: "Perform a system update via the package manager." + +execute: +- script: configure \ No newline at end of file