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: content/en/v3/develop/environments/config.md
+25-5Lines changed: 25 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ When you setup a [Remote Cluster](/v3/admin/guides/multi-cluster/) for `Staging`
31
31
32
32
Then when you import the remote cluster repository into the development environment (to setup the CI/CD on pull requests and enable promotion) the generated Pull Request will modify your `jx-requirements.yml` to add remote entries for the remote cluster.
33
33
34
-
e.g. after importing the remote `production` environment via [jx project import](/v3/develop/reference/jx/project/import) and the pull request merging it should look like:
34
+
E.g. after importing the remote `production` environment via [jx project import](/v3/develop/reference/jx/project/import) and the pull request merging it should look like:
35
35
36
36
```yaml
37
37
apiVersion: core.jenkins-x.io/v4beta1
@@ -50,9 +50,15 @@ spec:
50
50
51
51
## Custom environments per repository
52
52
53
-
If you wish to use different sets of environments for different microservices you can override the environments that are used for promotion by adding a `.jx/settings.yaml` with [this format](https://github.com/jenkins-x/jx-api/blob/master/docs/config.md#settings) which overrides settings found the development environments [jx-requirements.yml](https://github.com/jenkins-x/jx-api/blob/master/docs/config.md#requirements) file.
53
+
If you wish to use different sets of environments for different microservices you can augment the environments that are
54
+
used for promotion by adding a `.jx/settings.yaml` with [this format](https://github.
55
+
com/jenkins-x/jx-api/blob/master/docs/config.md#settings) which is merged with settings for the development
md#requirements) file. If you want to override the environments instead of augment you can set
58
+
`ignoreDevEnvironments: true`. By default the namespace name is the environment name prefixed with `jx-`.
54
59
55
-
e.g. add something like this to your `.jx/settings.yaml` in a repository to override which environment repositories are promoted to:
60
+
E.g. add something like this to your `.jx/settings.yaml` in a repository to override which environment repositories
61
+
are promoted to:
56
62
57
63
```yaml
58
64
apiVersion: core.jenkins-x.io/v4beta1
@@ -64,9 +70,23 @@ spec:
64
70
- key: my-staging
65
71
owner: myowner
66
72
repository: some-repo-name
73
+
promotionStrategy: Auto
67
74
- key: my-prod
68
75
owner: myowner
69
-
repository: some-other-repo-name
76
+
repository: some-other-repo-name
77
+
promotionStrategy: Manual
78
+
```
79
+
80
+
If you instead want to disable promotion to an environment, say staging, you can do it with a `.jx/settings.yaml`
81
+
looking like this:
82
+
83
+
```yaml
84
+
apiVersion: core.jenkins-x.io/v4beta1
85
+
kind: Settings
86
+
spec:
87
+
promoteEnvironments:
88
+
- key: staging
89
+
promotionStrategy: Never
70
90
```
71
91
72
92
## Custom environments per group of repositories
@@ -77,7 +97,7 @@ The simplest way to do this is to use a separate git organisation (owner) per te
77
97
78
98
The added benefit of using separate git organisations is that already the [dashboard](/v3/develop/ui/dashboard/) supports filtering all pipelines by owner; so each team will get effectively their own separate UI for viewing pipelines. You can easily bookmark the dashboards view for a single owner / repository.
79
99
80
-
e.g. here's an example `.jx/gitops/source-config.yaml in the development cluster git repository:
100
+
E.g. here's `.jx/gitops/source-config.yaml in the development cluster git repository:
Copy file name to clipboardExpand all lines: content/en/v3/develop/environments/promotion/_index.md
+26-6Lines changed: 26 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -10,25 +10,45 @@ When changes are merged to the main branch in the Jenkins X pipeline catalog a n
10
10
11
11
## How it works
12
12
13
-
The release pipelines use the [jx promote --all](https://github.com/jenkins-x/jx-promote/blob/master/docs/cmd/jx-promote.md#jx-promote) command which creates Pull Requests on all Environments configured in your `jx-requirements.yml` file (see the [Configuration](/v3/develop/environments/config/))
13
+
The release pipelines use the [jx promote --all](https://github.
14
+
com/jenkins-x/jx-promote/blob/master/docs/cmd/jx-promote.md#jx-promote) command which creates Pull Requests on all
15
+
Environments configured in your `jx-requirements.yml` file and possibly `.jx/gitops/source-config.yaml` or
16
+
`.jx/settings.yaml` (see the [Configuration](/v3/develop/environments/config/)).
14
17
15
-
* every environment which is defined in `jx-requirements.yml`as `promotionStrategy`**Auto** or **Manual** is included in a Pull Request to promote the new version to that environment
18
+
* every environment which is defined as `promotionStrategy`**Auto** or **Manual** is included in a Pull Request to promote the new version to that environment
16
19
17
20
***Auto** means the Pull Request will automatically merge if its successful (the Pull Request pipeline succeeds)
18
21
19
22
***Manual** means the Pull Request is a draft and won't automatically merge. i.e. the Pull Request needs to be manually approved (comment `/approve`) and taken off hold (comment `/hold cancel`).
20
23
21
-
* all local Environments in your `jx-requirements.yml`of the promotion kind **Auto** are promoted using a single Pull Request so that all the promotions automatically merge if the pull request pipeline validates successfully.
24
+
* all local Environments of the promotion kind **Auto** are promoted using a single Pull Request so that all the promotions automatically merge if the pull request pipeline validates successfully.
22
25
23
26
* you can define multiple local or remote Environments for different system / integration testing environments.
24
27
25
28
26
-
## Changing Promotion
29
+
## Disable Promotion
27
30
28
-
If you want to disable promotion Pull Requests on an environment just remove the entry in `jx-requirements.yml` or configure the `promotionStrategy` to be **Never**
31
+
If you want to disable promotion Pull Requests on an environment just remove the entry or configure the
32
+
`promotionStrategy` to be **Never**.
29
33
30
-
If you want your application to promote to different environments to the defaults for your cluster you can always [modify your pipeline](/v3/develop/pipelines/#editing-pipelines) and change the promote step to use different [jx promote](https://github.com/jenkins-x/jx-promote/blob/master/docs/cmd/jx-promote.md#jx-promote) arguments; e.g. pass in the explicit environments or repositories you want to promote to in the pipeline step.
34
+
## Reuse pull requests
31
35
36
+
By default a new pull request is created for each promotion. You can instead make existing open pull requests for
37
+
promoting an application be reused.
38
+
39
+
Enabling reuse of pull requests for `jx promote` is done in `jx-requirements.yaml` by setting `reusePullRequest` to
40
+
`true` for an environment. It can also be done in the same way when configuring environments others ways. See
41
+
https://jenkins-x.io/v3/develop/environments/config/ for more details about configuring environments.
42
+
43
+
There are two main reasons why you would want to enable this:
44
+
45
+
To reduce conflicts: if a pull request is created before a previous pull request for upgrading the same application is
46
+
merged there will be a conflict when the earlier pull request is merged. Since enabling reuse means that `jx
47
+
promote` won't open more pull requests for an application this can't happen.
48
+
49
+
The other reason is if you make use of the functionality to propagate application changelogs to cluster
50
+
repositories. This is described in the blog post
51
+
[Improve your changelogs](/blog/2023/05/24/propagate-changelogs/#reuse-pull-requests).
0 commit comments