easy drupal project deployment with features module & drush

32
Easy Drupal Project Deployment With Features Module & Drush 1

Upload: qarea

Post on 13-Jul-2015

91 views

Category:

Technology


3 download

TRANSCRIPT

Easy Drupal Project Deployment With Features Module & Drush

1

• Drupal is way more stable and reliable than any other CMS

• Drupal is easier to scale• Drupal developers are more tech savvy • If it’s good enough for a White House page it has

to be of the best

2

1. Why Drupal?

2. Issues that can be faced using Drupal

Your logic is stored both in code and DB It is not integral Multiple developpers involved in development

3

3. How does Features module help?

3.1. What is the Features module?3.2. What can be exported using Features module?3.3. Features API

4

3.1. What is the Features module?

Feature Home Page: http://goo.gl/vMpBtW

The features module enables the capture and management of features in Drupal. A feature is a collection of Drupal entities which taken together satisfy a certain use-case.

5

3.1. What is the Features module?

Features provides a UI and API for taking different site building components from modules with exportables and bundling them together in a single feature module. A feature module is like any other Drupal module except that it declares its components (e.g. views, contexts, CCK fields, etc.) in its .info file so that it can be checked, updated, or reverted programmatically. (src: http://goo.gl/vMpBtW)

6

3.1. What is the Features module?

Examples:• A blog• A pressroom• An image gallery• An e-commerce t-shirt store(src: http://goo.gl/vMpBtW)

7

3.2. What can be exported using Features module?

URL: /admin/structure/features/createCode: /features/includes

8

3.2. What can be exported using Features module?

Content Types

Stored in Features:• Name• Description• Submission form settings• Publishing options• Display settings• Comment settings• Menu settungs• Etc.

9

3.2. What can be exported using Features module?

Modules our Feature depends on.

Dependencies

10

3.2. What can be exported using Features module?

Field Bases

The way that field data is stored in the database

11

3.2. What can be exported using Features module?

Field Instances

Field settings in content types:

• Widget type• Label• Required/not required• Help text• Number of values

12

3.2. What can be exported using Features module?

Menus and Menu links

• Menu settings

13

• Menu links settings

3.2. What can be exported using Features module?

Permissions and Roles

• Permission settings

14

• User role settings

3.2. What can be exported using Features module?Taxonomy

Taxonomy Vocabulary settings

15

3.2. What can be exported using Features module?

Text Formats

Text format settings:• Name• Roles• Filters

• Filter order• Etc.

16

3.3. Features API

- Is that all that I can do using Features module?

17

- Is that all that I can do using Features module?-NO

18

3.3. Features API

• Features API documentation: http://goo.gl/l4EAIF

• Features API code snippets: http://goo.gl/9qZNLc

19

3.3. Features API

Modules that extend Features functionality:• Strongarm ( http://goo.gl/Z091M0 ) Gives a way to export Drupal variables• Features Extra (http://goo.gl/mVfdK7 ) Allows to export Blocks and Nodequeues• Features Diff (http://goo.gl/v8445F ) Shows the diffs of a single or all features

modules

20

3.3. Features API

Popular modules integrated with Features:• Panels• Views• UUID

21

3.3. Features API

22

4. Drush

• Drush• Features with Drush• Drush API• Deployment with Drush

Drush = Drupal + shell

Drush is the command line to manage your drupal site.

23

4.1. What is Drush?

Drush can:• Install Drupal core• install and remove modules• flush caches• login as any user• execute any sql database queries• etc

24

4.2. What is Drush?

Install and enable a few modules

drush dl views, admin_menudrush en views, views_ui, admin_menu

25

4.3. Drash saves time.

26

4.4. Using Drush + Features.

Reverts all features: drush features-revert-all drush fr-all

List of components that can be transferred: drush features-components drush fc

27

4.4. Using Drush + Features.

Update feature:

drush features-update MY_FEATURE_NAME drush fu MY_FEATURE_NAME

Create a new feature, or add components to the existing one:

drush feature-export MY_FEATURE_NAME component1 component2 drush fe MY_FEATURE_NAME component1 component2 drush fe MY_FEATURE_NAME component1 --version-increment

28

4.4. Using Drush + Features.

The list of Drush commands for working with Features you can find here

http://goo.gl/DiUPfO

29

4.5. Drush APIWriting your own Drush commands:

1. Create MY_MODULE.drush.inc file2. Declare the command using hook_drush_command

3. Describe the command callback

30

4.5. Drush API

Full description of Drush API can be found here:

http://goo.gl/8gb87Z

31

4.6. Deployment with Drush

Automate the deployment process with Drush

cd /var/www/my_projectgit pull origin masterdrush updatedb --y

drush cc alldrush fr-all --y

drush cc all

32

Thanks for coming!We are going to continue the series of webinars and we’ll be happy to

see you again!

Watch record of the webinar on our Youtube channel:https://www.youtube.com/user/QAreaWebinarsFind lot of interesting IT news on our blog: http://www.blog.qarea.com/Follow us: https://www.facebook.com/qarea.inchttps://twitter.com/QArea