44e948c769
Summary: Changed run script to use built memgraph binary. Added missing binary check to run script. Reviewers: buda, teon.banek Reviewed By: buda, teon.banek Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D504
65 lines
1.6 KiB
Bash
Executable File
65 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
function print_usage_and_exit {
|
|
echo "./init [-s] [--no-clone-dependencies] [--arc-diff DIFF_ID]"
|
|
echo -e "Prepare the environment for Memgraph QA.\n"
|
|
echo "Optional arguments:"
|
|
echo -e " -s\tuse sudo apt-get for installing required packages"
|
|
echo -e " -h\tdisplay this help and exit"
|
|
exit 1
|
|
}
|
|
|
|
# read arguments
|
|
use_sudo=false
|
|
while [[ $# -gt 0 ]]; do
|
|
case $1 in
|
|
-s)
|
|
use_sudo=true
|
|
shift
|
|
;;
|
|
*)
|
|
# unknown option
|
|
print_usage_and_exit
|
|
;;
|
|
esac
|
|
done
|
|
|
|
# exit if any subcommand returns a non-zero status
|
|
set -e
|
|
|
|
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
cd ${script_dir}
|
|
|
|
required_pkgs=(python-virtualenv python3-pip) # required by 'run' script
|
|
|
|
# install all dependencies on debian based operating systems
|
|
required_missing=false
|
|
for pkg in ${required_pkgs[@]}; do
|
|
if dpkg -s $pkg 2>/dev/null >/dev/null; then
|
|
echo "Found $pkg"
|
|
elif [[ $use_sudo = true ]]; then
|
|
echo "Installing $pkg"
|
|
if [[ ! `sudo apt-get -y install $pkg` ]]; then
|
|
echo "Didn't install $pkg [required]"
|
|
required_missing=true
|
|
fi
|
|
else
|
|
echo "Missing $pkg [required]"
|
|
required_missing=true
|
|
fi
|
|
done
|
|
|
|
if [[ $required_missing = true ]]; then
|
|
echo "Missing required packages. EXITING!"
|
|
echo "Please, install required packages and rerun $0 again."
|
|
exit 2
|
|
fi
|
|
|
|
# setup ve
|
|
if [ ! -d "ve3" ]; then
|
|
virtualenv -p python3 ve3
|
|
fi
|
|
source ve3/bin/activate
|
|
pip3 install --upgrade pip
|
|
pip3 install -r requirements.txt
|