diff --git a/README.md b/README.md index a183c23..e693da3 100644 --- a/README.md +++ b/README.md @@ -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@` 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 @@ -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: {} ``` diff --git a/env0.plugin.yaml b/env0.plugin.yaml index d4522d1..2e449ba 100644 --- a/env0.plugin.yaml +++ b/env0.plugin.yaml @@ -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" && diff --git a/test/env0.yaml b/test/env0.yaml index 1a0167d..1df156c 100644 --- a/test/env0.yaml +++ b/test/env0.yaml @@ -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