Build and Deployment Triggers
What are build triggers?
Build triggers are an essential component of modern software development workflows. They enable developers to automate the process of building and testing code changes, ensuring that any new code is validated and integrated into the larger system as quickly and efficiently as possible. Build triggers are essentially rules that are defined within a Continuous Integration (CI) system, which monitors a code repository and automatically initiates a build process whenever certain criteria are met. In the case of Git-based repositories, the most common trigger is the Git push event, which initiates a build whenever new code is pushed to a specific branch.
Triggers in CodeNOW
One of the features offered by CodeNow is the ability to configure Git push triggers that automatically run a specified CI pipeline. This means that whenever a developer pushes new code to a specific branch of a Git repository, the corresponding CI pipeline is automatically triggered and runs a predefined sequence of build and test steps.
There is also an option of automatic deployment of the component to a specified environment after a successful build. By leveraging CodeNow's Git push triggers feature, developers can streamline their development workflows and focus on delivering high-quality software to end-users.
- Go to the detail of your component.
- Scroll down to Continuous Integration section, find the Triggers section and click on the
- Choose the type of the build (Preview or Release)
- with release build you also need to specify version type and corresponding pattern
- Define the branch on which the trigger will listen for git push events
You can set the trigger to listen on multiple branches by using glob pattern that matches with the name of the branches.
If two or more triggers listen on the same branch, only the first matching trigger defined will be executed.
- Choose which CI pipeline will be triggered
Steps: 1, 2
Steps: 3, 4, 5
You can also add deployments that will deploy the component to a specific environment after successful build.
If you want to automatically deploy a component to a specific environment, you have to enable the
Allow deployment from pipelines option in the configuration of that environment.
Actions panel in the detail of the environment)
Actions panel in the detail of the environment
Enable the Allow deployment from pipelines option
- Click on the
- Select an environment on which you want to deploy your component
- Choose which Deployment configuration should be used
- Latest will use the last used configuration
- Branch will use the configuration defined in the
codenow/config/application.yamlfile in the gitlab repository of your component
- Click on the
- Save the settings (at the end of the Continuous Integration section)
Step 6. i., ii., iii.