Fix shellcheck errors for LBaaS apps
Current patch fixes shell issues in LBaaS apps reported by test run: tox -e shellcheck All LB related scripts were fixed according command output. Change-Id: Ia24f2ba25d7818cb05d064a9fc7f5f4617f714d8
This commit is contained in:
parent
b963bcb61a
commit
9bed165c30
@ -1,3 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
# Stop the script if an error occurs.
|
# Stop the script if an error occurs.
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@ -5,12 +7,12 @@ set -e
|
|||||||
cd releases/jobs;
|
cd releases/jobs;
|
||||||
|
|
||||||
pushd lbaas-config
|
pushd lbaas-config
|
||||||
tar zcvf lbaas-config.tgz *;
|
tar zcvf lbaas-config.tgz ./*;
|
||||||
mv lbaas-config.tgz ../
|
mv lbaas-config.tgz ../
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd delete-lbaas
|
pushd delete-lbaas
|
||||||
tar zcvf delete-lbaas.tgz *;
|
tar zcvf delete-lbaas.tgz ./*;
|
||||||
mv delete-lbaas.tgz ../
|
mv delete-lbaas.tgz ../
|
||||||
popd
|
popd
|
||||||
|
|
||||||
@ -27,7 +29,7 @@ pushd python/python
|
|||||||
popd
|
popd
|
||||||
|
|
||||||
pushd python
|
pushd python
|
||||||
tar zcvf python.tgz *;
|
tar zcvf python.tgz ./*;
|
||||||
mv python.tgz ../
|
mv python.tgz ../
|
||||||
popd
|
popd
|
||||||
|
|
||||||
@ -69,7 +71,7 @@ sed -i -e "s/%sha1_delete_lbaas_job%/${sha1_delete_lbaas_job}/g" tmp/releases/re
|
|||||||
|
|
||||||
# Pack the release.
|
# Pack the release.
|
||||||
cd tmp/releases;
|
cd tmp/releases;
|
||||||
tar zcvf example-release-10.tgz *;
|
tar zcvf example-release-10.tgz ./*;
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
# Enable option 'extended globbing' for easy deletion.
|
# Enable option 'extended globbing' for easy deletion.
|
||||||
@ -80,7 +82,7 @@ rm -rf tmp/releases/!(example-release-10.tgz)
|
|||||||
|
|
||||||
# Pack tile.
|
# Pack tile.
|
||||||
cd tmp;
|
cd tmp;
|
||||||
zip -r lbaas-tile.zip *;
|
zip -r lbaas-tile.zip ./*;
|
||||||
cd ..
|
cd ..
|
||||||
mv tmp/lbaas-tile.zip .
|
mv tmp/lbaas-tile.zip .
|
||||||
|
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
host=$1
|
host=$1
|
||||||
pem_file=$2
|
pem_file=$2
|
||||||
pkey_path=$3
|
pkey_path=$3
|
||||||
|
|
||||||
echo $host
|
echo "$host"
|
||||||
echo $pem_file
|
echo "$pem_file"
|
||||||
echo $pkey_path
|
echo "$pkey_path"
|
||||||
|
|
||||||
scp -o StrictHostKeyChecking=no -i $pkey_path $pem_file ec2-user@$host:~/
|
scp -o StrictHostKeyChecking=no -i "$pkey_path" "$pem_file" "ec2-user@$host:~/"
|
||||||
|
|
||||||
ssh -o StrictHostKeyChecking=no -i $pkey_path ec2-user@$host "sudo mv ~/cf.pem /etc/ssl/"
|
ssh -o StrictHostKeyChecking=no -i "$pkey_path" "ec2-user@$host" "sudo mv ~/cf.pem /etc/ssl/"
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
# Stop the script if an error occurs.
|
# Stop the script if an error occurs.
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
function cleanup {
|
function cleanup {
|
||||||
cd $SCRIPTPATH
|
cd "$SCRIPTPATH"
|
||||||
rm -rf tmp
|
rm -rf tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
# In case if script is running not where it is located.
|
# In case if script is running not where it is located.
|
||||||
cd $(dirname $0)
|
cd "$(dirname "$0")"
|
||||||
SCRIPTPATH=`pwd`
|
SCRIPTPATH=$(pwd)
|
||||||
|
|
||||||
# Cleanup tmp dir on script exit.
|
# Cleanup tmp dir on script exit.
|
||||||
trap 'cleanup' EXIT
|
trap 'cleanup' EXIT
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
# Fail script if an error occurs.
|
# Fail script if an error occurs.
|
||||||
set -e
|
set -e
|
||||||
# TODO(nmakhotkin): It should be removed in the future after fixing the bug:
|
# TODO(nmakhotkin): It should be removed in the future after fixing the bug:
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
sudo add-apt-repository ppa:vbernat/haproxy-1.5 -y
|
sudo add-apt-repository ppa:vbernat/haproxy-1.5 -y
|
||||||
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
@ -6,7 +8,7 @@ sudo apt-get install -y haproxy
|
|||||||
# Enabling HAProxy.
|
# Enabling HAProxy.
|
||||||
sudo sed -i 's/^ENABLED=.*/ENABLED=1/' /etc/default/haproxy
|
sudo sed -i 's/^ENABLED=.*/ENABLED=1/' /etc/default/haproxy
|
||||||
|
|
||||||
sudo chown -R $USER:$USER /etc/haproxy
|
sudo chown -R "$USER:$USER" /etc/haproxy
|
||||||
|
|
||||||
# Starting HAProxy.
|
# Starting HAProxy.
|
||||||
#sudo service haproxy restart
|
#sudo service haproxy restart
|
||||||
|
@ -20,8 +20,8 @@ sudo pip install lbaas.tar.gz
|
|||||||
sudo pip install mysql-python
|
sudo pip install mysql-python
|
||||||
|
|
||||||
sudo mkdir /etc/lbaas
|
sudo mkdir /etc/lbaas
|
||||||
sudo chown -R $USER:$USER /etc/lbaas
|
sudo chown -R "$USER:$USER" /etc/lbaas
|
||||||
sudo chown -R $USER:$USER /var/log/lbaas.log
|
sudo chown -R "$USER:$USER" /var/log/lbaas.log
|
||||||
|
|
||||||
# Moving config to another place.
|
# Moving config to another place.
|
||||||
cp lbaas.conf.sample /etc/lbaas/lbaas.conf
|
cp lbaas.conf.sample /etc/lbaas/lbaas.conf
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
tools_path=${tools_path:-$(dirname $0)}
|
tools_path=${tools_path:-$(dirname "$0")}
|
||||||
venv_path=${venv_path:-${tools_path}}
|
venv_path=${venv_path:-${tools_path}}
|
||||||
venv_dir=${venv_name:-/../.venv}
|
venv_dir=${venv_name:-/../.venv}
|
||||||
TOOLS=${tools_path}
|
|
||||||
VENV=${venv:-${venv_path}/${venv_dir}}
|
VENV=${venv:-${venv_path}/${venv_dir}}
|
||||||
source ${VENV}/bin/activate && "$@"
|
source "${VENV}/bin/activate" && "$@"
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
# Stop the script if an error occurs.
|
# Stop the script if an error occurs.
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
function cleanup {
|
function cleanup {
|
||||||
cd $SCRIPTPATH
|
cd "$SCRIPTPATH"
|
||||||
rm -rf tmp
|
rm -rf tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
# In case if script is running not where it is located.
|
# In case if script is running not where it is located.
|
||||||
cd $(dirname $0)
|
cd "$(dirname "$0")"
|
||||||
SCRIPTPATH=`pwd`
|
SCRIPTPATH=$(pwd)
|
||||||
|
|
||||||
# Cleanup tmp dir on script exit.
|
# Cleanup tmp dir on script exit.
|
||||||
trap 'cleanup' EXIT
|
trap 'cleanup' EXIT
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
sudo add-apt-repository ppa:vbernat/haproxy-1.5 -y
|
sudo add-apt-repository ppa:vbernat/haproxy-1.5 -y
|
||||||
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
@ -6,7 +8,7 @@ sudo apt-get install -y haproxy
|
|||||||
# Enabling HAProxy.
|
# Enabling HAProxy.
|
||||||
sudo sed -i 's/^ENABLED=.*/ENABLED=1/' /etc/default/haproxy
|
sudo sed -i 's/^ENABLED=.*/ENABLED=1/' /etc/default/haproxy
|
||||||
|
|
||||||
sudo chown -R $USER:$USER /etc/haproxy
|
sudo chown -R "$USER:$USER" /etc/haproxy
|
||||||
|
|
||||||
# Starting HAProxy.
|
# Starting HAProxy.
|
||||||
#sudo service haproxy restart
|
#sudo service haproxy restart
|
||||||
|
Loading…
x
Reference in New Issue
Block a user