June 29, 2017
How to set up Continuous Delivery for Node.js
However, it also means websites need to be built and tested before it can be released. A textbook example of a properly configured delivery process can look like this:
- 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
Buddy uses isolated Docker containers to perform your builds. The output of the operation (eg. bundled files) is then stored in the Filesystem, from which it is deployed to the desired place.
You can switch to YAML if you prefer configuration as code over GUI.
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.
Continuous deployment pipeline example
In Continuous Delivery, the product is always in a deployment-ready state, but the deployment to the Production server needs to be performed manually:
Continuous delivery pipeline example
Which process to choose depends on the company needs: in some cases, a feature must wait until it can be released live. However, if your company is not constrained by such regulations, Continuous Deployment should be the process to pursue.
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:
'Wait for approval' action
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.
Continuous delivery pipeline
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
Customer Success Manager