Continuous Integration Made Damn Easy!
Pavan Belagatti
GenAI Evangelist (62K+)| Developer Advocate | Tech Content Creator | AI/ML Influencer | 28k Newsletter Subscribers | Supporting AI Innovations
DevOps is what every organization wants to embrace to leverage the power of automation and speed of software deployment. Continuous integration (CI) forms the primary step towards a successful DevOps pipeline. Organizations start with continuous integration and then aim at automating the continuous deployment process.
When it comes to DevOps, picking the right tool is what most developers usually struggle with initially. They pick complex and outdated tools like Jenkins for CI/CD. But, why do you pick something that is not cloud-native in nature and complex to set up when you can do CI from your laptop with just one click? YES.
Now that the DroneCI extension is officially available on the Docker Desktop, doing continuous integration becomes very easy.
Recently I wrote a tutorials to show how you can use DroneCI with your applications to do continuous integration. I added simple test with Jest framework for my node.js application and used DroneCI to do CI.
Using DroneCI Docker Extension
When developers write the code, they store it in a source control management tool like Git. Then, they test and build the code with the help of a continuous integration tool. CI is an essential part of every DevOps approach. DroneCI is an open-source CI tool that is very easy to set up and use. Now that we have this as an extension, you will be able to do CI from your laptop. You just need a yml file to define your steps, and you are done.?
Let us have a simple Node.js application to work with our plugins. Clone the sample application - https://github.com/pavanbelagatti/Simple-Node-App
Just to start with something bare minimum setup, let’s add a simple step in our .drone.yml file.
kind: pipelin
type: docker
name: default
?
platform:
?os: linux
?arch: arm64
?
steps:
- name: message
??image: busybox
??commands:
??- echo “Hello Captain Canary”!
?
- name: test
??image: node
??commands:
??- npm install
??- npm teste
You can install Drone CI extension from the Docker desktop extensions tab directly.
Click on Import pipelines to import your project. The extension will show you all the projects that have the .drone.yml in them. So, import a project to try from your local.
Just to show you an example, I imported my Simple-Node-App project, which is a simple node.js application that includes simple tests.
Next, click on the play button shown below the actions text, you will be prompted with some simple configurations, add required fields and click run.
领英推荐
Once you run your application, you will see the pipeline getting executed.
Congratulations! We did CI in minutes on our laptop with simple set up.
Tell me, how cool is that. It is time to stop wasting our time on old tools and methodologies and try using cloud-native tools such as DroneCI. Below is one more tutorial I wrote to show you how to use DroneCI.
Node.js Unit Testing Automation With DroneCI Using Jest Framework
Jest is a JavaScript testing framework created by Facebook and used to test JavaScript code. Jest has many features that make it a better choice than other testing frameworks like Jasmine or Mocha. It has the ability to test asynchronous code without introducing any complexities. In addition, it is designed to take advantage of the benefits of using a mocking library in conjunction with a test runner. It also provides many other helpful features that are not available in other frameworks.
You just need to have Docker Desktop installed on your computer and .drone.yml file included on your applications root folder.
----------------------------------------------------------------------------------------------------
BTW, I am doing a LinkedIn live with Kamesh, Director of developer advocacy at Harness. He will show you how to configure and build your first CI pipeline using DroneCI Docker extension.
Would you like to attend this LinkedIn live? It is FREE.
----------------------------------------------------------------------------------------------------
Thanks!!!
Ingeniera en Telecomunicaciones -Automatización de redes e infraestructura
2 年Gracias por compartir