25. Januar 2016

The Developer’s Nightmare: Multi-Project Development Environment Setup

Multi-Project Development Environment Setup<br/>

If you are a developer, you have had to set up your development environment for any of your projects. Database, application server, index, and so on. That might go smoothly… or not. If the first applies, CONGRATULATIONS! And get to work ;) but if not, then welcome to the non-smooth environment setup problem. Even worse, what if you need to have different environments for different projects (e.g. database versions)? And what if you need to reset one, but keep the others untouched?

Yes, you might argue with me here but believe me, setting up the development environment does not always go as smooth as you wish. Why? There are several reasons: outdated documentation, cross platform compatibility (e.g. “works on my Macbook”), etc.

Let me add another point here, what if we would like to have a development environment as close to the production environment as possible? For example:

  • one reverse-proxy
  • Nginx server for static resources
  • one CMS server
  • one REST server
  • and two Oracle databases (one for the CMS and another one for the REST server)

Yes, this might get tricky to setup and you might need to download a lot of programs and run a lot of scripts. What if we could achieve that with a single command? How cool would that be? That is one of the key capabilities of our “channel suite CDK” - support the developers and then, support them even more.

In total, the CDK has two key capabilities. One is to setup and maintain the development environment and the other acts as a scaffolding tool. In this article we will only talk about the maintenance of the development environment and will leave the second one for future posts (so stay tuned!).

Let me explain to you what the CDK (channel suite Development Kit) is. It is a command line tool, based on NodeJS, able to delegate commands to registered plugins. There are two kinds of plugins: environment and scaffolding (today we will only cover the first one). The environment plugin is the one that takes care of the development environment. You can have as many plugins registered as you want, so, for example, you might configure different environment plugins for each of your projects.

And now comes the key concept: this plugin uses Docker to set up all the containers that you need.

Coming back to our environment example (reverse proxy + Nginx server + cms + REST + data bases) - how many servers do you need to install and configure locally? And without impacting the other environments, that’s not an easy task. Here is where the CDK supports you and, using Docker, will set up this environment for you.

As displayed in the picture, Docker (more precisely docker-compose) takes care of connecting your servers and opening the desired ports (80, 8080, 1521, etc.).

If you are not really into Docker, let me put it this way: Docker enables you to configure “containers”, one for each server, using the command line -- and the startup time is almost neglectable. I encourage you to read more about Docker if you haven’t done so yet. So you too can have a pre-configured development environment and start it up in a few seconds. Imagine that you join a new project and all you need to do to set up your environment is to run

$ cdk init

and behind the scenes the CDK does all the work for you:

  • remove existing containers (if any)
  • build Docker images
  • run containers for the images using “docker-compose up”
  • garbage collection of orphan images (the ones that are created by Docker when building them and are not needed anymore)

But that’s not all. The CDK additionally abstracts some Docker commands to make life easier for the developer. For example this command (for windows):

$ winpty docker exec -ti static-resources-server bash

is the same as

$ cdk ssh static

It is as simple as that, the environment plugin contains a set of commands to administrate your local servers (aka Docker containers) in an easy way. Apart from that, it contains the scripts needed to configure them (aka Docker image files).

To sum up, the CDK has been developed to support you (if you are a developer) and you as well (if you work with developers) as they will be happier and will hopefully accept your requirements, … or maybe not ;)

Néstor Tarín Burriel
Néstor Tarín Burriel

Nestor Tarin Burriel is a passionate senior software engineer who is passionate about new technologies and team work. He is focused on both front-end (e.g. AngularJS, ES6, JSPM, Typescrip) and back-end technologies (e.g. JEE, Spring, Spring Boot, Elasticsearch, Node).

Related Articles

Identitätskrise 750x410
Identitätskrise - wer bist du wirklich?

Digitale Identität // Eine zuverlässige digitale Identität ist zentral für eine sichere Informationsgesellschaft. Einige europäische Länder stellen für ihre Einwohner umfassende digitale Identifikationssysteme zur Verfügung. Wo steht die Schweiz und welche Instanzen könnten eine globale digitale Identität bereitstellen?

Mehr erfahren
Mobile-Applikationen: Sicherer als gedacht <br/>
Mobile-Applikationen: Sicherer als gedacht

Mobile-Applikationen haftet immer noch der Ruf an, weniger sicher zu sein als ihre webbasierten Gegenstücke. In der Realität verhält es sich jedoch genau umgekehrt. Mobile-Applikationen sind aufgrund moderner Sicherheitskonzepte mobiler Betriebssysteme bedeutend sicherer als jeder PC oder jedes Notebook. Dies selbst dann, wenn manche Sicherheitsvorkehrungen vom Benutzer durch so genanntes Jailbreaking bzw. Rooting der Geräte aktiv unterwandert worden sind.

Mehr erfahren
I do not love you
I do not love you

For most readers, the title above probably has a strong negative connotation. What if instead of "you", the name of a company was used? The statement still has the same negative connotation, but an opinion of a customer regarding a company might be even more sensitive – at least from a sales point of view. Such public reviews constitute important sources of information for both prospective clients and companies alike. How can one identify, ideally in an automated way, such polarised opinions in the vastness of today’s cyberspace?

Mehr erfahren
Lebenslanges Lernen: Wie Ihre Mitarbeitenden und Ihr Unternehmen von guten Konzepten profitieren können.

Lifelong Learning // Das Schlagwort lebenslanges Lernen betrifft nicht nur jeden Einzelnen. Auch Unternehmen müssen sich intensiv mit dieser Thematik auseinandersetzen, um ihre Mitarbeitenden fit für die digitale Transformation zu machen. Anhand von drei Erfolgsfaktoren zeigen wir, wie es funktionieren kann.

Mehr erfahren
Moritz Baumotte 1000 02
Moritz Baumotte will niemals auslernen

ti&m surfer Moritz Baumotte liebt es Neues zu lernen. Er hat einen enormen Wissensdurst und grosses Interesse an der Software-Architektur. Dank der ti&m academy kann er sich regelmässig weiterbilden. Der Kurs «Certified Professional for Software Architecture – Foundation Level» (ISAQB-FL) mit Gernot Starke hat ihm besonders gut gefallen.

Mehr erfahren
Tomato 750x410
Welches Agile Framework passt zu dir?

Agile Produktentwicklung hat sich in den letzten Jahren und Jahrzehnten in vielen Unternehmen zum de-facto Standard entwickelt. Mit dem Erfolg hat sich auch die Landschaft der agilen Frameworks stark diversifiziert.

Mehr erfahren