Cloud hosting platforms. Part one: Pantheon | ADCI Solutions

Introduction

Let's imagine that you (or your customer) have a great idea of a project. You are working on it locally alone. Later you build a team and you need to share code among teammates and show an intermediate result to a client. You are not a DevOps - you dont know each teeny-tiny technical detail of server configuration. More than that - you dont want to know. You like just to code! And, of course, you dont want to hire a special person to do it. What to do? You are searching for a shared hosting. And what you can see - almost all shared hostings provide you with an ugly cPanel interface and force you to upload code via SFTP. SFTP? Are you kidding me? It is not the year 2000! You need at least: an SSH access, Git, and Drush. Youd like to have a simple and convenient administration panel which allows you to do some minimal server or PHP configuration. Youd like to have isolated environments and technical domains. And of course, youd like to keep it simple.

Sounds like a story of your life? If the answer is yes - this article is for you.

In this and the following articles, we will tell you about popular cloud hostings: Pantheon and Acquia Cloud. Well observe advantages and disadvantages based on our development experience.

Let's talk about Patheon first. Pantheon is a Website Management Platform. It allows you to work with Drupal and WordPress projects.

You can start a new Drupal 7, Drupal 8 or WordPress project in a few clicks. You just have to enter a project name. Thats all: Pantheon cloud will do all the things for you.

Also, you can migrate an existing website to Patheon following these steps:

A manual migration option is also available. If you are familiar with SSH and Linux CLI - this option is for you. If you choose the manual migration, Pantheon will create an empty project for you. You have to upload a codebase, the DB, and the static files manually via SSH and using Git. See the manual here.

Ok, you created a new project or migrated an existing one and now you have an access to the Pantheon dashboard.

The Pantheon dashboard is really nice and well-designed. In comparison to standard cPanel - it has an intuitive UI. The Pantheon dashboard allows you to perform different actions on a project very easy. You can:

More than that you can:

All these features are really useful and help with some route tasks of managing your project and environments.

Out of box Pantheon provides 3 environments: dev, test, and prod. Pantheon creates technical domains for each environment in the following format: -.pantheonsite.io (of course, you can attach your own domain for each environment). This is a very cool feature which isnt used by the most of the shared hostings. It allows you to share an intermediate result with a client and demonstrate new website features.

Lets assume that the dev environment is your working environment. Changes are available right after you push commit. You don't need to pull changes - Patheon will pull everything automatically.

The test environment can be very close to the prod environment. You deploy some ready features into this environment to test it before going live.

The live environment will include all tested features.

Of course, a way of using these environments is up to you.

Starting with this, let's talk about development experience and a workflow.

There are two types of workflow provided by Pantheon: standard and multidev.

Standard workflow:

You are working in the master branch. Of course, you or your teammates can create a branch as you used to, but Patheon doesnt see any of them and you cant switch an environment to use any of these branches.

Pantheon provides the autopull feature so that you shouldnt pull your commits: it will be done automatically out of box. All your commits go to the dev environment.

To deploy changes into the test environment, you have to open this test environment and click deploy or do it with Terminus tool.

So, if you need some changes to be deployed to live, they should be deployed to the test environment at first and then to the live.

It sounds like a good flow: it means that you are testing all your features before they go live. But it is just on the one hand.

On the other hand, let's imagine that you are not working alone on a project. You push a feature to the dev, your teammate pushes another feature too. You are working on the same branch. At the particular moment, you have to deploy changes to the test or to the live. As far as you are working on the same branch, your teammates changes will be deployed too. But you only need your changes. In this case, you have to revert teammates changes, deploy yours, and then revert teammates changes on the dev again. Not a very good experience, do you agree?

It can be solved with enabling the multidev feature.

The multidev workflow allows to fork the entire stack (code and content), work independently, then merge code changes back into the master. Each forked branch will have its own separate development environment, including a database, files, and a separate Git branch. Now, you can create a separate environment for every task or feature on your project and work independently.

It is more flexible, isnt it?

Yes, but I still need more flexibility. And it is the only thing I dont like in Pantheon.

I dont have a full control of my repo. Of course, the idea of the dev -> test -> live flow is the right idea. But sometimes I want to have separate Git branches for different environments. There is no way to have it in Patheon.

Another bad thing - hotfixes.

What if I need to push a fix very fast to live? Should I still forward my commit through the dev-test-live deployment chain? What if there are some outstanding commits in the dev? They will be deployed too and, of course, I need to avoid it. How to solve it?

Pantheon uses the tags system for deployment. So, if you deploy something to the test, pantheon_test_ tag will be created. The same for the live environment.

So, to create a hotfix to live you have to:

After that, the new live tag will be automatically deployed to live. It sounds like a hack - but it is the only way to create a hotfix in Pantheon.

As I said, this is the only bad thing in Pantheon from my point of view.

Lets examine other Pantheon cool features.

Another important feature is a command line interface which provides advanced interaction with the Pantheon cloud platform. Terminus enables you to do almost everything in a terminal that you can do in the dashboard, and much more:

If you are familiar with the Linux terminal - it is a good alternative to a UI dashboard.

Cloud hosting platforms are the next level of hosting solutions. In this article, you learned about the popular platform called Pantheon and how easy you can deploy the development-ready environment just in a few clicks. If you are still using an old hosting platform with cPanel - it is a good time to migrate your project to a cloud hosting.

Migrate my site

View post:
Cloud hosting platforms. Part one: Pantheon | ADCI Solutions

Related Posts

Comments are closed.