Skip to content

AleksNesh/pandora

Padoramoa.com (Pandora Charms at MOA)

Git Flow

This project makes use of the git-flow branching model. Please make sure you are familiar with git-flow before you continue work on this project. For the best introduction to getting started with git-flow, please read Jeff Kreeftmeijer's blog post.

Installing git-flow

Mac OS

If you are using a Mac, you should be using homebrew and setup is simple:

$ brew install git-flow

Linux

For Linux users, the easiest way to install is using Rick Osborne's git-flow installer script. Run the following command:

$ wget --no-check-certificate -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo bash

Windows

Please don't do web development on a Windows machine. :) For help, check out the git-flow Github repository for additional instructions.

Shell Integration

For users of the Bash or ZSH shells, there is some great work on the git-flow-completion project by bobthecow. It offers tab-completion for all git-flow sub-commands and branch names.

Project Setup

To get started working on PandoraMOA.com, first clone the development repository:

$ git clone -b develop git@github.com:pandoramoa.com/pandoramoa.com.git

This will check out the default develop branch. This branch is used for current development and staging environments. To be able to deploy production releases you will need to also have a copy of the master branch on your system. Grab and a tracking branch of master:

$ cd pandoramoa.com/
$ git branch --track master origin/master

Now that you have a local repository you have to make sure you initialize git-flow as it isn't done for you. Make sure to select the default values at the prompts:

$ git flow init

You should now be all ready to start creating new features.

SASS (Bourbon/Neat/Bitters)

UPDATE:

The project now uses the Bundler ruby gem to manage gem dependencies for this project while doing local development. You'll need to install the bundler gem like so:

$ gem install bundler

The bundler gem will use the Gemfile in this project's root directory to install and manage gems needed for the local development and deployment of this project.

Run the following command to install all of the project's ruby gems required for the project:

$ bundler install

To update the installed gems after making modifications to the Gemfile:

$ bundler update

Once you have ran the bundle install command you are ready to go.

The Build a Bracelet (Jewelry Designer) feature is an AngularJS app embedded within Magento so it won't follow all of the Magento conventions for fallback hierarchy or theming. The Build a Bracelet (Pan_JewelryDesigner) templates and theme files will be self-contained within the app/code/local/Pan/JewelryDesigner directory. The AngularJS app makes use of the Bourbon, Bourbon Neat, and Bitters SASS libraries instead of raw CSS.

UPDATE #2:

The Jewelry Designer feature now uses Gulp, Node (and npm - the node package manager), and Bower to manage the Angular app's modules, sass compiling and css/js concatenation and compacting. Once you have all three installed, you will need to go to app/code/local/Pan/JewelryDesigner and run npm install to install any necessary packages that the project relies upon.

Use Gulp to watch for SASS or Javascript file changes to keep your assets up-to-date.

# Example: sass --watch input-dir:output-dir
$ cd app/code/local/Pan/JewelryDesigner
$ npm install
$ gulp

Local Development

Before you can run the site locally to test development, here are the basic steps required to run locally (this assumes local development on a Mac):

1. Ensure you have a usable .htaccess file:
$ cp -f htaccess.dist .htaccess
2. Change permissions on files/directories
$ chmod -R 777 var/ media/
$ chmod +x mage
3. Setup your hosts file with a local development domain and add 127.0.0.1 pan.dev
$ sudo vim /etc/hosts
4. Create an Apache2 virtual host that will respond to pan.dev
5. Reload your local webserver:
$ sudo apachectl graceful
6. Setup cron
$ crontab -e
$ */6 * * * * /usr/bin/curl -s -o /dev/null http://pan.dev/cron.php

Deployment

This project is deployed via a Ruby tool called Capistrano (v2). It also makes use of a custom extension provided by capistrano-ash.

Dependencies

These gems are required for deployment and must be installed prior to a successful deploy:

  • capistrano-ash

Push Code Live

The command to push code to a specific environment is very easy and is a single line:

$ cap staging deploy
$ cap production deploy