-
Notifications
You must be signed in to change notification settings - Fork 52
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
vagrant to demonstrate install #57
base: master
Are you sure you want to change the base?
Changes from all commits
38b434e
cad8e16
f2d674f
bb21c75
e7deb56
30d657c
71f99b5
5f4b44a
dbc6d46
89ee9d1
925b218
007bbaf
4f4510a
07e1fb7
69a5689
12fc4ad
b62bb12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# time to build: 160 seconds | ||
|
||
$script = <<SCRIPT | ||
|
||
apt-get --assume-yes update | ||
apt-get --assume-yes install git python-virtualenv | ||
|
||
# things to do as the user (vagrant) | ||
cat <<B2 >bootstrap2.sh | ||
#!/bin/bash -x | ||
|
||
echo User vagrant is now running $0 in: | ||
pwd | ||
|
||
cd | ||
|
||
git clone https://github.com/timvideos/streaming-system.git | ||
# git clone https://github.com/CarlFK/streaming-system.git | ||
|
||
cd streaming-system/website | ||
cp private/settings.py.example private/settings.py | ||
make serve | ||
sleep 5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't really reliable... |
||
|
||
cd ../tools/register | ||
python fake_register.py --ip 127.0.0.1 & | ||
sleep 5 | ||
|
||
curl http://127.0.0.1:8000/example | ||
|
||
# eof: bootstrap2.sh | ||
B2 | ||
chown vagrant ./bootstrap2.sh | ||
chmod u+x ./bootstrap2.sh | ||
|
||
su vagrant ./bootstrap2.sh | ||
|
||
SCRIPT | ||
|
||
VAGRANTFILE_API_VERSION = "2" | ||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
|
||
config.vm.box = "precise64-current" | ||
config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box" | ||
config.vm.provision "shell", inline: $script | ||
config.vm.network "forwarded_port", guest: 8000, host: 8000, | ||
auto_correct: true | ||
|
||
config.vm.provider :virtualbox do |vb| | ||
vb.gui = false | ||
vb.customize ["modifyvm", :id, "--memory", "256"] | ||
vb.customize ["modifyvm", :id, "--cpuexecutioncap", "80"] | ||
vb.customize ["modifyvm", :id, "--cpus", "1"] | ||
end | ||
|
||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# 1013 seconds to build. (15min) | ||
|
||
$script = <<SCRIPT | ||
|
||
apt-get install -y git-core | ||
|
||
# things to do as the user (vagrant) | ||
cat <<B2 >bootstrap2.sh | ||
#!/bin/bash -x | ||
|
||
if [ -f /vagrant/streaming-system/tools/setup/runall.sh ]; then | ||
# for testing before pushing to github | ||
cp -av /vagrant/streaming-system . | ||
else | ||
git clone https://github.com/timvideos/streaming-system.git | ||
# git clone https://github.com/CarlFK/streaming-system.git | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be some type of argument? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure. |
||
fi | ||
|
||
streaming-system/tools/setup/runall.sh | ||
|
||
# eof: bootstrap2.sh | ||
B2 | ||
chown vagrant ./bootstrap2.sh | ||
chmod u+x ./bootstrap2.sh | ||
|
||
su vagrant ./bootstrap2.sh | ||
|
||
SCRIPT | ||
|
||
VAGRANTFILE_API_VERSION = "2" | ||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
|
||
config.vm.box = "precise64-current" | ||
config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box" | ||
config.vm.provision "shell", inline: $script | ||
|
||
config.vm.provider :virtualbox do |vb| | ||
vb.gui = false | ||
vb.customize ["modifyvm", :id, "--memory", "256"] | ||
vb.customize ["modifyvm", :id, "--cpuexecutioncap", "60"] | ||
vb.customize ["modifyvm", :id, "--cpus", "1"] | ||
end | ||
|
||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,8 @@ third_party: | |
|
||
src/pip-delete-this-directory.txt: requirements.txt | ||
$(ACTIVATE) && pip install -r requirements.txt | ||
$(ACTIVATE) && [ -f private/requirements.txt ] && pip install -r private/requirements.txt | ||
# $(ACTIVATE) && [ -f private/requirements.txt ] && pip install -r private/requirements.txt | ||
$(ACTIVATE) && pip install -r private/requirements.txt || true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is still wrong. The line you are removing is correct. |
||
touch -r requirements.txt src/pip-delete-this-directory.txt | ||
|
||
install: lib/python2.6/site-packages/ez_setup.py lib/python2.6/site-packages/distribute-0.6.24-py2.6.egg-info src/pip-delete-this-directory.txt frontend/data.py | ||
|
@@ -55,7 +56,10 @@ frontend/data.py: eventfeed2internal.py | |
|
||
prepare-serve: install | ||
$(ACTIVATE) && python manage.py collectstatic --noinput | ||
# $(ACTIVATE) && python manage.py syncdb | ||
# createsuperuser on a seperate line | ||
# for when vagrant skips the interactive prompting. | ||
$(ACTIVATE) && python manage.py syncdb --noinput | ||
$(ACTIVATE) && python manage.py createsuperuser || true | ||
|
||
lint: install | ||
@# R0904 - Disable "Too many public methods" warning | ||
|
@@ -85,7 +89,6 @@ upload: | |
$(ACTIVATE) && git-cl upload | ||
|
||
serve: prepare-serve install | ||
$(ACTIVATE) && python manage.py syncdb | ||
$(ACTIVATE) && python manage.py runserver | ||
$(ACTIVATE) && python manage.py runserver & | ||
|
||
.PHONY : lint upload deploy serve clean config prepare-serve |
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.
The backgrounding should occur here not in the make file.