Docker, your best ally to migrate & upgrading your Drupal - Drupal Dev Days Seville 2017

Preview:

Citation preview

Docker, your best ally to migrate & upgrading your Drupal

Alejandro Gómez - @agomezmoron#DrupalDevDays 2017

First of all! A selfie with you!

#DrupalDevDays / @drupaldevdays @agomezmoron

About me

#DrupalDevDays / @drupaldevdays @agomezmoron

agomezmoron.info.yml

name: Alejandro Gómezdescription: “QA & Tech lover”package: #DrupalDevDaysworks_on:- company: { name: @ladrupalera by @emergya, role: QA & Team lead }- company: { name: @EPSUPO, role: QA teacher }

type: Non-stop learnercore: DDD.2017

community: @SevillaQA organizer

Roadmap● Introduction

● Is updating important?

● What do we need?

● The update approach

● How can I automate it?

#DrupalDevDays / @drupaldevdays @agomezmoron

Roadmap● Introduction

● Is updating important?

● What do we need?

● The update approach

● How can I automate it?

#DrupalDevDays / @drupaldevdays @agomezmoron

● Learning about how to keep our system updated safety.

● Learning some useful procedures & tools :).

Introduction

#DrupalDevDays / @drupaldevdays @agomezmoron

Roadmap● Introduction

● Is updating important?

● What do we need?

● The update approach

● How can I automate it?

#DrupalDevDays / @drupaldevdays @agomezmoron

@agomezmoron #DrupalDevDays 2017

● Security

● Fixed bugs

● Stability

Is updating important?

Roadmap● Introduction

● Is updating important?

● What do we need?

● The update approach

● How can I automate it?

#DrupalDevDays / @drupaldevdays @agomezmoron

What do we need?

Testing tools

#DrupalDevDays / @drupaldevdays @agomezmoron

● It rocks...but can you imagine doing the process by hand?

● You should keep the core, modules, etc updated.

● What about automating the process?

What do we need?

#DrupalDevDays / @drupaldevdays @agomezmoron

Roadmap● Introduction

● Is it important updating?

● What do we need?

● The update approach

● How can I automate it?

#DrupalDevDays / @drupaldevdays @agomezmoron

The update approach

#DrupalDevDays / @drupaldevdays @agomezmoron

1. Check core updates (security) & apply them.

2. Check contrib modules updates & apply them.

● drush up --security-only -n

○ drush pm-updatecode --security-only -y

○ drush updatedb -y

● drush upc --no-core -n

○ drush upc --no-core -y

The update approach

Core

Contrib

#DrupalDevDays / @drupaldevdays @agomezmoron

● composer update drupal/core --with-dependencies

● composer update

The update approach

Core

Contrib

#DrupalDevDays / @drupaldevdays @agomezmoron

The update approach

#DrupalDevDays / @drupaldevdays @agomezmoron

For each update, deploy a container,

apply it and run all the regression tests.

ValidationPull Request

20170202_update

The update approach

#DrupalDevDays / @drupaldevdays @agomezmoron

PR_security_updated

20170202_security_update_code

20170202_security_update_db

The update approach

#DrupalDevDays / @drupaldevdays @agomezmoron

PR_security_updated

20170202_core_update_code

The update approach

#DrupalDevDays / @drupaldevdays @agomezmoron

PR_contrib_updated

20170202_contrib_update

Roadmap● Introduction

● Is updating important?

● What do we need?

● The update approach

● How can I automate it?

#DrupalDevDays / @drupaldevdays @agomezmoron

@agomezmoron

How can I automate it?

Testing tools

#DrupalDevDays / @drupaldevdays

One Jenkins to rule them all!

How can I manage my dockers?

● Managing your docker images can be easy.

● What about the containers?

● What about the network bridgings, volumes...?

#DrupalDevDays / @drupaldevdays @agomezmoron

How can I manage my dockers?

#DrupalDevDays / @drupaldevdays @agomezmoron

How can I manage my dockers?

# Option 1

#DrupalDevDays / @drupaldevdays @agomezmoron

How can I manage my dockers?

# Option 2

#DrupalDevDays / @drupaldevdays @agomezmoron

How can I manage my dockers?

#DrupalDevDays / @drupaldevdays @agomezmoron

docker run -d -p 9000:9000 --privileged -v

/var/run/docker.sock:/var/run/docker.sock

portainer/portainer --name myportainer

Conclusions

#DrupalDevDays / @drupaldevdays @agomezmoron

Conclusions

#DrupalDevDays / @drupaldevdays @agomezmoron

● Updates are important but they can break your system.

● A continuous core update should be applied in our code

and all the tests should be running.

Conclusions

#DrupalDevDays / @drupaldevdays @agomezmoron

#DrupalDevDays / @drupaldevdays @agomezmoron

Thanks to...

#DrupalDevDays / @drupaldevdays @agomezmoron

Thanks to...

#DrupalDevDays / @drupaldevdays @agomezmoron

Thanks to...

Thanks!

#DrupalDevDays / @drupaldevdays @agomezmoron