5 Steps to Your Automated Delivery

I see new features! How often? All the time!

It’s a common understanding of every software company, however, we can deal with it delivering all in an automated way.

It’s a little frustrating when an awesome new feature needs to wait for the next month release to reach the final customer. Sometimes the waiting is even longer due to the stressing delivery process. There are companies with “war rooms” to finish this process. No one can go home until it’s done. Not the best time for eating pizzas.

The main problem usually is where to start. There are tons of great technologies to solve it but they are useless without goals to achieve. These five steps can help you to go from your specific business problem to an automated delivery (anywhere you want).

Master your manual process

What do you need to get your software up and running into production? Or even to a test environment? That’s the main focus! This information will build the roadmap to reach your automated process.

  • Start with the basics. Don’t try to create or reinvent things at this moment. You are only mapping what is necessary.
  • Get the Java version, some frontend framework usually installed by NPM, and any other required software your project needs.
  • The application server version (Wildfly, TomEE, …​), what configurations you need to add, how do you copy your app to there.
  • What minimum server configuration that is needed to support your app.
  • If it’s just a simple JAR application, you can map the test environment needed to get things ready for the next release.

Don’t get embarrassed if the process happens on a developer machine by copying the files straight to production. All fine regardless the scenario you have. Remember: we only need to know how the delivery happens.

All these notes will create an incredible mind map about your project. The best part is that you already know all these steps because you are delivering your software in some way.

Start with virtualization

Okay! Most of the time there is no way to automate the production fearlessly. The customer needs the product without interruptions but we want to deliver it more often in a better way. How can this be done? Where to start? Virtual machines!

Ooh! But it’s so boring to create and maintain these things. No one has time for it.

Good news! There is Vagrant. With a single command, it is possible to create a CentOS or an Ubuntu Server provisioning everything needed to the project using Virtual Box behind the scenes. Better, you only need to share your Vagrantfileso any teammate would have the same environment up and running in a few minutes. No more: “works on my machine”!

That is the time to start testing all your notes from your manual process and try to get the closest production environment. For sure it is not the most efficient way. Virtual machines are not light but they allow you to test almost anything in your development environment putting away the needs of a bigger server.

Another benefit is the chance to use the same tools that you are already familiar with. Just type the same shell scripts to prepare the environment. So there is not a big learning curve to start applying it. If something went wrong, destroy and create a brand new machine in minutes to continue.

If you are a Windows Server guy, try Packer to automate your workflow too.

Begin the automation

At the beginning, you knew the path. Then, you walked through. At this time you have everything to start automating with confidence.

Here are some tools and ways to deal with each development phase:

  • Git or Apache Subversion to handle the source code. It can be hosted in the cloud or on-premise, but it must have a way to check the project out using commands.
  • Maven or Gradle to automate the build process, manage dependencies or even to run the tests.
  • Flyway or Liquibase to make your database migration easier. The database is usually the main problem for anyone who is planning the complete automated process.
  • Shell Script or Powershell (for Windows) to connect all these tools and install the environment. Everything that was done on the virtual machine straight to a script file.

Only a few tools were mentioned for each topic but you can apply whatever you want to reach your automation. These would be the most common ones for a Java Project.

Let a robot do it for you

At this moment the hero developer that works on a small team starts to dream about his stress-free vacation. He is still responsible for the delivery but doing only a few manual steps using the created scripts.

What about automating these remaining steps? Let’s use Jenkins. It’s a Continuous Integration Server, easy to configure and very extensible by the use of plugins. Create tasks, known as jobs, to teach this robot to execute everything you want. From checking the code out from the repository to accessing the server via SSH by copying your app.

Now any teammate can execute these Jenkins jobs and delivery the new app version. It was the missing passport to your awesome vacation!

Remember that it can be your last big step to an automated delivery. So feel free to apply it in small steps. Create a job to configure a complete environment test. Another to build and copy the app to the production server executing the last commands manually. Each small improvement will lead you to a complete process.

Containerize what you did

For the audacious, this step can be considered as the second one. Container world is lighter than the Virtual Machine one. But sometimes it may be a big learning curve for your team, preventing them from moving forward. The best way is to keep everything as simple as possible pushing everyone to the next step.

There is a big chance that you already had heard about Docker Containers. They basically use old Linux features but with an extremely efficient packaging. At the end, there are images with multiple layers that can be the base for a new one and so on. The best part is that this image can be attached to any platform which has a running Docker Host.

Now the developer not only uses a container during the development but this container is the same as the production environment. Attach it to an on-premise server or to any cloud container service and your app will scale easier than ever before.

What Next?

Start planning your delivery process today. A long way that worthwhile. It is maybe a culture changing aiming the DevOps’ world where developers and operations walk side by side. A win-win game.

Let’s automate!


Leave a Reply

Your email address will not be published.