Is it a must to use development terminals for websites deployment process? wouldn’t it be more fun to deploy your website through chatting using your mobile or any device?!

ChatOps is the magic word here, by integrating Hubot chat bot, TeamCity continuous integration server, and Octopus Deploy continuous deployment service. In this article series, we’re going to show in details how to automate builds and deployments; to be able to fully release web apps from any device connected to the internet using chat client of choice (e.g. slack)!

Mared series articles:

Mared (Part 1): ChatOps with Hubot For Continuous Integration & Deployment on Windows.

Mared (Part 2): Configure Hubot & Shape its Brain on Windows

Mared The Beginning

Many kids dream to own super powers like all the heroes we used to see in movies or read about in stories. Some of those heroes were abnormal with extra super powers, and some of them were just humans with a lot of courage and a lot of luck as well, like the famous story of Aladdin and the magic lamp in most cultures.

Mared is an Arabic word quite equivalent to the word genie, used by Aladdin. He just needed to scratch the lamp, make a wish to his Mared, and boom the wishes come true.

Image from https://i.ytimg.com/vi/hJ96smUsZVA/maxresdefault.jpg

Unfortunately it’s not that easy to find the magic lamp and own its Mared super powers, but fortunately there is knowledge we could use to invent our own Mared to achieve some of the reasoning wishes of course.

As a young Mared it will need time and effort to teach it how to use its super powers, but after that you can enjoy the super powers and see your wishes come true.

Who is Mared?

Mared simply is a chatting bot integrated with chat client (slack), and we are going to teach it how to make our wishes come true.

For this series we are going to teach Mared how to apply CICD (TeamCity, Octopus Deploy) on our applications.

This is an integration between separate systems; you can replace, remove, or add any part. Also you can change the scenario you use to integrate these parts together this is totally up to you and up to the wishes you wish Mared make true!

The problem:

As a software engineer I face daily problems and challenges beside some routines, although they are routines but they are critical ones and very important (e.g., code integration, building, and deployment to all serving servers).

So I wish I could have a Mared which I can teach how to build, run required test cases, deploy to all servers in the desired sequence, and finally report back the operation success and status in each step. Also give me the option if I need to rollback to the old version.

The solution:

Simply invent Mared, and teach him to do the job for us!

Wait a second! how are we going to invent Mared and how are we going to teach him?

This is a long journey which I’m going to show in my Mared series, but let’s start here in this article to show the big picture, main parts, the process we invented for these parts to work together, and finally the goal that we aim to reach.

Mared parts:

1- Chat client, supports plugins and integrations, which most of them do, (e.g., slack, campfire) we’re going to use slack.

2- Chat bot (Hubot).

Image edited by Mohamed Khalil

These parts should work together to create Mared as an independent entity you can chat with. The more fun part is that you can go far in personalizing it and feeding its brain.

We’re going to discuss all the tiny details step by step of how to integrate Mared’s parts, create its brain, and feed this brain in the coming posts in this series , but let’s focus now on the big picture.

CICD:

CICD stands for Continuous Integration/Continuous Deployment. Using the right tools you can automate the process of checking out the code from source control, build it, run your unit tests if desired, and create the deployment package. This is the continuous integration part.

Deployment process to different environments (e.g., testing, staging, production, etc), this is the continuous deployment part.

Of course each system will need an admin or group of admins to configure it for each project then authorize users to run the steps from the interfaces to build and deploy. So far the process seems to be complex and users need some training to be able to take this process full responsibility.

Image edited by Mohamed Khalil

Here our Mared shows up, if we could teach him how to run this process and communicate with both integration and deployment systems then it will be able to do the job through a simple command without the need to know all the complexity behind this command.

Again we’re going to discuss all the tiny details step by step of how to configure all the CICD components (TeamCity, and Octopus Deploy)then integrate them with Mared in the coming posts in this series.

Image edited by Mohamed Khalil

The goal:

After this series we’re going to be able to start the deployment process and get step notifications from the chat. Only access to chat client is needed through web, mobile or any other device connected to the internet to fully deploy web apps to different environment. No VPN needed, no remote access to multiple servers needed, and no internet speed restriction we need to worry about.

Using a simple command in chat — we will invent this command, no pre-stored commands or anything for more fun! — and you’re ready to go. Mared will provide status for each step and the ability to rollback if needed.

Notifications could be seen by multiple users not only the one who initiated the process. Roles also available, so only the main parties could initiate the process.

Grant or remove the authority to initiate the process could be also done through chatting!

Conclusion:

In this series of articles we are going to teach Mared how to apply CICD on our applications.

For this we’re going to walk-through some articles to create Mared entity, personalize Mared, and feed its brain, configure CICD components (TeamCity, and Octopus Deploy), integrate Mared entity with CICD, and finally enjoy the wishes come true!