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
Self-hosted GitLab environments lack ENV0_PR_SOURCE_REPOSITORY and
GITLAB_TOKEN. This adds fallbacks so the plugin works out of the box:
- Use ENV0_TEMPLATE_REPOSITORY to derive the GitLab API URL when
ENV0_PR_SOURCE_REPOSITORY is unavailable
- Accept ENV0_VCS_ACCESS_TOKEN as a fallback for GITLAB_TOKEN
- Construct a stable MR URL as --ticket-link so Overmind deduplicates
changes across multiple plans for the same merge request
- Strip trailing .git from repository URLs
Made-with: Cursor
Copy file name to clipboardExpand all lines: README.md
+50-18Lines changed: 50 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,21 +5,22 @@ This plugin integrates [Overmind](https://www.overmind.tech/) with env0 to track
5
5
## Overview
6
6
7
7
The Overmind plugin installs the Overmind CLI (and GitHub CLI) and executes one of four actions:
8
+
8
9
-**submit-plan**: Submits a Terraform plan to Overmind for analysis
9
10
-**start-change**: Marks the beginning of a change in Overmind
10
11
-**end-change**: Marks the completion of a change in Overmind
11
12
-**wait-for-simulation**: Retrieves simulation output from Overmind and comments on the relevant GitHub PR or GitLab MR
12
13
13
14
## Inputs
14
15
15
-
| Input | Description | Required |
16
-
|-------|-------------|----------|
17
-
|`action`| The action to perform. Must be one of: `submit-plan`, `start-change`, `end-change`, `wait-for-simulation`| Yes |
18
-
|`api_key`| Overmind API key for authentication. Must have the following scopes: `account:read`, `changes:write`, `config:write`, `request:receive`, `sources:read`, `source:write`| Yes |
19
-
|`tags`| A comma-separated list of key=value tags to attach to the change (only used with `submit-plan` action) | No |
20
-
|`post_comment`| Whether `wait-for-simulation` should post the Overmind markdown to GitHub PR or GitLab MR. Defaults to `true` when running against a PR/MR, otherwise `false`. When `true`, `comment_provider` must be set. | No |
21
-
|`comment_provider`| Where `wait-for-simulation` should post comments when `post_comment=true`. Must be one of: `github`, `gitlab`. | No |
22
-
|`on_failure`| Behavior when the plugin step errors. `fail` (default) fails the step and blocks the deployment; `pass` allows the deployment to continue even if this step errors. Must be one of: `fail`, `pass`. | No |
|`action`| The action to perform. Must be one of: `submit-plan`, `start-change`, `end-change`, `wait-for-simulation`| Yes|
19
+
|`api_key`| Overmind API key for authentication. Must have the following scopes: `account:read`, `changes:write`, `config:write`, `request:receive`, `sources:read`, `source:write`| Yes|
20
+
|`tags`| A comma-separated list of key=value tags to attach to the change (only used with `submit-plan` action) | No|
21
+
|`post_comment`| Whether `wait-for-simulation` should post the Overmind markdown to GitHub PR or GitLab MR. Defaults to `true` when running against a PR/MR, otherwise `false`. When `true`, `comment_provider` must be set. | No|
22
+
|`comment_provider`| Where `wait-for-simulation` should post comments when `post_comment=true`. Must be one of: `github`, `gitlab`. | No|
23
+
|`on_failure`| Behavior when the plugin step errors. `fail` (default) fails the step and blocks the deployment; `pass` allows the deployment to continue even if this step errors. Must be one of: `fail`, `pass`. | No|
23
24
24
25
## Usage
25
26
@@ -105,7 +106,7 @@ deploy:
105
106
inputs:
106
107
action: wait-for-simulation
107
108
api_key: ${OVERMIND_API_KEY}
108
-
post_comment: false # optional override
109
+
post_comment: false # optional override
109
110
```
110
111
111
112
If you want to post a comment, set `comment_provider` explicitly:
@@ -140,17 +141,48 @@ deploy:
140
141
comment_provider: gitlab
141
142
```
142
143
143
-
### Fail-safe: allow deployment to continue on plugin errors
144
+
### Self-Hosted GitLab
144
145
145
-
By default, if the plugin step fails (e.g. Overmind API error, missing env var, network issue), env0 treats the step as failed and can block the deployment. To allow the deployment to continue even when this step errors, set `on_failure: pass`:
146
+
For self-hosted GitLab environments where `ENV0_PR_SOURCE_REPOSITORY` is not available, the plugin falls back to `ENV0_TEMPLATE_REPOSITORY` to derive the GitLab API URL for posting merge request comments.
147
+
148
+
For authentication, the plugin uses `GITLAB_TOKEN` if set, otherwise falls back to `ENV0_VCS_ACCESS_TOKEN`. The token must have the GitLab `api` scope to post MR comments.
146
149
147
150
```yaml
151
+
version: 2
152
+
deploy:
153
+
steps:
154
+
terraformPlan:
155
+
after:
148
156
- name: Submit Plan to Overmind
149
-
use: https://github.com/your-org/env0-plugin
157
+
use: https://github.com/overmindtech/env0-plugin
150
158
inputs:
151
159
action: submit-plan
152
160
api_key: ${OVERMIND_API_KEY}
153
-
on_failure: pass # deployment continues even if this step fails
161
+
162
+
terraformApply:
163
+
after:
164
+
- name: Post Overmind Simulation (Self-Hosted GitLab)
165
+
use: https://github.com/overmindtech/env0-plugin
166
+
inputs:
167
+
action: wait-for-simulation
168
+
api_key: ${OVERMIND_API_KEY}
169
+
post_comment: true
170
+
comment_provider: gitlab
171
+
```
172
+
173
+
No `GITLAB_TOKEN` is needed if `ENV0_VCS_ACCESS_TOKEN` is already available in your env0 environment.
174
+
175
+
### Fail-safe: allow deployment to continue on plugin errors
176
+
177
+
By default, if the plugin step fails (e.g. Overmind API error, missing env var, network issue), env0 treats the step as failed and can block the deployment. To allow the deployment to continue even when this step errors, set `on_failure: pass`:
178
+
179
+
```yaml
180
+
- name: Submit Plan to Overmind
181
+
use: https://github.com/your-org/env0-plugin
182
+
inputs:
183
+
action: submit-plan
184
+
api_key: ${OVERMIND_API_KEY}
185
+
on_failure: pass # deployment continues even if this step fails
154
186
```
155
187
156
188
Use `on_failure: pass` when the Overmind integration is optional and you do not want plugin failures to block deployments.
@@ -170,7 +202,7 @@ deploy:
170
202
inputs:
171
203
action: submit-plan
172
204
api_key: ${OVERMIND_API_KEY}
173
-
205
+
174
206
terraformApply:
175
207
before:
176
208
- name: Mark Change Started
@@ -198,7 +230,7 @@ deploy:
198
230
- `end-change`: Marks the completion of a change with a ticket link to the env0 deployment
199
231
- `wait-for-simulation`: Retrieves Overmind simulation results as Markdown and (when `post_comment=true`) posts them to the GitHub PR or GitLab MR (automatically detected based on repository URL)
200
232
201
-
4. **Ticket Links**: All actions automatically construct a ticket link to the env0 deployment using environment variables (`ENV0_PROJECT_ID`, `ENV0_ENVIRONMENT_ID`, `ENV0_DEPLOYMENT_LOG_ID`, `ENV0_ORGANIZATION_ID`).
233
+
4. **Ticket Links**: When `ENV0_PR_NUMBER` is set (i.e., the deployment is triggered by a PR/MR), the plugin constructs a stable merge request URL from `ENV0_PR_SOURCE_REPOSITORY` (or `ENV0_TEMPLATE_REPOSITORY` as a fallback) and `ENV0_PR_NUMBER`. This ensures multiple plans for the same MR update the same Overmind change. For non-PR deployments, the ticket link falls back to the env0 deployment URL.
202
234
203
235
## Requirements
204
236
@@ -209,7 +241,7 @@ deploy:
209
241
- `ENV0_ORGANIZATION_ID`
210
242
- `ENV0_TF_PLAN_JSON`(for submit-plan action)
211
243
- `ENV0_PR_NUMBER`(only when `wait-for-simulation` posts comments, i.e., running against a PR/MR)
212
-
- `ENV0_PR_SOURCE_REPOSITORY`(only when `wait-for-simulation` posts comments, used to detect GitHub vs GitLab)
244
+
- `ENV0_PR_SOURCE_REPOSITORY`(only when `wait-for-simulation` posts commentsto GitHub; for GitLab, falls back to `ENV0_TEMPLATE_REPOSITORY`)
213
245
214
246
- A valid Overmind API key with the following required scopes:
215
247
- `account:read`
@@ -220,7 +252,7 @@ deploy:
220
252
- `source:write`
221
253
222
254
- GitHub authentication for the CLI when `wait-for-simulation` posts to GitHub (set `GH_TOKEN`).
223
-
- GitLab authentication when `wait-for-simulation` posts to GitLab (set `GITLAB_TOKEN`).
255
+
- GitLab authentication when `wait-for-simulation` posts to GitLab (set `GITLAB_TOKEN`, or rely on `ENV0_VCS_ACCESS_TOKEN` which is automatically available in self-hosted GitLab environments). The token must have the GitLab `api` scope.
224
256
225
257
### Creating a `GH_TOKEN`
226
258
@@ -242,9 +274,9 @@ deploy:
242
274
5. Store the token securely in env0 (for example as an environment variable or secret) and expose it to the plugin as `GITLAB_TOKEN`.
243
275
244
276
**Note**: When `post_comment=true`, you must set `comment_provider` to `github` or `gitlab`.
277
+
245
278
## Notes
246
279
247
280
- The plugin automatically detects the operating system and architecture to download the correct Overmind CLI binary.
248
281
- The installation directory is automatically selected from writable directories in your PATH.
249
282
- For the `submit-plan` action, the `ENV0_TF_PLAN_JSON` environment variable must be set (this is automatically provided by env0 after a terraform plan step).
0 commit comments