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
Document OCTOPUS__Git__CacheFullThresholdMb env var (#3087)
* Document OCTOPUS__Git__CacheFullThresholdMb env var
* Fix inaccurate list of affected operations
* Add converting to VCS as affected operation
* Fix markdownlint errors in config-as-code-reference
* Remove heading ID that breaks MDX parser
Copy file name to clipboardExpand all lines: src/pages/docs/projects/version-control/config-as-code-reference.mdx
+75-67Lines changed: 75 additions & 67 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,18 +21,18 @@ Currently, the Project level resources saved to Git are:
21
21
22
22
- Deployment Process
23
23
- Deployment Settings
24
-
- Release Versioning
25
-
- Release Notes Template
26
-
- Deployment Targets Required
27
-
- Transient Deployment Targets
28
-
- Deployment Changes Template
29
-
- Default Failure Mode
24
+
- Release Versioning
25
+
- Release Notes Template
26
+
- Deployment Targets Required
27
+
- Transient Deployment Targets
28
+
- Deployment Changes Template
29
+
- Default Failure Mode
30
30
- Runbook Process
31
31
- Runbook Settings
32
-
- Multi-tenancy Mode
33
-
- Run Retention Policy
34
-
- Connectivity Policy
35
-
- Default Failure Mode
32
+
- Multi-tenancy Mode
33
+
- Run Retention Policy
34
+
- Connectivity Policy
35
+
- Default Failure Mode
36
36
- Variables (excluding Sensitive variables)
37
37
38
38
:::div{.hint}
@@ -49,11 +49,11 @@ Currently, the Project level resources saved to SQL Server when version control
49
49
- Deployments
50
50
- Sensitive Variables
51
51
- General Settings
52
-
- Project Name
53
-
- Enabled / Disabled
54
-
- Logo
55
-
- Description
56
-
- Project Group
52
+
- Project Name
53
+
- Enabled / Disabled
54
+
- Logo
55
+
- Description
56
+
- Project Group
57
57
58
58
:::div{.hint}
59
59
Sensitive Variables are planned for future releases of config-as-code.
@@ -64,36 +64,36 @@ Sensitive Variables are planned for future releases of config-as-code.
64
64
The config-as-code feature manages project-level resources. However, it is worth explicitly mentioning some things that are **not included**:
65
65
66
66
- Infrastructure
67
-
- Environments
68
-
- Deployment Targets
69
-
- Workers
70
-
- Worker Pools
71
-
- Machine Policies
72
-
- Machine Proxies
73
-
- Accounts
67
+
- Environments
68
+
- Deployment Targets
69
+
- Workers
70
+
- Worker Pools
71
+
- Machine Policies
72
+
- Machine Proxies
73
+
- Accounts
74
74
- Tenants
75
75
- Library
76
-
- Certificates
77
-
- External Feeds
78
-
- Lifecycles
79
-
- Packages
80
-
- Build Information
81
-
- Script Modules
82
-
- Step Templates
83
-
- Variable Sets
76
+
- Certificates
77
+
- External Feeds
78
+
- Lifecycles
79
+
- Packages
80
+
- Build Information
81
+
- Script Modules
82
+
- Step Templates
83
+
- Variable Sets
84
84
- Server Configuration
85
-
- Feature Flags
86
-
- License
87
-
- Node Settings (Task Cap and Server Uri)
88
-
- Issue Tracker Settings
89
-
- External Auth Provider Settings
90
-
- SMTP
91
-
- Spaces
92
-
- Teams (both membership and role assignment)
93
-
- Users
94
-
- User Roles
95
-
96
-
Currently, there are no plans to include these resources in the config-as-code feature. Several of the resources above can be put into version control using the [Octopus Terraform Provider](https://registry.terraform.io/providers/OctopusDeployLabs/octopusdeploy/latest/docs).
85
+
- Feature Flags
86
+
- License
87
+
- Node Settings (Task Cap and Server Uri)
88
+
- Issue Tracker Settings
89
+
- External Auth Provider Settings
90
+
- SMTP
91
+
- Spaces
92
+
- Teams (both membership and role assignment)
93
+
- Users
94
+
- User Roles
95
+
96
+
Currently, there are no plans to include these resources in the config-as-code feature. Several of the resources above can be put into version control using the [Octopus Terraform Provider](https://registry.terraform.io/providers/OctopusDeployLabs/octopusdeploy/latest/docs).
97
97
98
98
:::div{.hint}
99
99
Resources managed by the Octopus Terraform Provider will have their state managed by Terraform. Resources managed by the Octopus config-as-code feature will have the state managed by Octopus Deploy. The two are not the same and shouldn't be treated as such.
@@ -105,36 +105,37 @@ Project version control settings can be accessed by clicking on the **Settings
105
105
106
106
### Git repository
107
107
108
-
The _Git Repository_ field should contain the URL for the repository you wish the Octopus configuration to be persisted to. e.g. `https://github.com/OctopusSamples/OctoFX.git`
108
+
The *Git Repository* field should contain the URL for the repository you wish the Octopus configuration to be persisted to. e.g. `https://github.com/OctopusSamples/OctoFX.git`
109
109
110
110
<VersionControlRepositoryUrlFormat />
111
111
112
112
The repository must be initialized (i.e. contain at least one branch) prior to saving. Octopus will convert the existing items in the project to OCL (Octopus Configuration Language) and save it to that repository when you click save. If the repository isn't initialized, that will fail.
113
113
114
114
### Authentication
115
115
116
-
The config-as-code feature is designed to work with _any_ Git repository. When configuring a project to be version-controlled, you can optionally provide credentials for authentication.
116
+
The config-as-code feature is designed to work with *any* Git repository. When configuring a project to be version-controlled, you can optionally provide credentials for authentication.
117
117
118
118
:::div{.hint}
119
119
Do not use credentials from a personal account. Select a shared or service account. When Octopus Deploy saves to your Git repo, you will typically see the message `[User Name] authored and [Service Account] committed on [Date].`
120
120
:::
121
121
122
122
For the Password field, we recommend using a personal access token. We also recommend that you follow the principle of least privilege when selecting scopes or permissions to grant this personal access token.
123
123
124
-
Git providers allow you to create an access token in different ways. The recommended _scope_ for each provider is listed in brackets.
124
+
Git providers allow you to create an access token in different ways. The recommended *scope* for each provider is listed in brackets.
125
125
126
-
-[GitHub - Creating a fine-grained personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token); (Permission - `Contents - Read and Write`)
127
-
-[GitHub - Creating a personal access token (Classic)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-personal-access-token-classic); (Scope - `repo`)
-[GitHub - Creating a fine-grained personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token); (Permission - `Contents - Read and Write`)
127
+
-[GitHub - Creating a personal access token (Classic)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-personal-access-token-classic); (Scope - `repo`)
Some VCS providers require that you use only a username and personal access token for authentication, not an email address (i.e. BitBucket).
135
135
:::
136
136
137
137
#### BitBucket repository access tokens
138
+
138
139
BitBucket's repository access tokens allow you to create repository-specific access tokens. For these to work with your Git repositories in Octopus, you must set the username to `x-token-auth`, and the password to the token.
139
140
140
141
:::figure
@@ -143,7 +144,7 @@ BitBucket's repository access tokens allow you to create repository-specific acc
143
144
144
145
### File storage
145
146
146
-
_Git File Storage Directory_ specifies the path within the repository where the Octopus configuration will be stored. The default directory is `.octopus`, but that can be changed. If only a single Octopus project will be stored in the repo, we recommend putting the configuration directly under the `.octopus` directory.
147
+
*Git File Storage Directory* specifies the path within the repository where the Octopus configuration will be stored. The default directory is `.octopus`, but that can be changed. If only a single Octopus project will be stored in the repo, we recommend putting the configuration directly under the `.octopus` directory.
147
148
148
149
:::div{.hint}
149
150
If multiple projects will be persisted to the repository, adding the project name to the path is the recommended convention, e.g. `./octopus/acme`
@@ -155,9 +156,9 @@ We recommend storing projects alongside the application code. While it is possib
155
156
156
157
#### Default branch name
157
158
158
-
The _Default Branch Name_ is the branch on which the Octopus configuration will be written. It is also the default branch that will be used in various situations, for example:
159
+
The *Default Branch Name* is the branch on which the Octopus configuration will be written. It is also the default branch that will be used in various situations, for example:
159
160
160
-
- When users view the project's deployment process for the first time in the Octopus UI, this is the initially selected branch
161
+
- When users view the project's deployment process for the first time in the Octopus UI, this is the initially selected branch
161
162
- When creating releases, this will be the default branch selected
162
163
- When running Runbooks, variable values will be pulled from this branch
163
164
@@ -169,31 +170,37 @@ When snapshotting a Runbook in a Git project that is not yet using config-as-cod
169
170
170
171
#### Initial commit branch
171
172
172
-
If the default branch is protected in your repository, select the *Is the default branch protected?* checkbox. This will allow you to use a different _Initial Commit Branch_. If this branch does not exist, Octopus will create the branch automatically.
173
+
If the default branch is protected in your repository, select the *Is the default branch protected?* checkbox. This will allow you to use a different *Initial Commit Branch*. If this branch does not exist, Octopus will create the branch automatically.
173
174
174
-
The Octopus configurations will be written to the initial commit branch instead of the default branch. You will need to merge the changes from this branch into the default branch outside of Octopus.
175
+
The Octopus configurations will be written to the initial commit branch instead of the default branch. You will need to merge the changes from this branch into the default branch outside of Octopus.
175
176
176
177
#### Protected branches pattern
177
178
178
179
You can also nominate protected branches for your Project. This will prevent users from making direct commits to the nominated branches from the Octopus UI and encourage them to create a new branch instead. To nominate protected branches, type in the name or a wildcard pattern in the Protected Branches Pattern field under Branch Settings. This will apply to all existing and future branches.
179
180
181
+
## Git repository cache
182
+
183
+
Octopus Server caches Git repositories locally in the `Git` subdirectory of the server home directory. This cache has a default size limit of **20 GB**. When exceeded, Git operations such as creating releases, deploying, or converting projects to version control will fail with:
180
184
185
+
> Unable to perform this operation as the local git cache is using more space than is available as set by the configured limit of 20 GB. Please use a smaller repository or remove any not in use.
186
+
187
+
To change the limit, set the `OCTOPUS__Git__CacheFullThresholdMb` system environment variable to the desired value in **megabytes** (e.g. `30720` for 30 GB), then **restart the Octopus Server service**. Setting the value to `0` disables the limit.
181
188
182
189
## OCL files
183
190
184
191
After successfully configuring a project to be version controlled, the specified Git repository will be populated with a set of Octopus Configuration Language (OCL) files. These files are created in the directory you define during setup. E.g. `./octopus/acme`
185
192
186
193
Currently, Octopus creates the following files and folders:
187
194
188
-
* deployment_process.ocl
189
-
* deployment_settings.ocl
190
-
* variables.ocl
191
-
* schema_version.ocl
192
-
* runbooks/
195
+
- deployment_process.ocl
196
+
- deployment_settings.ocl
197
+
- variables.ocl
198
+
- schema_version.ocl
199
+
- runbooks/
193
200
194
-
The runbooks/ directory will contain runbook-name.ocl files for any published runbooks.
201
+
The runbooks/ directory will contain runbook-name.ocl files for any published runbooks.
195
202
196
-
The _deployment_process.ocl_ file contains the configuration for your project's steps. Below is an example _deployment_process.ocl_ for a project containing a single _Deploy a Package_ step.
203
+
The *deployment_process.ocl* file contains the configuration for your project's steps. Below is an example *deployment_process.ocl* for a project containing a single *Deploy a Package* step.
197
204
198
205
```hcl
199
206
step "deploy-a-package" {
@@ -227,7 +234,7 @@ step "deploy-a-package" {
227
234
}
228
235
```
229
236
230
-
The _deployment_settings.ocl_ file contains the configuration for the deployment settings associated with the deployment process. If using the default deployment process settings, the .ocl will be mostly empty.
237
+
The *deployment_settings.ocl* file contains the configuration for the deployment settings associated with the deployment process. If using the default deployment process settings, the .ocl will be mostly empty.
231
238
232
239
```hcl
233
240
connectivity_policy {
@@ -272,7 +279,7 @@ versioning_strategy {
272
279
}
273
280
```
274
281
275
-
The _variables.ocl_ file contains all non-sensitive variables for the project.
282
+
The *variables.ocl* file contains all non-sensitive variables for the project.
276
283
277
284
```hcl
278
285
variable "DatabaseName" {
@@ -307,6 +314,7 @@ In Git projects, [Octopus will continue apply variable permissions based on scop
307
314
## Slugs in OCL
308
315
309
316
The following resources will be referenced via their slug:
317
+
310
318
- Account
311
319
- Channel
312
320
- Deployment Action
@@ -325,7 +333,7 @@ All other resources will be referenced from OCL via their ID. We plan on growing
325
333
When designing the config-as-code feature, we made several decisions to keep an appropriate balance of usability and functionality. There are a few limitations and items of note you should be aware of with config-as-code.
326
334
327
335
- The Octopus Terraform Provider and OCL are not a 1:1 match. You cannot copy resources between the two and expect everything to work. We want to narrow the gap as much as possible, but as of right now, a gap exists.
328
-
- Octopus currently only supports connecting to Git repositories over HTTPS and not SSH.
336
+
- Octopus currently only supports connecting to Git repositories over HTTPS and not SSH.
329
337
- Shared resources (environments, external feeds, channels, etc.) are referenced by their slug from OCL. The API however will still use IDs.
330
338
- Shared resources referenced in OCL that no longer exist in Octopus Server will result in an error when loading through the portal or API. The provided error message should provide information indicating what reference is no longer valid and should be updated or removed before being loaded again.
331
339
- Shared resources must exist before loading an OCL file into Octopus Deploy. What that means is if you copy the OCL files from one Git repo to another, and point a new project at those files, then any shared resource must exist before creating that project. That only applies when projects are in different spaces or on different instances. If the resources do not exist, an error message will appear.
@@ -335,4 +343,4 @@ When designing the config-as-code feature, we made several decisions to keep an
335
343
## Older versions
336
344
337
345
- Prior to version 2022.3.4517, Git projects would reference shared resources using their name in OCL. This had a side-effect causing API responses for Git projects to contain names instead of IDs.
338
-
From version 2022.3.4517 onwards, a handful of resources are referenced from OCL by their slug. IDs will be used in API responses instead of names.
346
+
From version 2022.3.4517 onwards, a handful of resources are referenced from OCL by their slug. IDs will be used in API responses instead of names.
0 commit comments