Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
cad2f85d
Commit
cad2f85d
authored
Jun 11, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #93 from MITx/create-dev-env
Create dev env
parents
d294ea23
2931dce9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
26 deletions
+83
-26
create-dev-env.sh
+83
-26
No files found.
create-dev-env.sh
View file @
cad2f85d
#!/
bin/
bash
#!/
usr/bin/env
bash
set
-e
set
-e
# posix compliant sanity check
if
[
-z
$BASH
]
||
[
$BASH
=
"/bin/sh"
]
;
then
echo
"Please use the bash interpreter to run this script"
exit
1
fi
trap
"ouch"
ERR
trap
"ouch"
ERR
ouch
()
{
ouch
()
{
...
@@ -14,6 +21,7 @@ ouch() {
...
@@ -14,6 +21,7 @@ ouch() {
script again with the -v flag.
script again with the -v flag.
EOL
EOL
printf
'\E[0m'
}
}
error
()
{
error
()
{
...
@@ -28,6 +36,7 @@ usage() {
...
@@ -28,6 +36,7 @@ usage() {
Usage:
$PROG
[-c] [-v] [-h]
Usage:
$PROG
[-c] [-v] [-h]
-c compile scipy and numpy
-c compile scipy and numpy
-s --system-site-packages for virtualenv
-v set -x + spew
-v set -x + spew
-h this
-h this
...
@@ -48,21 +57,45 @@ EO
...
@@ -48,21 +57,45 @@ EO
clone_repos
()
{
clone_repos
()
{
cd
"
$BASE
"
cd
"
$BASE
"
output
"Cloning mitx"
if
[[
-d
"
$BASE
/mitx"
]]
;
then
if
[[
-d
"
$BASE
/mitx/.git"
]]
;
then
mv
"
$BASE
/mitx"
"
${
BASE
}
/mitx.bak.
$$
"
output
"Pulling mitx"
cd
"
$BASE
/mitx"
git pull
>>
$LOG
else
output
"Cloning mitx"
if
[[
-d
"
$BASE
/mitx"
]]
;
then
mv
"
$BASE
/mitx"
"
${
BASE
}
/mitx.bak.
$$
"
fi
git clone git@github.com:MITx/mitx.git
>>
$LOG
fi
fi
git clone git@github.com:MITx/mitx.git
>>
$LOG
output
"Cloning askbot-devel"
cd
"
$BASE
"
if
[[
-d
"
$BASE
/askbot-devel"
]]
;
then
if
[[
-d
"
$BASE
/askbot-devel/.git"
]]
;
then
mv
"
$BASE
/askbot-devel"
"
${
BASE
}
/askbot-devel.bak.
$$
"
output
"Pulling askbot-devel"
cd
"
$BASE
/askbot-devel"
git pull
>>
$LOG
else
output
"Cloning askbot-devel"
if
[[
-d
"
$BASE
/askbot-devel"
]]
;
then
mv
"
$BASE
/askbot-devel"
"
${
BASE
}
/askbot-devel.bak.
$$
"
fi
git clone git@github.com:MITx/askbot-devel
>>
$LOG
fi
fi
git clone git@github.com:MITx/askbot-devel
>>
$LOG
output
"Cloning data"
cd
"
$BASE
"
if
[[
-d
"
$BASE
/data"
]]
;
then
if
[[
-d
"
$BASE
/data/.hg"
]]
;
then
mv
"
$BASE
/data"
"
${
BASE
}
/data.bak.
$$
"
output
"Pulling data"
cd
"
$BASE
/data"
hg pull
>>
$LOG
hg update
>>
$LOG
else
output
"Cloning data"
if
[[
-d
"
$BASE
/data"
]]
;
then
mv
"
$BASE
/data"
"
${
BASE
}
/data.bak.
$$
"
fi
hg clone ssh://hg-content@gp.mitx.mit.edu/data
>>
$LOG
fi
fi
hg clone ssh://hg-content@gp.mitx.mit.edu/data
>>
$LOG
}
}
PROG
=
${
0
##*/
}
PROG
=
${
0
##*/
}
...
@@ -81,7 +114,7 @@ if [[ $EUID -eq 0 ]]; then
...
@@ -81,7 +114,7 @@ if [[ $EUID -eq 0 ]]; then
usage
usage
exit
1
exit
1
fi
fi
ARGS
=
$(
getopt
"cvh"
"
$*
"
)
ARGS
=
$(
getopt
"cvh
s
"
"
$*
"
)
if
[[
$?
!=
0
]]
;
then
if
[[
$?
!=
0
]]
;
then
usage
usage
exit
1
exit
1
...
@@ -93,6 +126,10 @@ while true; do
...
@@ -93,6 +126,10 @@ while true; do
compile
=
true
compile
=
true
shift
shift
;;
;;
-s
)
systempkgs
=
true
shift
;;
-v
)
-v
)
set
-x
set
-x
verbose
=
true
verbose
=
true
...
@@ -123,7 +160,7 @@ cat<<EO
...
@@ -123,7 +160,7 @@ cat<<EO
To compile scipy and numpy from source use the -c option
To compile scipy and numpy from source use the -c option
STDOUT is redirected to /var/tmp/install.log, run
Most of
STDOUT is redirected to /var/tmp/install.log, run
$
tail -f /var/tmp/install.log
$
tail -f /var/tmp/install.log
to monitor progress
to monitor progress
...
@@ -211,8 +248,13 @@ esac
...
@@ -211,8 +248,13 @@ esac
output
"Installing rvm and ruby"
output
"Installing rvm and ruby"
curl
-sL
get.rvm.io | bash
-s
stable
curl
-sL
get.rvm.io | bash
-s
stable
source
$RUBY_DIR
/scripts/rvm
source
$RUBY_DIR
/scripts/rvm
rvm install
$RUBY_VER
# skip the intro
virtualenv
"
$PYTHON_DIR
"
LESS
=
"-E"
rvm install
$RUBY_VER
if
[[
-n
$systempkgs
]]
;
then
virtualenv
--system-site-packages
"
$PYTHON_DIR
"
else
virtualenv
"
$PYTHON_DIR
"
fi
source
$PYTHON_DIR
/bin/activate
source
$PYTHON_DIR
/bin/activate
output
"Installing gem bundler"
output
"Installing gem bundler"
gem install bundler
gem install bundler
...
@@ -251,23 +293,38 @@ mkdir "$BASE/log" || true
...
@@ -251,23 +293,38 @@ mkdir "$BASE/log" || true
mkdir
"
$BASE
/db"
||
true
mkdir
"
$BASE
/db"
||
true
cat
<<
END
cat
<<
END
Success!!
Success!!
To start using Django you will need
To start using Django you will need to activate the local Python
to activate the local Python and Ruby
and Ruby environment (at this time rvm only supports bash) :
environment:
$
source
$RUBY_DIR
/scripts/rvm
$
source
$RUBY_DIR
/scripts/rvm
$
source
$PYTHON_DIR
/bin/activate
$
source
$PYTHON_DIR
/bin/activate
To initialize
and start a local instance of Django:
To initialize
Django
$
cd
$BASE
/mitx
$
cd
$BASE
/mitx
$
django-admin.py syncdb --settings=envs.dev --pythonpath=.
$
rake django-admin[syncdb]
$
django-admin.py migrate --settings=envs.dev --pythonpath=.
$
rake django-admin[migrate]
$
django-admin.py runserver --settings=envs.dev --pythonpath=.
To start the Django on port 8000
$
rake lms
Or to start Django on a different <port#>
$
rake django-admin[runserver,lms,dev,<port#>]
If the Django development server starts properly you
should see:
Development server is running at http://127.0.0.1:<port#>/
Quit the server with CONTROL-C.
Connect your browser to http://127.0.0.1:<port#> to
view the Django site.
END
END
exit
0
exit
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment