The software development ecosystem is ridden with tools and technologies supporting each phase of the software development lifecycle. From development, testing, deployment, maintenance, scaling, analytics, and feedback implementation, various tools abound which can be used to carry out these functions effectively.
Table of Contents
The question is, how efficient and effortless is it to mash up these tools in the right order and watch your application go through each process from start to finish at speed? These tools would also have processes running together or separately. We will answer these in this post by deploying a Node app to heroku with a CI/CD process flow.
While building and deploying a typical application, you possibly go through the following simple process (or skip some):
- Develop in a local environment.
- Push to a remote repository using Git.
- Use a module bundler to bundle assets and files.
- Build the application using a build tool to generate deploy-ready files.
- Deploy to a staging server.
- Deploy to production.
- Monitor and analyze the application.
- Re-run the above process each time an authorized push or merge is made to the chosen branch in the repository.
With these processes running, you possibly have to send notifications when one or more of the stages are passed. This could be emailed, via Slack or wherever. You most likely don't want to do these manually and have to trigger each action for every commit.
It would be amazing to have a continuous integration and continuous deployment pipeline that works to handle the above processes and handle triggers. This system CI/CD runs the stages either recurrently, manually or for every push to a remote repository.
Not just one that works, but very robust, highly customizable and extendable.
Here goes Buddy.
Buddy is an all-round deployment and software development CI/CD management tool. Buddy ships a robust and fast CI/CD pipeline to integrate just about any tool or service in your software development process.Essential Reading: Learn React from Scratch! (2019 Edition)
In a nutshell, Buddy helps you deploy applications in the fastest time possible while maintaining an efficient pipeline, having all the cool modern tools and services.
Setting up a pipeline in Buddy is as simple as ABC, and I mean it, it's that seamless. We will proceed to create a pipeline to deploy a node app to Heroku. During the pipeline setup, you'll find several pipeline actions from the list of actions which you can use.
Here's a simple Express app created and having a Heroku Procfile. Fork it and clone to your local dev environment to get started.
Go to Heroku and create a new application.
In your local development terminal, add the Heroku repository as a remote repository. Do this with:
heroku git:remote -a scotch-buddy
scotch-buddy, in this case, is the name of our app on Heroku.
Push the application to Heroku to trigger an initial deploy. Do this with:
git push heroku master
Run the following command to open the app in your browser:
With this you have a deployed application which looks like this:
You can find mine here: https://scotch-buddy.herokuapp.com/
Next step is to set up a CI/CD for the app, which triggers a Heroku deploy and shoots an email once new commits are pushed to the master branch of the repository.
Setting up buddy is pretty straightforward and you can signup using your GitHub, BitBucket or email account. Go on to Buddy.works to create a new account.
Setup a Buddy Pipeline
Sign in to get started. Create a new project and name it whatever you like.
Once created, add a new pipeline to the project.
This pipeline will contain all actions required for the app. An app can have multiple pipelines as well. Select the "On push" option for the trigger mode to trigger the pipeline flow once new commits are pushed to the repository. You can set it to happen at set times using "Recurrently" or manually using the "Manual" mode.
Select the branch that triggers the deploy and in this case,
Add a Heroku Action
In the next page, select an action to add to the pipeline. This action will be triggered first. Not to worry, you can easily rearrange the flow of the actions later.
Select an action from the list, and in this case, we select the "Heroku" action.
This action transfers files from the repository to a specified Heroku Dyno otherwise known as project.
Authenticate your Heroku account and select an application from Heroku.
You can add custom
.gitignore files here as well. Proceed to add the action.
Add an Email Action
In the next page, which shows the pipeline, add a new action to send an email once the deploy action is completed. Do this by hitting the "+" icon under the deploy action.
You can quickly move the actions around, turn them on and off or choose if actions should run together or one should wait for the other.
You can also add an action to run on failure. Notification actions are suitable for this. You can also add an action for once the pipeline status changes from failed to successful.
Hit the "Run Pipeline" button to the right of the screen.
This runs the pipeline which deploys the app again and sends an email to the specified recipients.
In the executions tab, you can see the list of executions as well as which passed, failed or is enqueued.
In the Pipelines tab, you can set variables for the pipeline and see analytics as well.
Subsequent commits to master will automatically trigger a deploy to Heroku and notify a user via email. This is just a bit of what Buddy can do, with the tons of other actions, customizing a robust pipeline for an efficient workflow can be set up in minutes.
In this post, we deployed a simple Heroku app to Heroku and set up a CI/CD pipeline using Buddy. This pipeline triggers a deploy to Heroku once a commit is pushed to the remote repositories then notifies specified email addresses.
Feel free to try out other actions on Buddy as it suits your workflow.
Like this article? Follow @iChuloo on Twitter
This content is sponsored via Syndicate Ads.