forked from biswaz/rescuekerala
-
Notifications
You must be signed in to change notification settings - Fork 573
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
Adds shell script for easy setup on Apple Mac and Ubuntu Linux #1092
Open
ndkshr
wants to merge
3
commits into
raksha-life:master
Choose a base branch
from
ndkshr:easy-setup-sell
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
OS_BASE=$"(uname)" | ||
BUILD_MAC=$"Darwin" | ||
BUILD_LIN=$"Linux" | ||
BUILD_WIN="Windows" | ||
KERALARESCUE_REPO_LINK="https://github.com/IEEEKeralaSection/rescuekerala.git" | ||
# Commands for Apple Mac | ||
if [ $OS_BASE == $BUILD_MAC ] | ||
then | ||
# Install Git and the repo for Kerala Rescue | ||
brew install git | ||
# ======= Uncomment the following line if you do not have the repository downloaded | ||
# git clone $KERALARESCUE_REPO_LINK | ||
echo "Repository is downloaded now you are ready to go" | ||
cd rescuekerala/ | ||
# Install python and pip in mac | ||
brew install python | ||
# Install requirements.txt | ||
pip3 install -r requirements.txt | ||
pip3 install -r requirements_debug.txt | ||
# Implementing docker.sh | ||
chmod 777 docker.sh | ||
sh docker.sh | ||
# PostgreSQL : Expecting that brew is preinstalled in your mac | ||
brew install postgres | ||
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents | ||
alias pg_start="launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist" | ||
alias pg_stop="launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist" | ||
pg_start | ||
# Use pg_stop to stop the postgres server. | ||
createdb `whoami` | ||
brew reinstall readline | ||
createuser -s postgres | ||
createdb rescuekerala | ||
psql -f postgres_setup.sql rescuekerala | ||
# Copy the environment config to the remote repo | ||
# -- Additional configuration maybe required | ||
cp .env.example .env | ||
# Database migration for Django and run the server | ||
python3 manage.py migrate | ||
python3 manage.py collectstatic | ||
python3 manage.py runserver | ||
else | ||
# Commands for Linux[Ubuntu] | ||
if [ $OS_BASE == $BUILD_LIN ] | ||
then | ||
# linux commands (for ubuntu) | ||
# Install Git and the repo | ||
sudo apt-get install git | ||
# git clone $KERALARESCUE_REPO_LINK | ||
echo "Repository is downloaded now you are ready to go" | ||
cd rescuekerala/ | ||
# Install Python and pip | ||
sudo apt-get intall python3 | ||
sudo apt-get install python3-pip | ||
# Install requirements.txt | ||
pip3 install -r requirements.txt | ||
pip3 install -r requirements_debug.txt | ||
# Implementing docker.sh | ||
chmod 777 docker.sh | ||
sh docker.sh | ||
# Postgres setup and installation | ||
# sudo apt-get install wget ca-certificates | ||
# wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | ||
# sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' | ||
sudo apt-get update | ||
sudo apt install postgresql-common | ||
sudo sh /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh | ||
sudo -i -u postgres | ||
createuser -s postgres | ||
createdb rescuekerala | ||
psql -f postgres_setup.sql rescuekerala | ||
# Copy the environment config to the remote repo | ||
# -- Additional configuration maybe required | ||
cp .env.example .env | ||
# Database migration for Django and run the server | ||
python3 manage.py migrate | ||
python3 manage.py collectstatic | ||
python3 manage.py runserver | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CREATE USER rescueuser WITH PASSWORD 'password'; | ||
GRANT ALL PRIVILEGES ON DATABASE rescuekerala TO rescueuser; | ||
\q |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be changed. The double quotes must be changed to `
or the script will fail as the variable OS_BASE will not have the correct value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.