Auto Installation

bradymiller wrote on Sunday, October 03, 2010:

hey,
Please disregard my previous message (I created a separate tracker item)

Because of the complicated nature of the current auto installation methods (for the cvs demos, developer appliance, and ubuntu packages), I leveraged Andy’s new Installer class to improve this stuff. Should also lead the way for third parties to automate their installations. Code (for review) and more details can be found here:
http://sourceforge.net/tracker/?func=detail&aid=3080582&group_id=60081&atid=1245239#

Any thoughts?

-brady

bradymiller wrote on Monday, October 04, 2010:

hey,

Updated code even more (incorporated corresponding changes to cvs development demo and also markedly simplified use of the InstallerAuto class. Gihub commit/link is here:
http://github.com/bradymiller/openemr/commit/ade455b4077f2714703f979c4c96c75f6ce391f9

Very cool, so if want to use the Auto Installer from commandline, do the following:
1) Remove exit; command from top of script contrib/util/installScripts/InstallerAuto.php
2) Then run the script from commandline (several examples below):
php -f contrib/util/installScripts/InstallerAuto.php  (this will install/configure openemr with default configuration)
php -f contrib/util/installScripts/InstallerAuto.php login=openemr pass=hwerf dbname=openemrdb (this will install/configure openemr with these settings; see the script for the settings that can be set)

To see it in use in a script setting, check out (from above github link):
contrib/util/installScripts/cvsDemoInstall
contrib/util/ubuntu_package_scripts/development/postinst

This should be very helpful for any users/maintainers that want to script installs of openemr. Plan to commit this stuff to the codebase tomorrow unless anybody notes any issues.

-brady

acmoore wrote on Monday, October 04, 2010:

Brady,

This looks great. I think I have only two minor issues:

1)  There’s a typo in your change to acl.inc. Search for “ABOVB”

2) in the insert_globals definition in Installer.class.php, can we require translation.inc.php instead of stubbing out the xl() function? I think we’re far enough along in the install process that it will work.

I’m OK with committing this. In fact, I’m very excited about it.

Thanks!
-Andy

sunsetsystems wrote on Monday, October 04, 2010:

Looks nice!  I had not noticed the Installer class before this.  Looks like setup.php should be modified to use it, to avoid all the duplicated code?

Also on 9/15 I added some code to setup.php to load an icd9.sql file if it exists and that did not seem to make it into the Installer class.  Guess I’ll fix that after the smoke clears.

Rod
www.sunsetsystems.com

bradymiller wrote on Monday, October 04, 2010:

hey,

Just committed original patch along with a follow-up patch.

Thanks for looking at the code Andy. Fixed the acl.inc typo. I tried to convert the xl() stub to translation.inc.php, but this breaks it. Likely not a scope issue since in it’s own function; I’m guessing related to a sql connection problem since this will bring in the sql.inc library also. Athe globals.inic.php script plays a dual role; during install loads the database (doesn’t need a working xl function) and when run during openemr use it build the admin->globals options (needs xl() working).

Here’s first official patch from github (exactly what you reviewed before):
http://github.com/openemr/openemr/commit/7094eff0977eda68d4daf86ac928c71e9f3dc910

Here’s a follow up patch that does the following:
1) Improved documentation in InstallerAuto.php.
2) Typo fix in acl.inc
3) Clarification of debug/error messages in Installer.class.php
4) Incorporated InstallerAuto class into ubuntu production package postinst script
http://github.com/openemr/openemr/commit/fad2ec1cdc6a1d15ca838f4e5183667929d41de6

So, sounds like all that’s left is:
1) making icd9 codes an optional dropfile (looks like Rod has potentially volunteered for this)
2) incorporate into setup.php (Andy has already mostly done this previously; just need to update it and get it working. Andy, you up for this task? If not, I could potentially take a crack at it in 1-2 weeks)

-brady

acmoore wrote on Tuesday, October 05, 2010:

Good work, Brady!
I’ll dig up my old patch to setup.php and see if I can get it cleaned up and usable.
Thanks,
-Andy

acmoore wrote on Wednesday, October 06, 2010:

Here’s a patch to make setup.php use the Installer.class:
https://sourceforge.net/tracker/?func=detail&atid=493003&aid=3082486&group_id=60081

If someone else could look it over, that would make me much more comfortable committing it.

I think it deals with the icd9 file correctly, but I’d love a second set of eyes on that part in particular. Rod?

Thanks!
-Andy

sunsetsystems wrote on Wednesday, October 06, 2010:

I have added my comments to the tracker item.  Thanks for doing this!

Rod
www.sunsetsystems.com

acmoore wrote on Friday, October 08, 2010:

I committed my updated patch from:
https://sourceforge.net/tracker/?func=detail&aid=3082486&group_id=60081&atid=493003

Are we done here, with the obvious exception of whatever bugs I introduced in all of this, which we’ll start uncovering soon?

-Andy

bradymiller wrote on Thursday, October 14, 2010:

hey,

Just committed some changes to fix the version bug and clarified some of the installation code.

Also added a really cool feature to openemr/contrib/util/installScripts/InstallerAuto.php which incorporates Rod’s multi-site code. Details of how to use this script along with examples (multisite is example number 5) can be found in openemr/contrib/util/installScripts/InstallerAuto.php. It allows creation of single and a multitude of multisite installations via simple commandline commands.

-brady

bradymiller wrote on Friday, October 15, 2010:

hey,
Committed another bug fix (bug brought in by my above fix) for the “I have already created the database” feature in setup.php . I hope this installation stuff is complete; rather coded out on this stuff.
-brady

acmoore wrote on Monday, October 18, 2010:

Thanks for all of your help on this, Brady!
-Andy