code driven development in drupal

29
Code Driven Development in Drupal ANDRIY YUN Drupal developer, Skilld

Upload: andriy-yun

Post on 21-Jan-2018

565 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Code driven development in drupal

Code DrivenDevelopment in Drupal

ANDRIY YUNDrupal developer, Skilld

Page 2: Code driven development in drupal

Processes & Workflow

Page 3: Code driven development in drupal

DB Driven Development

Page 4: Code driven development in drupal

Something’s wrong, but what?

Page 5: Code driven development in drupal

Productivity after few years

Page 6: Code driven development in drupal

The Goal

Development workflow

+Stable processes of delivery of new features for customer

-Human factor and systematic errors

Page 7: Code driven development in drupal

Deployment to prod by one click

Page 8: Code driven development in drupal

Ability to scale project team

Page 9: Code driven development in drupal

Code Driven Development

Page 10: Code driven development in drupal

What should be moved to code?

- Entity types & fields

- Panels and pages

- Roles & Permissions

- Variables

- Initial content (nodes, taxonomy terms, etc)

Use just the exportable friendly modules

- Views

- Image styles

- Text formats

- Rules

Page 11: Code driven development in drupal

How to use Features module

MANUALS- Bundling site settings using Features https://goo.gl/aijPJT

- Configuration Management with Features http://goo.gl/gat3X7

VIDEO TUTORIALS- Intorduction to Features module https://goo.gl/Jr13O5

- Drupal Features Module https://goo.gl/OQ69TW

- Strongarm module https://goo.gl/z519Wz

Page 12: Code driven development in drupal

Workflow environments

Local environments

Git repository storage (e.g. GitHub/GitLab)

Integration evironment

Build script

Page 13: Code driven development in drupal

Project lifecyclefrom scratch

Page 14: Code driven development in drupal

INITIAL STEPS

- drush dl drupal- copy/paste minimal -> custom- add base set of modules

BUILD

drush site-install customIntegration

environment

Local environment

Profile based way

Page 15: Code driven development in drupal

pre install actions- git pull- delete content file and caches

drop db

drush site install

post install actions- upload translations- import content- frontend build processes

Profile build script

building process

building process

Page 16: Code driven development in drupal

Project lifecycleafter first release

Page 17: Code driven development in drupal

SQL based way

prod_db.sql

git pulldrush updb

git pulldrush updbhook_update_N

custom_deployment.install

Page 18: Code driven development in drupal

pre update actions- git pull

drop current db

upload db from prod

drush updb

post update actions

- registry rebuild- frontend processes- clear cache

SQL build script

prod_db.sql

building process

building process

Page 19: Code driven development in drupal

prod_db.sql

Local devenvs

IntegrationStagePreliveProd

Code review Builds history Tests Sniffers Linters

building process

CodeDrivenDevelopment workflowbuilding process

Page 20: Code driven development in drupal

Typical issues

Page 21: Code driven development in drupal

Using equal environments

Prod = Stage = Integration = Local dev

Page 22: Code driven development in drupal

Code review inside the team

Developers do code review for each other

- Use common approaches for features

- Knowledge exchange inside the team

- Better quality of code

- Increase responsibility for review code

Page 23: Code driven development in drupal

DB manage approach

Use always latest prod db

Preparing prod db for use in development

Daily db backup script from prod

All enviroments should use sinle DB

Page 24: Code driven development in drupal

Profits after using CodeDrivenWorkflow

Fix errors on early phase

Reduce time for bugfixing

Minimizing the impact of the human factor

Simplified everyday deployment

Page 25: Code driven development in drupal

Deployment to prod with Code Driven Development

Page 26: Code driven development in drupal

Continuous Integration tools for Drupal

Page 28: Code driven development in drupal

Self installation solutions

CIbox

https://github.com/propeoplemd/cibox

DrupalCI

https://www.drupal.org/project/drupalci

Code Driven Starter Kithttps://bitbucket.org/deweb-studio/code-driven-starter.kit

Page 29: Code driven development in drupal

Andriy Yun, Kyiv

e-mail: [email protected]

d.org: drupal.org/u/andriyun

skype: c_cluber

Any questions?