Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made the script Docker-compatible + Prevented version failures #690

Merged
merged 4 commits into from
Jan 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

# Created by https://www.gitignore.io/api/vim,node,python,sublimetext,visualstudiocode

### Mac Junk ###
.DS_Store

### Node ###
# Logs
logs
Expand Down
93 changes: 44 additions & 49 deletions setup.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,49 +1,44 @@
#!/bin/bash

echo "Installing pip"
sudo apt-get install -y python3-pip
echo "pip installed"

echo "Installing setuptools"
sudo apt-get install -y python3-setuptools
echo "pip installed"

echo "Installing Aria2"
sudo apt-get install -y aria2
echo "Aria2 installed"

echo "Installing mysql-server"
sudo apt-get install -y mysql-server
echo "mysql-server installed"

echo "Installing libmysqlclient"
sudo apt-get install libmysqlclient-dev
echo "libmysqlclient installed"

echo "Installing node"
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
echo "NodeJS installed"

echo "Installing bower globally"
sudo npm install -g bower
echo "bower installed"

echo "Installing gulp globally"
sudo npm install -g gulp
echo "gulp installed"

# save the directory for further uses
pwd > main_directory.txt

echo "Adding path to bashrc file"
main_file="main_directory.txt"
main_directory=""
while IFS= read line
do
echo "$line"
main_directory=$line
done <"$main_file"
rm -rf main_directory.txt
echo "export PATH=\"$main_directory:$""PATH\"" | sudo tee -a ~/.bashrc > /dev/null
source ~/.bashrc
#!/bin/sh
if ! [ $(id -u) = 0 ]; then
printf "Please run as root to proceed with installations... \n1. Type in: su\n2. Enter your password\n3. Execute: sh setup.sh\n"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for using printf instead of echo ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy code quality requirement
There is no output difference btw on using echo or printf ^.^


else
echo "Starting Installation..."

echo "Udating package list and Pre-installed package versions"
apt-get update && apt-get upgrade
echo "All packages now updated and ready to be used"

echo "Installing pip"
apt-get install -y python3-pip
echo "pip installed"

echo "Installing setuptools"
apt-get install -y python3-setuptools
echo "pip installed"

echo "Installing Aria2"
apt-get install -y aria2
echo "Aria2 installed"

echo "Installing mysql-server"
apt-get install -y mysql-server
echo "mysql-server installed"

echo "Installing libmysqlclient"
apt-get install libmysqlclient-dev
echo "libmysqlclient installed"

echo "Installing node"
curl -sL https://deb.nodesource.com/setup_6.x
apt-get install -y nodejs
echo "NodeJS installed"

echo "Installing bower globally"
npm install -g bower
echo "bower installed"

echo "Installing gulp globally"
npm install -g gulp
echo "gulp installed"
fi