forked from idan-codefresh/promotion-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpromotionTemplate-helm.yml
44 lines (41 loc) · 2.48 KB
/
promotionTemplate-helm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# PromotionTemplate Configuration
# This PromotionTemplate resource is primarily used for two functions in Codefresh:
# 1. Version Tracking: It defines the location (i.e., the file and path within the file) where the application version is stored.
# This version is then displayed in the application, product, and environment dashboards via the `versionSource` attribute.
# 2. Attribute Promotion: It specifies which attributes and files should be promoted during a promotion process using the `promotion` attribute.
# Attributes are selected using JSON path selectors, allowing for specific or general targeting within the files.
# The applicability of the PromotionTemplate to specific applications is determined by the `applicationSourceSelector` property,
# which utilizes Kubernetes selectors like `matchExpressions` or `matchLabels` to define the scope of application.
apiVersion: codefresh.io/v1beta1
kind: PromotionTemplate
metadata:
name: base-helm
spec:
# Application Source Selector:
# This selector determines which applications the PromotionTemplate applies to, using Kubernetes selection criteria.
applicationSourceSelector:
# matchLabels: # Uncomment and use matchLabels if you want to match applications based on labels.
# codefresh.io/product-type: helm
matchExpressions: # This example uses matchExpressions to find applications where a specific label exists.
- key: app.kubernetes.io/instance
operator: Exists
priority: 0 # Priority of the promotion process (lower numbers have higher priority).
# Version Source Configuration:
# Specifies the file and JSON path used to retrieve the application version for display in the dashboard.
versionSource:
file: Chart.yaml # The file where the version is stored.
jsonPath: $.appVersion # JSON path to the version within the specified file.
# Promotion Configuration:
# Defines the files and JSON paths of attributes that should be promoted during the process.
promotion:
Chart.yaml: # Attributes from Chart.yaml to be promoted.
jsonPaths:
- $.appVersion # Promotes the application version.
- $.version # Promotes the version.
- $.dependencies # Promotes dependencies listed in the file.
values.yaml: # Attributes from values.yaml to be promoted.
jsonPaths:
- $.*.image # Promotes the image specifications.
requirements.yaml: # Attributes from requirements.yaml to be promoted.
jsonPaths:
- "$.dependencies" # Promotes dependencies.