Difference between revisions of "Amahi Edge"

From Amahi Wiki
Jump to: navigation, search
Line 17: Line 17:
 
##<code>systemctl start mysqld.service</code>
 
##<code>systemctl start mysqld.service</code>
 
## <code>gem install bundler</code>
 
## <code>gem install bundler</code>
# download the latest tarball or get the latest git repo code
+
# download the [https://dl.dropbox.com/u/364883/Amahi/121014-amahi-7.tar.bz2 latest tarball] or get the latest git repo code
 
# extract the tarball into your user folder use tar or your file manager-extract function
 
# extract the tarball into your user folder use tar or your file manager-extract function
 
# <code>cd ~/amahi-7</code>
 
# <code>cd ~/amahi-7</code>

Revision as of 22:19, 14 October 2012

Amahi Edge is the developer version of Amahi, with the very latest and greatest code in it. It lives in a branch of the Amahi Git repo, called

  amahi-edge

This page is about working notes for the latest in the development tree.

How to Get Amahi Edge Running

This procedure is the way to get Amahi 7 running in development. It assumes you have a clean Fedora 17 install (without updates):

  1. open a terminal window
  2. as Root (su):
    1. enter the root password (not the one from the first user)
    2. yum groupinstall 'Development Tools'
    3. yum install ruby ruby-devel git libxml2-devel libxslt-devel mysql-devel sqlite-devel mysql-server
    4. systemctl start mysqld.service
    5. gem install bundler
  3. download the latest tarball or get the latest git repo code
  4. extract the tarball into your user folder use tar or your file manager-extract function
  5. cd ~/amahi-7
  6. bundle install (this will install all the necessary gems)
  7. rake db:create this will ask for the mysql root password with a prompt ">"
    • if this is a fresh Fedora 17 install, your mysql server probably does not have a password, so just press Enter
    • if you set a password for the mysql root user, type it. Note that it will show a warning and echo the password!
    • if you are re-running this step and the db is already created, you can run rake db:drop first then create it again
  8. rake db:migrate (this will get the database up to snuff)
  9. rake db:seed (this will get a basic database setup)
  10. rails s (this will start the rails server)

The development dashboard can be reached with your favorite browser at:

  http://localhost:3000

There is an initial user created called admin with password admin. Login should work out of the box.

To stop the development server, just hit Ctrl+C in the terminal where you started the server.

hdactl packages

The next step is getting hdactl running. Here are two binaries, compiled on Fedora 17, for 32bits and 64bits.


Runing Tests

A great way to contribute is to write tests. The spec tests are in the spec/ directory. To run them:

    rake spec

It will show you one dot per test passing. It will show test fails with F and display the error.

You may need to

    yum install rubygem-minitest

to get things to run properly for some reason that we did not root cause yet.

Old info for Amahi 6

First you need to get the latest git repository (see how on the Contribute-page)

After you've got the latest master branch you need to switch to the amahi-edge branch (and tell git to follow it on the remote server):

git checkout amahi-edge

The amahi-edge code uses a different database for it's data so we need to create one, copy the production data in it and migrate it to the new datamodel:

  • Go to /path/to/git/clone/platform/platform
  • Execute ./hda-create-db-and-user amahi_devel
  • Go to /path/to/git/clone/platform/platform/html/script
  • Execute ./db-duplicate hda_production amahi_devel
  • Go to /path/to/git/clone/platform/platform/html
  • Execute rake db:migrate

Now we have a working amahi-edge branch which can be used to develop features, gadgets, widgets and fix bugs.

To reach the amahi-edge branch you need to go to /path/to/git/clone/platform/platform/html and execute

./script/server

How to install one Gadget

If you have developed a new gadget or fixed some bugs on an existing one you can install it using:

  • Go to /path/to/git/clone/platform/platform/html
  • Execute rake gadgets:install source=/path/to/the/gadget/source, e.g.
         rake gadgets:install source=../../gadgets/gadget_last_modified_files

When there are errors after installing the gadget you can uninstall it using:

  • Go to /path/to/git/clone/platform/platform/html
  • Execute rake gadgets:uninstall source=/path/to/the/gadget/source

Tips

  • Start with virtual machine snapshots. Take a snapshot of your VM at the beginning, in case you have to revert, and take a snapshot as you progress through milestones.
  • If you do not have a VM, take a snapshot of your development database. You can use ./script/db-duplicate and ./script/db-restore (use with care!)
  • Don't forget, the Amahi forum has a section for virtualization, in case you're looking for some input in that area.