#!/bin/bash ### Setting up variables used in this 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}" ### Tarring up the files refer to package_oom_cmd for oom version used ### RESULT=$(${ssh_cmd} "${package_oom_cmd} --output-dir /tmp/data --resources-directory ${resources_dir}") if [[ $? -ne 0 ]]; then ### /tmp/data might be already used, thus clean it up and restart again ### ${ssh_cmd} "sudo bash -c \"rm -rf /tmp/data\"" ${ssh_cmd} "${package_oom_cmd} --output-dir /tmp/data --resources-directory ${resources_dir}" if [[ $? -ne 0 ]]; then echo "failed to successfully run package.py" exit -1 fi fi ### Since the values.yaml has pnda set to false (due to issues with the website) the package created contains a different name than used usually ### ### Need to change the name of the tar files ### ${ssh_cmd} "sudo bash -c \"test -f /tmp/data/resources_packagecustom.tar\"" if [[ $? -eq 0 ]]; then echo "There is a custom package"; ${ssh_cmd} "sudo bash -c \"mv /tmp/data/resources_packagecustom.tar /tmp/data/resources_package.tar\""; fi ${ssh_cmd} "sudo bash -c \"test -f /tmp/data/sw_packagecustom.tar\"" if [[ $? -eq 0 ]]; then echo "There is a custom package"; ${ssh_cmd} "sudo bash -c \"mv /tmp/data/sw_packagecustom.tar /tmp/data/sw_package.tar\""; fi