WG/OBIT/Creating A Develpment Environment for groups version 2

Setting Up Local Environment
In order to set up a local environment, you'll probably want a LAMP, WAMP or MAMP server setup installed. You will likely find the most flexibility using LAMP. You could use this quickstart guide. If you do not have a server setup on your local computer, someone from OBIT will be happy to help you get this installed and configured.

The rest of these instructions assume that you have a working server and the ability to create domains on your local machine.

Creating A Drupal Instance
$ mkdir dev2groups; cd dev2groups $ ln -s /path/to/drupal-7/* ./ $ ln -s /path/to/drupal-7/.htaccess ./ $ ln -s /path/to/drupal-7/.gitignore ./ $ mv sites notsites $ mkdir sites $ cp -r notsites/* sites/ NOTE: If your distribution of drupal does not contain the .gitignore file, please create that file with the following contents. sites/*/settings*.php
 * Download and extract the most recent version of drupal. http://drupal.org
 * Make a directory for your web root.
 * Create links to your drupal files
 * 1) Ignore configuration files that may contain sensitive information.

sites/*/files sites/*/private $ mysql -uMYSQLUSER -p mysql> create database dev2_drup; mysql> exit; $ git init $ git remote add dev ssh://obv2dev@attucks.mayfirst.org/home/members/occupyboston/sites/v2dev.groups.occupyboston.org/include/site_hub/ $ git fetch dev $ git merge dev/master $ cp sync.v2devgroups.example sync.v2devgroups $ gedit sync.v2devgroups
 * 1) Ignore paths that contain user-generated content.
 * Create a mysql database
 * Install drupal by opening your web browser and going to http://mysite.local (or whatever you named your domain).
 * Clone the git repository using the following set of commands from your local web root directory
 * Copy and edit the sync script in the ./dev directory.
 * Change the following lines by adding your database name, database user name and database password:

local_db=YOUR_DATABASE_NAME local_db_user=YOUR_DB_USERNAME local_db_pass=YOUR_DB_PASSWORD

$ ./dev/sync.v2devgroups
 * Save the file
 * Sync the database and files. From the root web directory run:

Making Changes
At this point you should have a working local development environment synced to the remote development website. Most of the changes we will make to the site will occur in our git repository. Once you have made changes you want everyone to have access to, you'll need to add those changes to the git repository. Some helpful commands:

$ git status NOTE: You may see some untracked files when running this command that should remain untracked. We do not want core drupal files in the git repository, only files in the sites/all or sites/libraries directories. $ git pull dev master $ git add PATH/TO/FILENAME $ git commit -am"Describe why you made the changes" $ git push dev
 * See current status
 * Sync up the repository
 * Add new files to the repository
 * Commit your changes -- In order to tell the server there are changes you need to commit them to the repository.
 * Push your changes to the dev server. When you issue the following command your changes will be active on the development website