From f9c4507a0d9ae13a0ace2bd3f312d329371fc072 Mon Sep 17 00:00:00 2001 From: Bryan Sullivan Date: Tue, 13 Feb 2018 07:18:03 -0800 Subject: Fix "ambiguous redirect" etc with use in Jenkins JIRA: MODELS-2 Change-Id: I4d07247b8fe535bab645475e689e46f48a6bacfa Signed-off-by: Bryan Sullivan --- tools/cloudify/k8s-cloudify.sh | 7 +------ tools/kubernetes/demo_deploy.sh | 19 +++++++++++-------- tools/kubernetes/k8s-cluster.sh | 2 +- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/tools/cloudify/k8s-cloudify.sh b/tools/cloudify/k8s-cloudify.sh index b3780ae..f922880 100644 --- a/tools/cloudify/k8s-cloudify.sh +++ b/tools/cloudify/k8s-cloudify.sh @@ -51,12 +51,6 @@ #. : username on the target host. Also used to indicate OS name. #. clean: uninstalls cloudify CLI and Manager #. -#. If using this script to start/stop blueprints with multiple k8s environments, -#. before invoking the script copy the k8s_env.sh script from the target -#. cluster and copy to ~/k8s_env.sh, e.g. -#. scp centos@sm-1:/home/centos/k8s_env.sh ~/k8s_env_sm-1.sh -#. cp ~/k8s_env_sm-1.sh ~/k8s_env.sh -#. #. Status: this is a work in progress, under test. function fail() { @@ -324,6 +318,7 @@ function start() { log "package the blueprint" # CLI: cfy blueprints package -o ~/tmp/$bp $bp + mkdir -p ~/tmp tar ckf ~/tmp/blueprint.tar $bp log "upload the blueprint" diff --git a/tools/kubernetes/demo_deploy.sh b/tools/kubernetes/demo_deploy.sh index 75bd8f7..2a3f8f2 100644 --- a/tools/kubernetes/demo_deploy.sh +++ b/tools/kubernetes/demo_deploy.sh @@ -42,13 +42,15 @@ #. worker, or folder (e.g. "/ceph") #. : optional name of script for extra setup functions as needed #. -#. The script will create a k8s environment setup file specific to the master -#. hostname, e.g. k8s_env_k8s-1.sh. This allows multiple deploys to be invoked -#. from the same admin server, by -#. #. See tools/demo_deploy.sh in the OPNFV VES repo for additional environment #. variables (mandatory/optional) for VES +trap 'fail' ERR + +function fail() { + exit 1 +} + function run() { start=$((`date +%s`/60)) $1 @@ -77,11 +79,12 @@ deploy_start=$((`date +%s`/60)) extras=${10} if [[ "$4" != "$5" ]]; then - k8s_master_hostname=$(echo $1 | cut -d ' ' -f 1) + k8s_master_hostname=$(echo "$1" | cut -d ' ' -f 1) else k8s_master_hostname=$1 fi -cat <~/k8s_env_$k8s_master_hostname.sh +cat <~/k8s_env.sh +#!/bin/bash k8s_nodes="$1" k8s_user=$2 k8s_key=$3 @@ -103,7 +106,7 @@ export k8s_pub_net export k8s_ceph_mode export k8s_ceph_dev EOF -source ~/k8s_env_$k8s_master_hostname.sh +source ~/k8s_env.sh env | grep k8s_ echo; echo "$0 $(date): Deploying base OS for master and worker nodes..." @@ -116,7 +119,7 @@ ssh-add $k8s_key scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $k8s_key \ $k8s_user@$k8s_master:/home/$k8s_user/$k8s_key scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \ - ~/k8s_env_$k8s_master_hostname.sh $k8s_user@$k8s_master:/home/$k8s_user/k8s_env.sh + ~/k8s_env.sh $k8s_user@$k8s_master:/home/$k8s_user/k8s_env.sh echo; echo "$0 $(date): Setting up kubernetes master..." scp -r -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \ diff --git a/tools/kubernetes/k8s-cluster.sh b/tools/kubernetes/k8s-cluster.sh index fb06f5d..e9293f6 100644 --- a/tools/kubernetes/k8s-cluster.sh +++ b/tools/kubernetes/k8s-cluster.sh @@ -261,7 +261,7 @@ EOF fi ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \ $USER@$worker bash prereqs.sh - scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ~/k8s_env_$k8s_master_hostname.sh \ + scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ~/k8s_env.sh \ $USER@$worker:/home/$USER/k8s_env.sh scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \ start_worker.sh $USER@$worker:/home/$USER/. -- cgit 1.2.3-korg