Di chuyển Drupal 8 Configuration từ Local lên Server và ngược lại

Di chuyển Drupal 8 Configuration từ Local lên Server và ngược lại

Two weeks ago I had a great opportunity to spend a few days working with Moshe Weitzman (moshe weitzman), Justin Randell (beejeebus), Alex Bronstein (effulgentsia), and Stéphane Corlosquet (scor) to look at the challenges and best practices for using the new Drupal 8 configuration system (a.k.a. CMI) to move changes between a local development environment and one or more server environments. We developed ideas, considered new modules for Drupal 8, and tried to figure out if there were any changes to Drupal 8 core that would be needed to make the system better for developers.

One outcome of this was two new modules Configuration log and Configuration Read-only mode. These were written to help demonstrate the capabilities of the new configuration system and enabled us to implement key elements of possible new configuration staging and management workflows. An additional outcome was a number of enhancements by Moshe to the latest version of Drush to facilitate the import and export of configuration.

The screencast video below walks through the process of moving configuration from a local development version of a site, up to a development environment on a server and then to a "live" environment using Acquia Cloud Free. The "live" environment was detected in settings.php and that logic triggered the Configuration Read-only mode module to prevent any configuration changes in the administrative forms. We also used a Cloud Hook to automatically import new configuration when a new git tag was deployed to the "live" environment.

The video also shows the reverse process of bringing a configuration change back to a local codebase. For that we used the Configuration log module and committed each configuration change into a "recorder" branch in a git repository that was a clone of the site codebase. By creating the "recorder" branch from the same git commit as the deployed site is running, it's possible to use native git operations to merge the configuration changes back into the local clone of the codebase, as shown.

While we were happy with what we are able to demo, the experience convinced everyone involved that keeping the active configuration in files was more difficult in terms of development workflow, and led us to push for the proposed Drupal core change to keep the active configuration in the database.

We also discovered a core bug that mean a small subset of configuration imports did not work - so we had to patch around it for the demo and file an issue. The good news is that the bug has already been fixed thanks to Tim Plunkett.

Bạn thấy bài viết này như thế nào?: 
No votes yet
Ảnh của Khanh Hoang

Khanh Hoang - Kenn

Kenn is a user experience designer and front end developer who enjoys creating beautiful and usable web and mobile experiences.

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Mozilla Firefox 8 chính thức phát hành

Mozilla Firefox 8 chính thức phát hành

Mozilla đã tung ra phiên bản ổn định của trình duyệt Firefox 8 vào hôm qua, ngày 8/11. Nhiều tính năng mới đã được thêm vào như tích hợp tìm kiếm trong Twitter...

Bí quyết 3 - nhiều ngôn ngữ trong 1 site Drupal 7

Bí quyết 3 - nhiều ngôn ngữ trong 1 site Drupal 7

Welcome to our third and last recipe. This time we will elaborate on a Multilingual recipe for a complex Enterprise Website

Apple thua kiện 5 triệu USD vì xâm phạm bằng sáng chế

Apple thua kiện 5 triệu USD vì xâm phạm bằng sáng chế

Theo thông tin từ công ty Elan Microelectronics biết, Apple sẽ phải trả 5 triệu USD để giải quyết đơn kiện của hãng vì vi phạm bằng sáng chế cho công nghệ cảm ứng đa điểm.

Công ty diệt chuột T&C

 

Diet con trung