| 1 | [[TOC]] |
| 2 | |
| 3 | = Build Notes = |
| 4 | |
| 5 | == Configure Virtual Machine == |
| 6 | Create a new virtual machine; configure for 1 processor, 512GB RAM, 20GB monolithic elastic hard drive. Install [http://sourceforge.net/projects/turnkeylinux/files/turnkey-core/ TurnKey Core Lucid 11.0]. |
| 7 | == Initial bash Script == |
| 8 | 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. |
| 9 | |
| 10 | {{{ |
| 11 | #!/bin/bash -ex |
| 12 | #set hostname |
| 13 | HOSTNAME=eden-dev |
| 14 | echo "$HOSTNAME" > /etc/hostname |
| 15 | sed -i "s|127.0.1.1 \(.*\)|127.0.1.1 $HOSTNAME|" /etc/hosts |
| 16 | #install |
| 17 | apt-get update |
| 18 | DEBIAN_FRONTEND=noninteractive apt-get -y \ |
| 19 | -o DPkg::Options::=--force-confdef \ |
| 20 | -o DPkg::Options::=--force-confold \ |
| 21 | install lxde irssi sudo python-lxml python-reportlab python-xlwt python-shapely bzr libgeos-3.1.0 eclipse xorg firefox firebug |
| 22 | #install python-tweepy |
| 23 | echo -e "deb http://ppa.launchpad.net/chris-lea/python-tweepy/ubuntu lucid main \n |
| 24 | deb-src http://ppa.launchpad.net/chris-lea/python-tweepy/ubuntu lucid main" >> /etc/apt/sources.list.d/sources.list |
| 25 | apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C7917B12 |
| 26 | apt-get update |
| 27 | apt-get install python-tweepy -y |
| 28 | #addusers and groups |
| 29 | useradd web2py |
| 30 | addgroup admin |
| 31 | useradd -G web2py,admin -m -p eden dev |
| 32 | #bzr web2py and eden |
| 33 | bzr branch -r 2717 lp:~mdipierro/web2py/devel /home/web2py/ |
| 34 | bzr branch -r 1585 lp:sahana-eden /home/web2py/applications/eden |
| 35 | #Set up web2py service |
| 36 | cp /home/web2py/scripts/web2py.ubuntu.sh /etc/init.d/web2py |
| 37 | chmod +x /etc/init.d/web2py |
| 38 | update-rc.d web2py defaults |
| 39 | #Copy Deployment-Templates |
| 40 | cp /home/web2py/applications/eden/deployment-templates/models/000_config.py /home/web2py/applications/eden/models/000_config.py |
| 41 | cp /home/web2py/applications/eden/deployment-templates/cron/crontab /home/web2py/applications/eden/cron/crontab |
| 42 | #Change ownership for web2py |
| 43 | chown -R web2py:web2py /home/web2py |
| 44 | #Setup BZR Pull Script for web2py |
| 45 | 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 |
| 46 | chmod +x /home/dev/update_web2py |
| 47 | #setup BZR Pull Script for Eden |
| 48 | 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 |
| 49 | chmod +x /home/dev/update_eden |
| 50 | }}} |
| 51 | |
| 52 | The rest could be scripted using sed; it has not been. |
| 53 | |
| 54 | == Set Web2py as Service == |
| 55 | |
| 56 | 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. |
| 57 | |
| 58 | {{{ |
| 59 | vim /etc/init.d/web2py |
| 60 | }}} |
| 61 | |
| 62 | == Customize Configuration Console == |
| 63 | Add web2py, http://$ipaddr:8000 and add Eden, http://$ipaddr:8000/eden to the services list: |
| 64 | |
| 65 | {{{ |
| 66 | vim /etc/confconsole/services.txt |
| 67 | }}} |
| 68 | |
| 69 | == Configure 000_config.py == |
| 70 | Set edited to True (case sensitive): |
| 71 | |
| 72 | {{{ |
| 73 | vim /home/web2py/applications/eden/models/000_config.py |
| 74 | }}} |
| 75 | |
| 76 | == Configure the Dev Env == |
| 77 | |
| 78 | |
| 79 | {{{ |
| 80 | shutdown -r now |
| 81 | }}} |
| 82 | |
| 83 | Login as dev (password eden) |
| 84 | |
| 85 | {{{ |
| 86 | startx |
| 87 | }}} |
| 88 | |
| 89 | === Configure Firefox === |
| 90 | Start Firefox. Check http://localhost:8000/eden to ensure Eden works. |
| 91 | |
| 92 | In Firefox, set Eden as homepage. |
| 93 | |
| 94 | Set bookmarks. |
| 95 | |
| 96 | === Configure irssi === |
| 97 | |
| 98 | |
| 99 | Open terminal. Start irssi |
| 100 | |
| 101 | In irssi, enter the following (docs [http://irssi.org/documentation/startup#c3 here]): |
| 102 | |
| 103 | {{{ |
| 104 | /SERVER ADD -auto freenode irc.freenode.net 6667 |
| 105 | /NETWORK ADD freenode |
| 106 | /CHANNEL ADD -auto #sahana-eden freenode |
| 107 | }}} |
| 108 | |
| 109 | === Configure Eclipse === |
| 110 | Configure Eclipse according to docs [http://eden.sahanafoundation.org/wiki/DeveloperGuidelinesEclipse here]. |