You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user-guide/global-configurations/filter-condition.md
+28-6
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ Using filter conditions, you can control the progression of events. Here are a f
8
8
* Images containing the label "test" should not be eligible for deployment in production environment
9
9
* Only images having tag versions greater than v0.7.4 should be eligible for deployment
10
10
* Images hosted on Docker Hub should be eligible but not the rest
11
+
* Only images derived from master branch should be eligible for production deployment (see [example](#scenario-2))
11
12
12
13
---
13
14
@@ -55,17 +56,17 @@ You must have application(s) with CI-CD workflow(s) configured
55
56
56
57

57
58
58
-
{% hint style="info" %}
59
-
Since an application can have more than one environment, the filter conditions apply only to the environment you chose in the **Apply to** section. If you create a filter condition without choosing an application or environment, it will not apply to any of your pipelines.
60
-
{% endhint %}
59
+
{% hint style="info" %}
60
+
Since an application can have more than one environment, the filter conditions apply only to the environment you chose in the **Apply to** section. If you create a filter condition without choosing an application or environment, it will not apply to any of your pipelines.
61
+
{% endhint %}
61
62
62
63
6. Click **Save**. You have successfully created a filter.
Consider another scenario where you wish to make images eligible for deployment only if the application's git branch starts with the word `hotfix` and also if its repo URL matches your specified condition.
where, `https://github.com/devtron-labs` is a portion of the repo URL <br />
117
+
and `hotfix-` is for finding the branch name (say *hotfix-sept-2024*)
118
+
119
+
Alternatively, if you have a fixed branch (say *hotfix-123*), you may write the following expression:
120
+
121
+
`'hotfix-123' in gitCommitDetails.filter(gitCommitDetail, gitCommitDetail.startsWith('https://github.com/devtron-labs')).map(repo, gitCommitDetails[repo].branch)`
0 commit comments