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: src/pages/docs/projects/variables/system-variables.md
+60-54Lines changed: 60 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
layout: src/layouts/Default.astro
3
3
pubDate: 2023-01-01
4
-
modDate: 2025-05-12
4
+
modDate: 2026-03-06
5
5
title: System variables
6
6
icon: fa-solid fa-desktop
7
7
description: System variables are variables provided by Octopus that can be used in your deployments.
@@ -10,7 +10,7 @@ navOrder: 20
10
10
11
11
This page lists built-in [variables](/docs/projects/variables/) provided by Octopus that can be used in your deployment [custom scripts](/docs/deployments/custom-scripts).
12
12
13
-
Most of the variables listed here are available in modern versions of Octopus and Calamari. However, some are only available from a specific version. See [Older versions](#older-versions) for more detail on when variables became available.
13
+
Most of the variables listed here are available in modern versions of Octopus and Calamari. However, some are only available from a specific version. See [Older versions](#older-versions) for more detail on when variables became available.
14
14
15
15
:::div{.warning}
16
16
**All variables are strings**
@@ -62,12 +62,12 @@ Packages, including changes, associated with the release. See below. This is a c
62
62
63
63
Build and version control details associated with the release. This is a collection.
64
64
65
-
:::div{.hint}
65
+
:::div{.hint}
66
66
67
67
The `Octopus.Release.Package` and `Octopus.Release.Builds` variables:
68
68
69
-
* will only be populated if [build information](/docs/packaging-applications/build-servers/build-information) has been pushed from the build server.
70
-
* is only available to be used by the project [release notes](/docs/releases/release-notes), it is not accessible from the project deployment steps.
69
+
- will only be populated if [build information](/docs/packaging-applications/build-servers/build-information) has been pushed from the build server.
70
+
- is only available to be used by the project [release notes](/docs/releases/release-notes), it is not accessible from the project deployment steps.
71
71
72
72
:::
73
73
@@ -101,30 +101,30 @@ public class Commit
101
101
102
102
The packages in a release are available as a collection which can be [iterated over](/docs/projects/variables/variable-substitutions/#repetition). e.g.
103
103
104
-
```
104
+
```text
105
105
#{each package in Octopus.Release.Package}
106
106
This release contains #{package.PackageId} #{package.Version}
107
107
#{/each}
108
108
```
109
109
110
110
A particular package can be selected by indexing on the package ID:
111
111
112
-
```
112
+
```text
113
113
#{Octopus.Release.Package[Acme.Web].Version}
114
114
```
115
115
116
116
The variables available for packages are:
117
117
118
-
| Name | Example|
119
-
| --------------------|-------|
120
-
|`PackageId`|`#{package.PackageId}`|
121
-
|`Version`|`#{package.Version}`|
122
-
|`Commits`| This is a collection. See below. |
123
-
|`WorkItems`| This is a collection. See below. |
118
+
| Name | Example|
119
+
| -----------|--------------------------------- |
120
+
|`PackageId`|`#{package.PackageId}`|
121
+
|`Version`|`#{package.Version}`|
122
+
|`Commits`| This is a collection. See below. |
123
+
|`WorkItems`| This is a collection. See below. |
124
124
125
125
On each package, the commits associated with that package are available as a collection which can be iterated over. e.g.:
If the Octopus instance has one or more of the [Issue Tracker integrations](/docs/releases/issue-tracking) enabled, the commit messages will be parsed for issues. Any issues found will be displayed with the build information, and also available as variables:
150
150
151
-
```
151
+
```text
152
152
#{each issue in package.WorkItems}
153
153
- [#{issue.Id}](#{issue.LinkUrl})
154
154
#{/each}
155
155
```
156
156
157
157
A particular issue can be selected by indexing on the ID:
158
158
159
-
```
159
+
```text
160
160
package.WorkItems[4465].LinkUrl
161
161
```
162
162
163
163
The variables available for issues are:
164
164
165
-
| Name | Example|
166
-
| --------------------|-------|
167
-
|`Id`|`#{issue.Id}`|
168
-
|`LinkUrl`|`#{issue.LinkUrl}`|
165
+
| Name | Example|
166
+
| ---------|------------------|
167
+
|`Id`|`#{issue.Id}`|
168
+
|`LinkUrl`|`#{issue.LinkUrl}`|
169
169
170
170
There is also a distinct list of issues across all packages available in:
For projects that have [version control](/docs/projects/version-control) enabled, information about the branch and commit from which the release was created is also available.
The ID of the Trigger that created the deployment. It is possible for a deployment to be triggered due to multiple triggers. In this case, the variable will contain the ID of _one_ of the triggers.
435
+
The ID of the Trigger that created the deployment. It is possible for a deployment to be triggered due to multiple triggers. In this case, the variable will contain the ID of *one* of the triggers.
436
436
437
437
Example: *ProjectTriggers-522*
438
438
439
439
`Octopus.Deployment.Trigger.Name`
440
440
441
-
The name of the Trigger that created the deployment. It is possible for a deployment to be triggered due to multiple triggers. In this case, the variable will contain the name of _one_ of the triggers.
441
+
The name of the Trigger that created the deployment. It is possible for a deployment to be triggered due to multiple triggers. In this case, the variable will contain the name of *one* of the triggers.
442
442
443
-
*Nightly Deploy to Dev*
443
+
Example: *Nightly Deploy to Dev*
444
444
445
445
`Octopus.Deployment.WorkerLeaseCap`
446
446
@@ -748,11 +748,12 @@ public class CommitDetails
748
748
publicstringComment { get; set; }
749
749
}
750
750
```
751
+
751
752
There is an entry per release and it includes the release notes (**in markdown format**) and the build information for each of the packages in that release.
752
753
753
754
**Example:** The following iterates the changes in the deployment, printing the release version and the issues contained.
754
755
755
-
```
756
+
```text
756
757
#{each change in Octopus.Deployment.Changes}
757
758
#{change.Version}
758
759
#{each issue in change.WorkItems}
@@ -907,6 +908,12 @@ The syntax of the script being run in a script step.
907
908
908
909
Example: *PowerShell*
909
910
911
+
`Octopus.Action.Script.CSharp.NuGetSource`
912
+
913
+
Overrides the NuGet source used by the dotnet executor when running C# script steps.
914
+
915
+
Example: *<https://my-nuget-server/nuget>*
916
+
910
917
`Octopus.Action.SkipRemainingConventions`
911
918
912
919
If set by the user, completes processing of the action without running further conventions/scripts *(Boolean)*. This should be set as an [output variable](/docs/projects/variables/output-variables). e.g. <br /> `Set-OctopusVariable -name 'Octopus.Action.SkipRemainingConventions' -value 'True'`
@@ -1109,7 +1116,7 @@ Example: *True*
1109
1116
1110
1117
The Storage URI of the \*.cspkg file that will be deployed to the Cloud Service.
The amount (in megabytes) of available free disk space we should check for (overriding the default 500MB), failing the deployment if not enough free disk space is available.
1489
+
The amount (in megabytes) of available free disk space we should check for (overriding the default 500MB), failing the deployment if not enough free disk space is available.
1484
1490
1485
1491
Example: 100
1486
1492
1487
-
1488
1493
`OctopusShouldFailDeploymentOnSubstitutionFails`
1489
1494
1490
1495
If set to "True", the deployment will fail if any variable substitution fails. This variable was added in Octopus 2025.1.0.
To suppress/disable the environment logging that occurs from script (eg. PowerShell or Bash Script Environment Variables logging). This only suppresses script logging and does not suppress the Octopus or Calamari environment logging.
1513
+
To suppress/disable the environment logging that occurs from script (eg. PowerShell or Bash Script Environment Variables logging). This only suppresses script logging and does not suppress the Octopus or Calamari environment logging.
1509
1514
1510
1515
Example: True
1511
1516
@@ -1523,7 +1528,7 @@ Example: True
1523
1528
1524
1529
`Octopus.Action.Package.RunScripts`
1525
1530
1526
-
Set to `false` to prevent scripts inside packages from executing.
1531
+
Set to `false` to prevent scripts inside packages from executing.
1527
1532
1528
1533
Example: True
1529
1534
@@ -1549,9 +1554,10 @@ Octopus will run one task at a time for a given concurrency tag. Set the variabl
*`Octopus.Release.Git.BranchName`, `Octopus.Release.Git.CommitHash` and `Octopus.Release.Git.Ref` is available from Octopus Deploy **2021.3** onwards.
1553
-
*`Octopus.Web.ServerUri` is available from Octopus Deploy **2019.4.0** onwards.
1554
-
*`Octopus.Deployment.Tenant.Id`, `Octopus.Deployment.Tenant.Name` and `Octopus.Deployment.Tenant.Tags` is available from Octopus Deploy **3.4** onwards.
1557
+
1558
+
-`Octopus.Release.Git.BranchName`, `Octopus.Release.Git.CommitHash` and `Octopus.Release.Git.Ref` is available from Octopus Deploy **2021.3** onwards.
1559
+
-`Octopus.Web.ServerUri` is available from Octopus Deploy **2019.4.0** onwards.
1560
+
-`Octopus.Deployment.Tenant.Id`, `Octopus.Deployment.Tenant.Name` and `Octopus.Deployment.Tenant.Tags` is available from Octopus Deploy **3.4** onwards.
0 commit comments