wiki:DevEnvBuildNotes

Version 3 (modified by Fran Boon, 9 years ago) ( diff )

--

Build Notes

Configure Virtual Machine

Create a new virtual machine; configure for 1 processor, 512GB RAM, 20GB monolithic elastic hard drive. Install TurnKey Core Lucid 11.0.

Initial bash Script

Automate as much as possible with a bash script called install-dev-env. Use sftp client and upload to new machine; login to the machine and chmod +x install-dev-env. Execute the script with ./install-dev-env, for example.

#!/bin/bash -ex
#set hostname
HOSTNAME=eden-dev
echo "$HOSTNAME" > /etc/hostname
sed -i "s|127.0.1.1 \(.*\)|127.0.1.1 $HOSTNAME|" /etc/hosts
#install
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y \
    -o DPkg::Options::=--force-confdef \
    -o DPkg::Options::=--force-confold \
    install lxde irssi sudo python-lxml python-reportlab python-xlwt python-shapely bzr libgeos-3.1.0 eclipse xorg firefox firebug
#install python-tweepy
echo -e "deb http://ppa.launchpad.net/chris-lea/python-tweepy/ubuntu lucid main \n
deb-src http://ppa.launchpad.net/chris-lea/python-tweepy/ubuntu lucid main" >> /etc/apt/sources.list.d/sources.list 
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C7917B12
apt-get update
apt-get install python-tweepy -y
#addusers and groups
useradd web2py
addgroup admin
useradd -G web2py,admin -m -p eden dev
#bzr web2py and eden
bzr branch -r 2717 lp:~mdipierro/web2py/devel /home/web2py/
bzr branch -r 1585 lp:sahana-eden /home/web2py/applications/eden
#Set up web2py service
cp /home/web2py/scripts/web2py.ubuntu.sh /etc/init.d/web2py
chmod +x /etc/init.d/web2py
update-rc.d web2py defaults
#Copy Deployment-Templates
cp /home/web2py/applications/eden/deployment-templates/models/000_config.py /home/web2py/applications/eden/models/000_config.py
cp /home/web2py/applications/eden/deployment-templates/cron/crontab /home/web2py/applications/eden/cron/crontab
#Change ownership for web2py
chown -R web2py:web2py /home/web2py
#Setup BZR Pull Script for web2py
echo "#! /bin/bash -ex \n cd /home/web2py \n if [ -z "$1" ]; then \n bzr pull \n else bzr pull $1 \N fi" > /home/dev/update_web2py
chmod +x /home/dev/update_web2py
#setup BZR Pull Script for Eden
echo "#! /bin/bash -ex \n cd /home/web2py/applications/eden \n if [ -z "$1" ]; then \n bzr pull \n else bzr pull $1 \N fi" > /home/dev/update_eden
chmod +x /home/dev/update_eden

The some of the rest could be scripted using sed; it has not been. Looking for a way to automate configuration of Eclipse.

Set Web2py as Service

Change daemon directory to /home/$name and change user to root in /etc/init.d/web2py; add -i 0 127.0.0.1 to arguments.

vim /etc/init.d/web2py

Customize Configuration Console

Add web2py, http://$ipaddr:8000 and add Eden, http://$ipaddr:8000/eden to the services list:

vim /etc/confconsole/services.txt

Configure 000_config.py

Set edited to True (case sensitive):

vim /home/web2py/applications/eden/models/000_config.py

Configure the Dev Env

shutdown -r now

Login as dev (password eden)

startx

Configure Firefox

Start Firefox. Check http://localhost:8000/eden to ensure Eden works.

In Firefox, set Eden as homepage.

Set bookmarks.

Configure irssi

Open terminal. Start irssi

In irssi, enter the following (docs here):

/SERVER ADD -auto freenode irc.freenode.net 6667
/NETWORK ADD freenode
/CHANNEL ADD -auto #sahana-eden freenode

Configure Eclipse

Configure Eclipse according to docs here.

Note: See TracWiki for help on using the wiki.