Once I am done, I will rename my feature environment to release-02 and point the master alias there. Note that only the master environment can be cloned. So, I delete my old feature environment and clone a new one. After making some changes, I decide to go in a different direction. Now, I want to develop a new feature, so I clone the production environment into a feature environment. So, I clone the master environment, name the new one release-01, and setup a master alias to point there. I prefer to name my production environments with release. In the diagram above, you start out with a master environment. I will use an example of how you can setup and use your environments to bring all these concepts togther and make the most of this system. For those who are familiar with the C-language, an alias is like a persisted variable that "points" to a environment, and can be updated to point to newer ones. Then, promoting a new environment to production is simply a matter of re-aliasing. For example, it is typical to have a "master" alias that points to your current production environment. An alias is used to declare, or tag, an environment for a particular type of usage. One more piece of Contentful's environments that deserves explanation is the "alias" system. However, I suspect that Contentful uses a shallow copy during the clone, and lazily makes a deep copy of individual pieces of content as changes are made within a specific environment. This means that large environments with lots of content may take a while to clone. This effectively copies everything from the master including all of the data. New environments can only be cloned from the master environment. A new environment can be just as easily deleted, removing any modifications made there. These changes will only affect the new environment and are completely isolated from the original cloned environment. The new environment will contain all of the same types and content until you begin making changes. They can be easily created by cloning (or copying) your master environment into new environment. You can think of an environment as an ephemeral bucket where you store all of your types and content. When you first create an empty space, there is a default, master environment where you can start defining your schemas and inserting data. A space is equivalent to a project, and within each space you can have multiple environments. The Contentful system is formed by a hierarchy of Organization -> Space -> Environment. So, it's worth taking a minute to understand how the environment system works and how it can be utilized effectively. However, it is a bit different from the traditional staging environments that most developers are accustomed. It leverages the potential of cloud provisioning and offers major advantages. As a result, I have developed an appreciation for Contentful's environment system. I have been working on a new project called Migrateful, a migration manager for the Contentful platform.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |