I have SSH on my server but not sudo or root can I still use Ottomatik? | Ottomatik

I have SSH on my server but not sudo or root can I still use Ottomatik?

Yes! If you have a hosting provider that allows you to SSH into the
server, but does not give you root access or sudo access to install
global dependencies you can still use Ottomatik. Here are some
installation tips on how to get running.

The steps below make the following assumption:

1. You have already installed the public SSH key provided by Ottomatik
for your SSH user.

To make this work, the following will be done:

1. Python will be installed into its own private directory.
2. Environment variables and aliases will be set up to allow the
scripts to work as expected.

Start by downloading and installing Python in an alternate directory
with pyenv:

Create a directory of your choice for where python and pip will live:

mkdir $HOME/.pyenv/
cd $HOME/.pyenv/
git clone https://github.com/yyuu/pyenv.git .
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc

Note `.bashrc` is used here since SSH connections are
non-interactive and as a result,

This will set up and configure pyenv to let you run Python along with
all of its dependencies from within a single directory, rather than
relying on whatever version of Python is installed on your system.

Then, you must install the version of Python we are interested in.

cd $HOME/.pyenv/bin
pyenv install 2.6.6 # (or whatever version of python you want)

Python will then be downloaded and installed to:
`$HOME/.pyenv/versions/2.6.6/` (in the case of 2.6.6) and pip can be
found at:
`$HOME/.pyenv/versions/2.6.6/bin/pip`

Next aliases can be created for pip and python for command line:

echo "alias pip=$HOME/.pyenv/versions/2.6.6/bin/pip">> ~/.bashrc
echo "alias python=$HOME/.pyenv/versions/2.6.6/bin/python">>
~/.bashrc

Our scripts do not use absolute paths to the python and pip binaries so
this method allows you to call them using the aliased paths.

Refresh shell to test all of the configuration:
exec $SHELL

If you are getting errors with the automated jobs saying that pip and
python cannot be found or they are the wrong version, then add this to
your `.bashrc`:

echo 'shopt -s expand_aliases' >> ~/.bashrc

This will enable alias expansion.

Now install the remaining pip packages required, which can be found in this article