summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-03-04 03:50:01 +0100
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-03-04 20:04:13 +0100
commit5e5e35e0cc0cf0abe1fd4a8d0cee8d6541a7f81b (patch)
tree06f0340f8b568f8a1601c8afdd1bd22a711db716
parentdea6521c7b21d8fef861ce881f8451367679842e (diff)
[jump req] Move pkg installation to lib.sh
Change-Id: I687b73b256aca78c9d41d4bcd49bfbde51278b51 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-rwxr-xr-xci/deploy.sh13
-rw-r--r--mcp/scripts/lib.sh15
2 files changed, 16 insertions, 12 deletions
diff --git a/ci/deploy.sh b/ci/deploy.sh
index 344a87fc8..e07aca57b 100755
--- a/ci/deploy.sh
+++ b/ci/deploy.sh
@@ -234,18 +234,7 @@ if [ ${USE_EXISTING_PKGS} -eq 1 ]; then
notify "[NOTE] Skipping distro pkg installation" 2
else
notify "[NOTE] Installing required distro pkgs" 2
- if [ -n "$(command -v apt-get)" ]; then
- pkg_type='deb'; pkg_cmd='sudo apt-get install -y'
- else
- pkg_type='rpm'; pkg_cmd='sudo yum install -y --skip-broken'
- fi
- eval "$(parse_yaml "./requirements_${pkg_type}.yaml")"
- for section in 'common' "$(uname -m)"; do
- section_var="requirements_pkg_${section}[*]"
- pkg_list+=" ${!section_var}"
- done
- # shellcheck disable=SC2086
- ${pkg_cmd} ${pkg_list}
+ jumpserver_pkg_install
fi
if ! virsh list >/dev/null 2>&1; then
diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh
index e522fd610..e8edf9587 100644
--- a/mcp/scripts/lib.sh
+++ b/mcp/scripts/lib.sh
@@ -317,6 +317,21 @@ function prepare_vms {
fi
}
+function jumpserver_pkg_install {
+ if [ -n "$(command -v apt-get)" ]; then
+ pkg_type='deb'; pkg_cmd='sudo apt-get install -y'
+ else
+ pkg_type='rpm'; pkg_cmd='sudo yum install -y --skip-broken'
+ fi
+ eval "$(parse_yaml "./requirements_${pkg_type}.yaml")"
+ for section in 'common' "$(uname -i)"; do
+ section_var="requirements_pkg_${section}[*]"
+ pkg_list+=" ${!section_var}"
+ done
+ # shellcheck disable=SC2086
+ ${pkg_cmd} ${pkg_list}
+}
+
function jumpserver_check_requirements {
# shellcheck disable=SC2178
local vnodes=$1; shift