[jump req] Add build/deploy specific requirements 91/61191/1
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Sun, 19 Aug 2018 21:28:03 +0000 (23:28 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Tue, 21 Aug 2018 15:21:28 +0000 (17:21 +0200)
Add support for different prerequisites depending on the current
operation (docker build or cluster deploy).

Leverage the new support to pre-install upcoming deps:
- python-pip (build);
- docker-compose (deploy);

JIRA: FUEL-383

Change-Id: Ic3e6062b1943e3584f0b1f80d2e33b8812defced
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
ci/deploy.sh
mcp/scripts/lib.sh
mcp/scripts/requirements_deb.yaml
mcp/scripts/requirements_rpm.yaml

index ea8524a..d3704a1 100755 (executable)
@@ -240,7 +240,7 @@ if [ ${USE_EXISTING_PKGS} -eq 1 ]; then
     notify "[NOTE] Skipping distro pkg installation" 2
 else
     notify "[NOTE] Installing required distro pkgs" 2
-    jumpserver_pkg_install
+    jumpserver_pkg_install 'deploy'
 fi
 
 if ! virsh list >/dev/null 2>&1; then
index c566cc9..c3a71a4 100644 (file)
@@ -321,6 +321,7 @@ function prepare_vms {
 }
 
 function jumpserver_pkg_install {
+  local req_type=$1
   if [ -n "$(command -v apt-get)" ]; then
     pkg_type='deb'; pkg_cmd='sudo apt-get install -y'
   else
@@ -328,7 +329,7 @@ function jumpserver_pkg_install {
   fi
   eval "$(parse_yaml "./requirements_${pkg_type}.yaml")"
   for section in 'common' "$(uname -i)"; do
-    section_var="requirements_pkg_${section}[*]"
+    section_var="${req_type}_${section}[*]"
     pkg_list+=" ${!section_var}"
   done
   # shellcheck disable=SC2086
index 04ddcf6..c04f2a1 100644 (file)
@@ -6,13 +6,18 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 ---
-requirements_pkg:
+build:
+  # Common pkgs required for all builds, no matter the type, arch etc.
+  common:
+    - python-pip
+deploy:
   # Common pkgs required for all deploys, no matter the type, arch etc.
   common:
     - bridge-utils
     - cloud-guest-utils
     - cpu-checker
     - curl
+    - docker-compose
     - e2fsprogs
     - git
     - kpartx
index 3df4d0a..50ce5d9 100644 (file)
@@ -6,13 +6,18 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 ---
-requirements_pkg:
+build:
+  # Common pkgs required for all builds, no matter the type, arch etc.
+  common:
+    - python-pip
+deploy:
   # Common pkgs required for all deploys, no matter the type, arch etc.
   common:
     - bc
     - bridge-utils
     - cloud-utils-growpart
     - curl
+    - docker-compose
     - elfutils-libelf-devel
     - e2fsprogs
     - genisoimage