How To Improve Your Development Workflow An Approach For Better Efficiency

  • By: Johnny Aroza
  • Date: 27-08-2018

The Drupal bangalore community came together for the July Meetup and it was quite an informative experience, with experts sharing their knowledge on some of the best practices on Drupal.

There were 3 informative sessions, one of which was on “Improving your Development workflow” by Malabya that showed how developers can improve the quality of Development by efficiently using git and by setting the local environment with Lando or Docker instead of the traditional way. He also spoke about the importance of using composer for dependency management and deployment.

Codebase

Malabya quoted very well that “if you don't use git even God cannot help”, and that's quite true for developers. In every project CODE is the backbone for any webapp and often developers waste a lot of time in just struggling to deploy and in version controlling, while GIT can help developers in version controlling without any hassle.

While maintaining a codebase, it is always better to follow these points.

  • One Codebase per application/site.
  • Tracked by a version control (Git or other version control)
  • Many deploys (dev, staging & production)

3D object

By using GIT we can have the same codebase and switch branches according to the environment.

Local Development

Developers can follow one of these approaches for local development,

  • Mamp/Xamp/Lamp
  • Vagrant/VM
  • Docker

It so often happens that developers face a lot of problems in setting up their local with ideal environment. The scene as it stands would be that the local environment set-up using Mamp/Xamp/Lamp will have issues with production, or functionality which will be working fine in local machine, but failing when deployed in server(prod/dev/stage)

How developers can improve the quality of Development by efficiently using git and by setting the local environment with Lando or Docker instead of the traditional way
tweet this

To avoid this, developers can opt for Docker or Vagrant which helps in replicating the environment as per the requirement and it's easy to customize.

For Vagrant, Developers can go for Drupal VM,Scotch Box,vagrant boxes or can create their own box according to your need. And In Docker Developers can chose between Lando,DDev,Dockersal,Wodby Docker4Drupal.

Composer Workflow

Developers can use composer to declare and install dependencies via manifest files. Drush make is an age old practice now, and it's time to adopt COMPOSER.

Composer can be used to download Drupal, Drupal contributed projects (modules, themes, etc.) and all of their respective dependencies. These instructions vary based on your approach to managing your Drupal installation.

One of the following approaches can be used for installing a drupal site using composer,

  • drupal-composer/drupal-project
  • hussainweb/drupal-composer-init
  • drupal/drupal
composer create-project drupal-composer/drupal-project:8.x-dev \
example --stability dev --no-interaction


composer require drupal/devel
composer require --dev drupal/devel
composer install --no-dev
composer require cweagans/composer-patches
"extra": {
  "patches": {
    "drupal/devel": {
      "2860796: Create a branch of devel compatible with Media in core": "https://www.drupal.org/files/issues/2860796-2.patch"
    }
  }
}
composer update drupal/devel
composer remove drupal/devel
composer config platform.php 7.1

Deployment

Deployment becomes a piece of cake when developers use Git. All the configurations stays in one code base and it is recommended to have the config folder outside the Drupal root.

Gitignore plays an important role, and it is better to have the following files/directory in gitignore,

  • Core directory
  • Contributed modules
  • Contributed themes
  • Contributed themes
  • Contributed profiles
  • CSS files
  • Vendor

By having these files in gitignore, git diff files will be smaller in size, easier to review and quite impossible to hack the core.

Deployment Process

Manual deployments are error prone. This is because it involves humans doing stuff,if developer is lucky he can recover. This job can fall to developers and testers in a development team who would otherwise be spending their time producing the next set of awesome features and improvements to the software.

Developments team can have automation in deployment.Implementing automation needs some basic configuration and then you are all set for the automation deployment. If your using Slack u can use configure to get the notification.

There are lot of Automated Deployment Tools available you can chose them according to your requirement ,some of them listed here,

  • Jenkins
  • AWS CodeDeploy
  • CircleCI
  • Travis CI
  • BuildBot

These Continuous tools reduce lot of time and makes the deployment process easy.

Deployment Process commands

git pull origin master
composer install
drush update-database -y
drush config-import -y
drush cache-rebuild

Subscribe For Our Newsletter And Stay Updated

Recent blogs

thunder for drupal
Digital evolution has taken the world of professional publishing by storm. However, this evolution brought along a whole new set of...
higher education
Over the past 2 decades, the advancements in technology have been tremendous and these changes have played a major role in allowing...
DrupalCamp 2018
“Everyone you will ever meet knows something you don’t” - said Bill Nye popularly known as The Science Guy, who (coincidentally)...

Explore Our Drupal Services

Take me there

This website uses cookies to offer you an enhanced website experience. We collect information about how you interact with our website to provide personalized services to you. To find out more, see our Privacy Policy

×