Skip to content

Commit

Permalink
Updating utility/*.sh scripts from sodar-server
Browse files Browse the repository at this point in the history
Closes: #531
Related-Issue: #531
Projected-Results-Impact: none
  • Loading branch information
holtgrewe committed Jun 11, 2022
1 parent 5da3cb9 commit 13d8711
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 135 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Expand Up @@ -46,6 +46,7 @@ Full Change List
- Switching scoring to MutationTaster 85 interface, added back MT 85 link-out alongside MT 2021 link-out (#509).
- CADD setup fix for documentation (#520)
- Made flag filter and flag form nomenclature consistent (#297)
- Updating ``utility/*.sh`` scripts from "upstream" sodar-server (#531).

------
v1.2.0
Expand Down
2 changes: 1 addition & 1 deletion utility/install_chrome.sh
Expand Up @@ -5,7 +5,7 @@ echo "Installing Chrome + Driver for UI Testing"
echo "***********************************************"

# Version
CHROME_DRIVER_VERSION=98.0.4758.80
CHROME_DRIVER_VERSION=$(curl http://chromedriver.storage.googleapis.com/LATEST_RELEASE)

# Install dependencies
sudo apt-get update
Expand Down
2 changes: 1 addition & 1 deletion utility/install_chrome_gitlab.sh
Expand Up @@ -5,7 +5,7 @@ echo "Installing Chrome + Driver for UI Testing"
echo "***********************************************"

# Version
CHROME_DRIVER_VERSION=98.0.4758.80
CHROME_DRIVER_VERSION=$(curl http://chromedriver.storage.googleapis.com/LATEST_RELEASE)

# Install dependencies
apt-get -y install unzip libgconf-2-4 xvfb gtk2-engines-pixbuf
Expand Down
2 changes: 2 additions & 0 deletions utility/install_ldap_dependencies.sh
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

echo "***********************************************"
echo "Installing LDAP/AD dependencies"
echo "***********************************************"
Expand Down
140 changes: 44 additions & 96 deletions utility/install_os_dependencies.sh
@@ -1,96 +1,44 @@
#!/bin/bash

WORK_DIR="$(dirname "$0")"
DISTRO_NAME=$(lsb_release -sc)
OS_REQUIREMENTS_FILENAME="requirements-$DISTRO_NAME.apt"

cd $WORK_DIR

# Check if a requirements file exist for the current distribution.
if [ ! -r "$OS_REQUIREMENTS_FILENAME" ]; then
cat <<-EOF >&2
There is no requirements file for your distribution.
You can see one of the files listed below to help search the equivalent package in your system:
$(find ./ -name "requirements-*.apt" -printf " - %f\n")
EOF
exit 1;
fi

# Handle call with wrong command
function wrong_command()
{
echo "${0##*/} - unknown command: '${1}'" >&2
usage_message
}

# Print help / script usage
function usage_message()
{
cat <<-EOF
Usage: $WORK_DIR/${0##*/} <command>
Available commands are:
list Print a list of all packages defined on ${OS_REQUIREMENTS_FILENAME} file
help Print this help
Commands that require superuser permission:
install Install packages defined on ${OS_REQUIREMENTS_FILENAME} file. Note: This
does not upgrade the packages already installed for new versions, even if
new version is available in the repository.
upgrade Same that install, but upgrade the already installed packages, if new
version is available.
EOF
}

# Read the requirements.apt file, and remove comments and blank lines
function list_packages(){
grep -v "#" "${OS_REQUIREMENTS_FILENAME}" | grep -v "^$";
}

function install_packages()
{
list_packages | xargs apt-get --no-upgrade install -y;
}

function upgrade_packages()
{
list_packages | xargs apt-get install -y;
}

function install_or_upgrade()
{
P=${1}
PARAN=${P:-"install"}

if [[ $EUID -ne 0 ]]; then
cat <<-EOF >&2
You must run this script with root privilege
Please do:
sudo $WORK_DIR/${0##*/} $PARAN
EOF
exit 1
else

apt-get update

# Install the basic compilation dependencies and other required libraries of this project
if [ "$PARAN" == "install" ]; then
install_packages;
else
upgrade_packages;
fi

# cleaning downloaded packages from apt-get cache
apt-get clean

exit 0
fi
}

# Handle command argument
case "$1" in
install) install_or_upgrade;;
upgrade) install_or_upgrade "upgrade";;
list) list_packages;;
help|"") usage_message;;
*) wrong_command "$1";;
esac
#!/usr/bin/env bash

echo "***********************************************"
echo "Apt-get update"
echo "***********************************************"
apt-get -y update

echo "***********************************************"
echo "Installing general OS dependencies"
echo "***********************************************"
apt-get -y install build-essential
apt-get -y install python3-dev
apt-get -y install curl

