Skip to content

Instantly share code, notes, and snippets.

@georgetye
Forked from bradymiller/refresh
Last active March 26, 2017 23:39
Show Gist options
  • Save georgetye/07f896bc7e490a2cca355cc30fc2f34a to your computer and use it in GitHub Desktop.
Save georgetye/07f896bc7e490a2cca355cc30fc2f34a to your computer and use it in GitHub Desktop.
OSX script to prepare a github repository for testing the OpenEMR Development tip
#!/bin/bash
#
# Copyright (C) 2014 Brady Miller <brady@sparmy.com>
# Forked 2017 by George Tye
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# Ubuntu script to prepare a github repository for testing. This is
# specifically to allow quick testing of new code, and is not for
# production use.
#
# This script will copy the current checked git repository into
# the web directory (and remove the currently installed openemr).
# Place this script in the git directory (one level above the openemr
# directory).
# Note you need to install openemr with the mysql user 'openemr' and
# the mysql database 'openemr' for this script to completely remove
# OpenEMR.
# Also note the root mysql password needs to be blank for the mysql
# and mysqladmin commands to work.
#
# This script can also be used on your cvs checkout if you place it in
# the cvs directory (one directory above openemr)
#
# Remove current test copy of openemr
sudo rm -fr /Applications/XAMPP/xamppfiles/htdocs/openemr
#Allows mysql commands to run on OSX. Only needs to be run once, but I'm just leaving it here so that first-timers don't get confused.
ln -s /applications/xampp/xamppfiles/var/mysql/mysql.sock /tmp/mysql.sock
# Remove current openemr mysql database
sudo mysqladmin -f -h localhost -u root drop openemr
# Remove current openemr mysql user
sudo mysql -f -u root -h localhost -e "DELETE FROM mysql.user WHERE User = 'openemr';FLUSH PRIVILEGES;"
# Copy the new openemr version to the web directory (note need to ignore the .git directory)
sudo rsync --recursive --links --exclude .git openemr/* /Applications/XAMPP/xamppfiles/htdocs/openemr/
# modify permissions
sudo chmod -R a+w /Applications/XAMPP/xamppfiles/htdocs/openemr/sites/default/documents
sudo chmod -R a+w /Applications/XAMPP/xamppfiles/htdocs/openemr/sites/default/edi
sudo chmod -R a+w /Applications/XAMPP/xamppfiles/htdocs/openemr/sites/default/era
sudo chmod -R a+w /Applications/XAMPP/xamppfiles/htdocs/openemr/sites/default/letter_templates
sudo chmod a+w /Applications/XAMPP/xamppfiles/htdocs/openemr/sites/default/sqlconf.php
sudo chmod a+w /Applications/XAMPP/xamppfiles/htdocs/openemr/sites/default/config.php
sudo chmod a+w /Applications/XAMPP/xamppfiles/htdocs/openemr/interface/modules/zend_modules/config/application.config.php
sudo chmod -R a+w /Applications/XAMPP/xamppfiles/htdocs/openemr/gacl/admin/templates_c
sudo chmod -R a+w /Applications/XAMPP/xamppfiles/htdocs/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/cache
sudo chmod -R a+w /Applications/XAMPP/xamppfiles/htdocs/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/compiled
# Restart the mysql server
sudo mysql.server restart
# Copy the apache conf script, turn it on, and restart the apache server (uncomment below if have apache openemr.conf file and want to test)
# sudo cp openemr.conf /etc/apache2/sites-available/
# sudo a2ensite openemr.conf
# sudo service apache2 restart
@georgetye
Copy link
Author

Isn't working yet

@bradymiller
Copy link

change all /Users/$USER/openemr to the openemr path in testing xampp directory.

@bradymiller
Copy link

otherwise, you will just be deleting your git openemr repo :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment