Before we get started, let's refresh what CI/CD stands for:
- Continuous Integration – means that every change to source code is automatically built and tested on a CI server, and then integrated into a remote repository, with the build status returned to the sender. Automated testing is the core of Continuous Integration, significantly increasing code quality and developer productivity.
- Continuous Deployment – means real-time deployment to staging or production environment (or web service), provided the tested code is valid and no longer requires bug fixes. A flawless Continuous Deployment process is the Holy Grail of every DevOps engineer.
package.json JS file, bundling the files for deployment (provided the tests have passed), and deploying the package to the server.
Below, you will learn how to achieve that with Buddy.
Buddy supports all popular Git hosting providers, including GitHub, Bitbucket, and GitLab. You can also use your own private Git server, or host code directly on Buddy.
Supported Git providers
Enter the pipeline's name, select the trigger mode (e.g. on pull request to the main branch), and define the branch from which Buddy will fetch your code:
Exemplary pipeline settings
- Manual (on click) — recommended for Production
- On push (automatic) — recommended for Development
- Recurrently (on time interval) — recommended for Staging/Testing
Buddy lets you choose from dozens of predefined actions. A simple example may include the following pipeline stages:
- Upload code to server together with compiled assets
- Restart application
- Send notification to Slack
Look up and click Node.js on the action list to add it to the pipeline:
The Run tab lets you determine the shell script to execute. The default commands are:
# yarn install
Default build commands
You can change Node.js version and install missing packages & tools in the runtime environment tab:
Node.js action image
If your tests require a database to run, you can attach it in the Services tab:
The compiled application needs to be uploaded to the server. Head to the Transfer section and select your upload action (SFTP in our case):
File transfer actions
When adding the action, you can choose what and where should be uploaded using available feature flags and path inputs:
Setting up an SFTP action
Once the app is deployed, you can run additional commands on your server with the SSH action:
SSH action selection
Enter the commands to execute and configure authentication details:
You can configure Buddy to send your development team a message whenever a new version or new features are released. In this example we'll use Slack:
Congratulations! You have just configured a CI/CD pipeline and automated your entire delivery process. Make a push to the selected branch and watch Buddy fetch, build, and deploy your project. With Continuous Delivery applied, you can now focus on what's really important: developing awesome apps! 🔥
Last modified on February 26, 2024