How to set up Continuous Delivery for Node.js
The 2010s elevated HTML, CSS and JavaScript to the status of the Holy Trinity of modern web development and gave us visually rich, interactive, and mobile-friendly websites.
- Fetch dependencies
- Run Gulp/Grunt tasks, bundle assets, compile CSS, etc.
- Run unit tests
- Deploy to Stage
- Run integration tests
- Deploy to Production
Buddy lets you travel back to simple times and streamline the whole process to a single click (or push to repository) by introducing Continuous Delivery to your workflow.
Automating Node.js delivery with Buddy
Let's create a simple pipeline that will build your application and deploy it to the server:
- Sign up to Buddy and select the repository with your JS project
- Add a new pipeline and set the Trigger Mode to
On every push
- Add the 'Node.js' action and define your tasks
- Add a transfer action to your type of server (eg. SFTP)
- (Optional) You can also add a notification to keep your team updated
- Make a push to the selected branch
Image loading...
Continuous Delivery vs Continuous Deployment
Continuous Deployment is a software engineering approach in which every change to code is rigorously tested before getting deployed to the Production server. The whole process is fully automated - from push to the repository, to deployment to server.
Image loading...
In Continuous Delivery, the product is always in a deployment-ready state, but the deployment to the Production server needs to be performed manually:
Image loading...
Configuring Continuous Delivery pipeline
Continuous Delivery requires manual confirmation before deploying the application to Live. In Buddy you can achieve that by adding the 'Wait for approval' action to your workflow:
Image loading...
This way every time the pipeline is executed, all changes will be automatically tested, but no deployment will be made until the time is right.
Image loading...
Expanding the pipeline
The pipeline can be further expanded with additional actions. You can, for example:
- Dockerize your application before the deployment
- send a conditional notification to Slack in case the tests have failed
- restart servers with SSH scripts
- send HTTP POST to activate maintenance mode on the Production server or switch to atomic deployments for zero downtime
- monitor the impact of deployments on your application
Jarek Dylewski
Customer Support
A journalist and an SEO specialist trying to find himself in the unforgiving world of coders. Gamer, a non-fiction literature fan and obsessive carnivore. Jarek uses his talents to convert the programming lingo into a cohesive and approachable narration.