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

33
Docker, your best ally to migrate & upgrading your Drupal Alejandro Gómez - @agomezmoron #DrupalDevDays 2017

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

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

Docker, your best ally to migrate & upgrading your Drupal

Alejandro Gómez - @agomezmoron#DrupalDevDays 2017

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

First of all! A selfie with you!

#DrupalDevDays / @drupaldevdays @agomezmoron

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

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

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

Roadmap● Introduction

● Is updating important?

● What do we need?

● The update approach

● How can I automate it?

#DrupalDevDays / @drupaldevdays @agomezmoron

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

Roadmap● Introduction

● Is updating important?

● What do we need?

● The update approach

● How can I automate it?

#DrupalDevDays / @drupaldevdays @agomezmoron

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

● Learning about how to keep our system updated safety.

● Learning some useful procedures & tools :).

Introduction

#DrupalDevDays / @drupaldevdays @agomezmoron

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

Roadmap● Introduction

● Is updating important?

● What do we need?

● The update approach

● How can I automate it?

#DrupalDevDays / @drupaldevdays @agomezmoron

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

@agomezmoron #DrupalDevDays 2017

● Security

● Fixed bugs

● Stability

Is updating important?

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

Roadmap● Introduction

● Is updating important?

● What do we need?

● The update approach

● How can I automate it?

#DrupalDevDays / @drupaldevdays @agomezmoron

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

What do we need?

Testing tools

#DrupalDevDays / @drupaldevdays @agomezmoron

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

● 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

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

Roadmap● Introduction

● Is it important updating?

● What do we need?

● The update approach

● How can I automate it?

#DrupalDevDays / @drupaldevdays @agomezmoron

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

The update approach

#DrupalDevDays / @drupaldevdays @agomezmoron

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

2. Check contrib modules updates & apply them.

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

● 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

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

● composer update drupal/core --with-dependencies

● composer update

The update approach

Core

Contrib

#DrupalDevDays / @drupaldevdays @agomezmoron

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

The update approach

#DrupalDevDays / @drupaldevdays @agomezmoron

For each update, deploy a container,

apply it and run all the regression tests.

ValidationPull Request

20170202_update

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

The update approach

#DrupalDevDays / @drupaldevdays @agomezmoron

PR_security_updated

20170202_security_update_code

20170202_security_update_db

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

The update approach

#DrupalDevDays / @drupaldevdays @agomezmoron

PR_security_updated

20170202_core_update_code

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

The update approach

#DrupalDevDays / @drupaldevdays @agomezmoron

PR_contrib_updated

20170202_contrib_update

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

Roadmap● Introduction

● Is updating important?

● What do we need?

● The update approach

● How can I automate it?

#DrupalDevDays / @drupaldevdays @agomezmoron

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

@agomezmoron

How can I automate it?

Testing tools

#DrupalDevDays / @drupaldevdays

One Jenkins to rule them all!

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

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

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

How can I manage my dockers?

#DrupalDevDays / @drupaldevdays @agomezmoron

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

How can I manage my dockers?

# Option 1

#DrupalDevDays / @drupaldevdays @agomezmoron

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

How can I manage my dockers?

# Option 2

#DrupalDevDays / @drupaldevdays @agomezmoron

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

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

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

Conclusions

#DrupalDevDays / @drupaldevdays @agomezmoron

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

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.

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

Conclusions

#DrupalDevDays / @drupaldevdays @agomezmoron

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

#DrupalDevDays / @drupaldevdays @agomezmoron

Thanks to...

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

#DrupalDevDays / @drupaldevdays @agomezmoron

Thanks to...

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

#DrupalDevDays / @drupaldevdays @agomezmoron

Thanks to...

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

Thanks!

#DrupalDevDays / @drupaldevdays @agomezmoron