#!/bin/bash ### Setting up variables used in the script ### build_node_ip=$(openstack server list -c Name -c Networks -f value | egrep ${openstack_build_stack_name} | awk '{print $NF}' | sed 's/.*=//g') ssh_cmd="ssh -o StrictHostKeychecking=no -i ${ssh_key} ${remote_user}@${build_node_ip}" ### Concat'ing the onap and rke images lists ### RESULT=$(${ssh_cmd} "sudo bash -c \"cat ${data_list_dir}/rke_docker_images.list >> ${data_list_dir}/onap_docker_images.list\"") if [[ $? -ne 0 ]]; then echo "Failed to concat the lists: ${RESULT}" exit -1 fi ### Building the nexus blob ### RESULT=$(${ssh_cmd} "sudo ${build_dir}/build_nexus_blob.sh") if [[ $? -ne 0 ]]; then echo "Failed to build nexus blob: ${RESULT}" exit -1 fi ### Deleting docker images and npm files in order to free up space on the server ### RESULT=$(${ssh_cmd} "sudo rm -f ${resources_dir}/offline_data/docker_images_for_nexus/*") if [[ $? -ne 0 ]]; then echo "Failed to cleanup nexus docker images: ${RESULT}" exit -1 fi RESULT=$(${ssh_cmd} "sudo rm -rf ${resources_dir}/offline_data/npm_tar") if [[ $? -ne 0 ]]; then echo "Failed to cleanup npm directory: ${RESULT}" exit -1 fi