Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The plugin uses the env0 API to fetch the output values from another environment

The plugin downloads a prebuilt binary for the agent architecture (`amd64` or `arm64`) from the [GitHub releases](https://github.com/env0/env0-import-variable-plugin/releases) and verifies its SHA-256 checksum. It does not install Go. If the download fails, the plugin installs Go and builds the binary from source.

Use `use: https://github.com/env0/env0-import-variable-plugin` in your custom flow to get this behavior. If you copied the old plugin script into your `env0.yaml`, replace it with `use:`.
Use `use: https://github.com/env0/env0-import-variable-plugin@<version>` in your custom flow to get this behavior, with the latest version from the [releases](https://github.com/env0/env0-import-variable-plugin/releases). If you copied the old plugin script into your `env0.yaml`, replace it with `use:`.

## Example Usage

Expand All @@ -76,7 +76,7 @@ deploy:
terraformPlan:
before:
- name: Import Variables # The name that will be presented in the UI for this step
use: https://github.com/env0/env0-import-variable-plugin
use: https://github.com/env0/env0-import-variable-plugin@0.5.1
inputs: {}

```
Expand Down
6 changes: 3 additions & 3 deletions env0.plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ run:
arch="$(plugin_arch)" || return 1
binary="import-variable-plugin_linux_$arch"
download_dir="$(mktemp -d)"
curl -fsSL --retry 3 -o "$download_dir/$binary" "$(release_url "$binary")" &&
curl -fsSL --retry 3 -o "$download_dir/importVariables.sh" "$(release_url importVariables.sh)" &&
curl -fsSL --retry 3 -o "$download_dir/checksums.txt" "$(release_url checksums.txt)" &&
curl -fsSL --retry 3 --connect-timeout 10 --max-time 120 -o "$download_dir/$binary" "$(release_url "$binary")" &&
curl -fsSL --retry 3 --connect-timeout 10 --max-time 120 -o "$download_dir/importVariables.sh" "$(release_url importVariables.sh)" &&
curl -fsSL --retry 3 --connect-timeout 10 --max-time 120 -o "$download_dir/checksums.txt" "$(release_url checksums.txt)" &&
verify_checksum "$download_dir" "$binary" &&
verify_checksum "$download_dir" importVariables.sh &&
chmod +x "$download_dir/$binary" "$download_dir/importVariables.sh" &&
Expand Down
3 changes: 2 additions & 1 deletion test/env0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ deploy:
setupVariables:
after:
- name: Import Variables
use: https://github.com/env0/env0-import-variable-plugin
run: |
sed -n '/^ exec: |$/,$p' "$ENV0_ROOT_DIR/env0.plugin.yaml" | tail -n +2 | sed 's/^ //' | bash
terraformOutput:
after:
- name: Test Outputs
Expand Down
Loading