Creating CI Rules
Route your builds to right environment
FCI Rules is a powerful feature that streamlines the process of build routing, empowering users to bypass complex CI pipeline logic and directly push their images to Facets. CI Rules and Promotion Workflow together can be used to automate the reclassification of images to their corresponding environments, catering to all build routing use cases.
- Allocate specific branches to designated environments, and
- Promote builds from one environment to another.
This document provides a step-by-step guide for creating and attaching CI Rules.
How to Create CI Rules?
- Open Blueprints and choose the Blueprint. Select the CI Rules tab.
- Click the Create CI Rule button located at the top right corner.
- Provide a unique CI Rule Name and select the appropriate Registration Type.
- Specify the conditions for the CI Rule. Use the Add button to include additional conditions if needed.
- To validate the CI Rule, click Test Rule and enter the necessary details for testing.
- Finally, click Create to successfully create the CI Rule.
Congratulations! You have successfully created a CI Rule.
How to Attach CI Rule to CI Integration?
You can attach a CI rule to an integration either during the creation of the CI integration or by editing an existing integration.
- Open Blueprints and choose the Blueprint. Select the CI Integration tab to access the CI Integration section.
- Click the Edit icon beside the desired CI integration and select the required CI Rule.
- Click Save Changes.
You have successfully attached a CI Rule to an existing CI Integration.
How to Push Images and Classify with CI Rules?
To push an image to Facets and take advantage of CI Rules for automatic classification, use the following facets ctl push command:
facetsctl push --ci <ci_integration_name> --image <docker_image_name>
--git-ref <git refernece> -e <external_id_here> -d <your_build_description>
When you push an image to Facets, the platform takes into account any assigned CI Rule. If a CI Rule is assigned, Facets automatically classifies the image based on the defined rule.
Users will be still able to register artifacts to specific release streams or environments using the old push command. For a comprehensive understanding and proper usage of the push command, make sure to refer to the Facets CLI documentation.
How to Reclassify Artifacts?
The Reclassify button allows you to reclassify existing artifacts after attaching or updating a rule. Even if a rule is not attached, you can still click Reclassify to declassify all artifacts. To reclassify a CI integration in Facets:
- Select the desired CI integration and click on Reclassify.
- In the pop-up window, click Confirm.
You have successfully Reclassified the CI Integration.
Any artifacts that do not match any existing rule will be categorized as unclassified artifacts and moved to the designated Unclassified Artifacts section.
Related Guide
Updated 5 months ago