build Magento and a CRM using nodejs and gulp

Since a while already am I looking for a good solution to build a Magento Webshop, a WordPressa blog, suitecrm, some Java Application and some scripts for Import / Export and other things to a e-commerce infrastruture.

In the past I´ve been playing around with some php tools because magento and suitecrm are written in php . Personally I don´t like PHP too much and prefer anything that´s more simple and concise, does not use '$' for variables and ideally runs in a JVM  😉
This aside my experience with most php tools was not so great and the only ones I kept using are n98magerun and modman.

I also used ANT for a while because I know it and it´s nicely intergated in Eclipse and OSX but it allows no easy logic without big efforts or using bash scripts. A pro pos bash scripts, that´s the poor "solution" I am working with right now. I also had a short look at gradle because it´s used in Grails which I really like and it allows logic but a lack of time made me burry this plan.

But recently I came into contact with nodejs and related tools through a colleague and these neat javascript tools immediatelly got my attention. It´s been eight years since I really used Javascript in a project and back then it was Dojotoolkit which was the best I ever experienced with javascript so far. A lot happened on the Javascript front and I thought if nodejs might be a good solution (and allow me to learn nodejs)… ?!?

Reading this blog showed me that I am not the first person with this idea and gives a lists of toole that might be helpful.

So I in this article I will write down my notes and eventually add some code to github. We´ll see..

 

Requirements

Functional

  • install a given magento version
  • install a given suiteCRM version
  • run database scripts against the installation
  • adjust databse settings to values read from config files
  • install release changes and run configuration scripts for the change (e.g. for Magento admin setitngs or database changes)
  • create diffs between database versions and keep track of important changes (e.g. ignore logging)
  • allow to create and install new releases (diffs)
  • create backups of all or some data
  • run selenium integration tests against the installation(s)
  • install a certain version as testinstallation in a given local / remote system

Technical

  • The tool/language of choice should ideally be available on all machines but must run on osx (a big plus for php)
  • The tool/language should be known and liked by myself 😉 (a big minus for php)
  • It must run stable with no overhead of xml/json/yaml/whatever files
  • It preferrably integrates with Jenkins

Project

After playing around with nodejs and getting a first impression of the ecosystem, I must say it´s fun to work with javascript again.
I played around a bit and installed Magento using npm modules like tarball-extract, execsql and others. After having a basic idea of nodejs and nm modules and searching for build tools I found out about gulp, which I will give a try as my build system. It seems that the most tasks I need are already included in gulp and will keep me from reinventing the wheel.

Configuration

I found the npm module config which allows hierarchical configuration with property-overrides. That´s what I´ll

Configuring the build

As I want to be able to deploy to different envurinments with different settings I will need som kind of configuration files. I did only have a quick look at the gulp plugins but none seemed to do what I need, so I will keep using the npm module 'config' for configuration. It allows hierachical configuration with overwrites and is easy to use.

You can provide a default.json in confog folder and overwrite these proeprties with environment specific settings, e.g. in a env1.json file in the same directory.
Check the documentation for further infos

Installing Magento

Magento will be kept as a tarball in the resources folder and extracted to a target directory on each build. This might be cached later on, but lets keep it simple for now.
It was not too hard using tarball-extract but witj gulp it´s even easier.

Magento Setup

Magento can be installed through commandline using the install.php file. This file is called through an execSync command which takes the environment configuration parameters.

Open Magento in Browser

When we installed Magento it might be handy to open the webshop in a browser.

 

 

 

 

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.