echo "***********************************************"
echo "Installing Pillow and pylibmc dependencies"
echo "***********************************************"
apt-get -y install zlib1g-dev
apt-get -y install libtiff5-dev
apt-get -y install libjpeg8-dev
apt-get -y install libfreetype6-dev
apt-get -y install liblcms2-dev
apt-get -y install libwebp-dev

echo "***********************************************"
echo "Installing Postgresql and psycopg2 dependencies"
echo "***********************************************"
apt-get -y install libpq-dev

echo "***********************************************"
echo "Installing django-extensions dependencies"
echo "***********************************************"
apt-get -y install graphviz-dev

echo "***********************************************"
echo "Installing SAML dependencies"
echo "***********************************************"
apt-get -y install xmlsec1

echo "***********************************************"
echo "Installing lxml dependencies"
echo "***********************************************"
apt-get -y install libxml2-dev
apt-get -y install libxslt-dev
28 changes: 3 additions & 25 deletions utility/install_os_gitlab.sh
@@ -1,6 +1,5 @@
#!/usr/bin/env bash
# Install OS dependencies for Docker image python:3.4 used in Gitlab CI
# TODO: Some of these are up-to-date on image, remove or keep just in case?
# Install OS dependencies for Docker image python:3.6 used in Gitlab CI

echo "***********************************************"
echo "Apt-get update"
Expand All @@ -10,41 +9,20 @@ apt-get -y update
echo "***********************************************"
echo "Installing OS dependencies"
echo "***********************************************"
apt-get -y install apt-utils
apt-get -y install build-essential
apt-get -y install python3-dev python3-setuptools
apt-get -y install git
apt-get -y install supervisor

echo "***********************************************"
echo "Installing translation requirements"
echo "***********************************************"
apt-get -y install gettext

echo "***********************************************"
echo "Installing shared Pillow/pylibmc dependencies"
echo "***********************************************"
apt-get -y install zlib1g-dev

echo "***********************************************"
echo "Installing Posgresql and psycopg2 dependencies"
echo "***********************************************"
apt-get -y install libpq-dev

echo "***********************************************"
echo "Installing Pillow dependencies"
echo "***********************************************"
apt-get -y install libtiff5-dev
apt-get -y install libjpeg62-turbo-dev
apt-get -y install libfreetype6-dev
apt-get -y install liblcms2-dev
apt-get -y install libwebp-dev

echo "***********************************************"
echo "Installing django-extensions dependencies"
echo "***********************************************"
apt-get -y install graphviz-dev


echo "***********************************************"
echo "Installing LDAP/AD dependencies"
echo "***********************************************"
Expand All @@ -54,5 +32,5 @@ apt-get -y install libldap2-dev
echo "***********************************************"
echo "Installing Node.js"
echo "***********************************************"
curl -sL https://deb.nodesource.com/setup_10.x | bash -
curl -sL https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs
14 changes: 3 additions & 11 deletions utility/install_python_dependencies.sh
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

WORK_DIR="$(dirname "$0")"
PROJECT_DIR="$(dirname "$WORK_DIR")"
Expand All @@ -12,15 +12,6 @@ pip --version >/dev/null 2>&1 || {
exit 1;
}

virtualenv --version >/dev/null 2>&1 || {
echo >&2 -e "\nvirtualenv is required but it's not installed."
echo >&2 -e "You can install it by running the following command:\n"
echo >&2 "sudo -H pip3 install virtualenv"
echo >&2 -e "\n"
echo >&2 -e "\nFor more information, see virtualenv documentation: https://virtualenv.pypa.io/en/latest/"
exit 1;
}

if [ -z "$VIRTUAL_ENV" ]; then
echo >&2 -e "\nYou need activate a virtualenv first"
echo >&2 -e 'If you do not have a virtualenv created, run the following command to create and automatically activate a new virtualenv named "venv" on current folder:\n'
Expand All @@ -34,7 +25,8 @@ if [ -z "$VIRTUAL_ENV" ]; then
exit 1;
else

pip install wheel==0.37.1
pip install -r $PROJECT_DIR/requirements/local.txt
pip install -r $PROJECT_DIR/requirements/test.txt
#pip install -r $PROJECT_DIR/requirements.txt
pip install -r $PROJECT_DIR/requirements.txt
fi
2 changes: 1 addition & 1 deletion utility/install_vue_dev.sh
Expand Up @@ -3,7 +3,7 @@ echo "***********************************************"
echo "Installing Node.js"
echo "***********************************************"
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
apt-get install -y nodejs

echo "***********************************************"
echo "Installing Vue CLI and Init"
Expand Down

0 comments on commit 13d8711

Please sign in to comment.