Difference between revisions of "Amahi Edge"

From Amahi Wiki
Jump to: navigation, search
 
(43 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Amahi Edge Working Notes
+
{{MessageBox|
 +
backgroundcolor = #faa|
 +
image =Warning.png|
 +
heading =WARNING|
 +
message = Amahi 7 for Fedora 19<br />Maintenance Support ONLY!}}
 +
Amahi "edge" is the developer version of Amahi, with the very latest and greatest code in it.
  
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.
+
It lives in the master branch of the Amahi git repo at https://github.com/amahi/platform
 +
 
 +
This page is about working notes for the latest in the development tree.
  
 
= How to Get Amahi Edge Running =
 
= How to Get Amahi Edge Running =
 +
 +
This procedure is the way to get Amahi 7 running in development. This has been tested with a clean Fedora 19 minimal install from the netinst DVD (generally without updates), though it can be done on Mac OS X as well:
 +
 +
# open a terminal window
 +
# If you are running Fedora, do this as Root (<code>su</code>):
 +
##enter the root password (not the one from the first user)
 +
##<code>yum groupinstall 'Development Tools'</code>, or for a shorter install do:
 +
##* <code>yum -y install make git mysql-devel sqlite-devel mysql-server gcc-c++ tar rpm-build</code>
 +
##* <code>yum -y install ruby ruby-devel libxml2-devel libxslt-devel</code>
 +
##<code>systemctl start mysqld.service</code>
 +
## <code>gem install bundler</code>
 +
# exit the root user and use a regular user. you will need to reinstall fedora if you skip this step :(
 +
# if you are running on Mac OS X, install git, mysql, probably homebrew as well
 +
# we suggest you create a new folder to put the amahi development code, then in it run:
 +
# <code>git clone git@github.com:amahi/platform.git</code>
 +
# <code>cd platform</code>
 +
# <code>bundle install</code>            (this will take a while and install all the necessary gems)
 +
# <code>rake db:create</code>            this will ask for the mysql root password with a prompt ">"
 +
#* if this is a fresh Fedora 18 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
 +
# <code>rake db:migrate</code>          (this will get the database up to snuff)
 +
# <code>rake db:seed</code>            (this will get a basic database setup)
 +
# rails s                            (this will start the rails server)
 +
 +
The development dashboard can be reached with your favorite browser at:
 +
 +
  <code>http://localhost:3000</code>
 +
 +
There is an initial user created called <code>admin</code> with password <code>admin</code>. Login should work out of the box.
 +
 +
To stop the development server, just hit <code>Ctrl+C</code> in the terminal where you started the server.
 +
 +
== Running Tests ==
 +
 +
A great way to contribute is to write tests. The spec tests are in the <code>spec/</code> 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, obsolete info for Amahi 6 =
  
 
First you need to get the latest git repository (see how on the [[Contribute]]-page)
 
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-6-devel branch (and tell git to follow it on the remote server):
+
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):
  
<code>git checkout amahi-6-devel</code>
+
<code>git checkout amahi-edge</code>
  
The amahi-6-devel 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:
+
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 <code>/path/to/git/clone/platform/platform</code>
 
* Go to <code>/path/to/git/clone/platform/platform</code>
* Execute <code>./hda-create-db-and-user amahi_6_devel</code>
+
* Execute <code>./hda-create-db-and-user amahi_devel</code>
 
* Go to <code>/path/to/git/clone/platform/platform/html/script</code>
 
* Go to <code>/path/to/git/clone/platform/platform/html/script</code>
* Execute <code>./db-duplicate hda_production amahi_6_devel</code>
+
* Execute <code>./db-duplicate hda_production amahi_devel</code>
 
* Go to <code>/path/to/git/clone/platform/platform/html</code>
 
* Go to <code>/path/to/git/clone/platform/platform/html</code>
 
* Execute <code>rake db:migrate</code>
 
* Execute <code>rake db:migrate</code>
  
Now we have a working amahi-6-devel branch which can be used to develop features, gadgets, widgets and fix bugs.
+
Now we have a working amahi-edge branch which can be used to develop features, gadgets, widgets and fix bugs.
 
 
To reach the amahi-6-devel branch you need to go to <code>/path/to/git/clone/platform/platform/html</code> and execute
 
 
 
<code>./script/server amahi_6_devel</code>
 
  
The development dashboard can be reached with your favorite browser using the link <code>http://ip.addr.of.dev:3000</code>
+
To reach the amahi-edge branch you need to go to <code>/path/to/git/clone/platform/platform/html</code> and execute
  
To stop the development server, just hit <code>Ctrl+C</code> in the terminal where you started the server.
+
<code>./script/server</code>
  
 
= How to install one Gadget =
 
= How to install one Gadget =
Line 44: Line 95:
 
= Tips =
 
= Tips =
  
* Start with VM with snapshots. Take a snapshot of your VM to begin, in case you have to revert
+
* 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!)
 
* 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 [http://forums.amahi.org/viewforum.php?f=41 virtualization], in case you're looking for some input in that area.

Latest revision as of 00:57, 15 September 2015

Warning.png WARNING
Amahi 7 for Fedora 19
Maintenance Support ONLY!


Amahi "edge" is the developer version of Amahi, with the very latest and greatest code in it.

It lives in the master branch of the Amahi git repo at https://github.com/amahi/platform

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. This has been tested with a clean Fedora 19 minimal install from the netinst DVD (generally without updates), though it can be done on Mac OS X as well:

  1. open a terminal window
  2. If you are running Fedora, do this as Root (su):
    1. enter the root password (not the one from the first user)
    2. yum groupinstall 'Development Tools', or for a shorter install do:
      • yum -y install make git mysql-devel sqlite-devel mysql-server gcc-c++ tar rpm-build
      • yum -y install ruby ruby-devel libxml2-devel libxslt-devel
    3. systemctl start mysqld.service
    4. gem install bundler
  3. exit the root user and use a regular user. you will need to reinstall fedora if you skip this step :(
  4. if you are running on Mac OS X, install git, mysql, probably homebrew as well
  5. we suggest you create a new folder to put the amahi development code, then in it run:
  6. git clone git@github.com:amahi/platform.git
  7. cd platform
  8. bundle install (this will take a while and install all the necessary gems)
  9. rake db:create this will ask for the mysql root password with a prompt ">"
    • if this is a fresh Fedora 18 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
  10. rake db:migrate (this will get the database up to snuff)
  11. rake db:seed (this will get a basic database setup)
  12. 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.

Running 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, obsolete 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.