forked from Cloudevel/cd-deploy
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·31 lines (24 loc) · 1.24 KB
/
deploy.sh
File metadata and controls
executable file
·31 lines (24 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#! /bin/bash
sudo apt update
sudo apt dist-upgrade -y
sudo apt install apache2 mariadb-server curl php-zip zip php-curl php-mysql tree mc docker.io vim libapache2-mod-php python3-pip python3-virtualenv unzip wget w3m build-essential -y
#sudo apt purge cloud-init -y
sudo apt clean
sudo adduser oi docker
mkdir $HOME/pythonista
virtualenv $HOME/pythonista
source $HOME/pythonista/bin/activate
pip install notebook bash-kernel
python -m bash_kernel.install
jupyter notebook --generate-config
cp jupyter_notebook_config.* $HOME/.jupyter/
sudo mkdir /opt/oi
sudo chown -R oi:oi /opt/oi
echo -e "#! /bin/bash\nsource $HOME/pythonista/bin/activate\njupyter notebook --no-browser" > $HOME/jupyter.sh
chmod +x $HOME/jupyter.sh
echo -e "[Unit]\nDescription=Jupyter Notebook\n\n[Service]\nType=simple\nPIDFile=/run/jupyter.pid\nExecStart=/home/oi/jupyter.sh\nUser=oi\nGroup=oi\nWorkingDirectory=/opt/oi/\nRestart=always\nRestartSec=10\n\n[Install]\nWantedBy=multi-user.target" > jupyter.service
sudo mv jupyter.service /lib/systemd/system/
sudo systemctl enable jupyter.service
wget https://github.com/vrana/adminer/releases/download/v4.8.1/adminer-4.8.1.php
sudo mv adminer-4.8.1.php /var/www/html/adminer.php
echo "source $HOME/pythonista/bin/activate" >> $HOME/.bashrc