Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add env_vars as input to run_sh #2114

Merged
merged 13 commits into from Feb 5, 2024
Merged

Conversation

adschwartz
Copy link
Contributor

Description:

This change adds env_vars to the run_sh. Feature was requested in issue #2050. Example of used in practice:

def run(plan, args={}):
    result = plan.run_sh(
        run = "mkdir -p kurtosis && echo $EXAMPLE",
        image = "badouralix/curl-jq",
        env_vars = {
            "EXAMPLE": "this_is_a_test"
        },
    )

outputs:

Container images used in this run:
> badouralix/curl-jq - locally cached

> run_sh run="mkdir -p kurtosis && echo $EXAMPLE" image="badouralix/curl-jq" env_vars={"EXAMPLE": "this_is_a_test"}
Command returned with exit code '0' and the following output:
--------------------
this_is_a_test

--------------------

Starlark code successfully run. No output was returned.

Is this change user facing?

YES

References (if applicable):

Closes: #2050

Copy link

cloudflare-pages bot commented Feb 3, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: de73987
Status: ✅  Deploy successful!
Preview URL: https://9f9a3adf.kurtosis-docs.pages.dev
Branch Preview URL: https://anders-env-var-run-sh.kurtosis-docs.pages.dev

View logs

@adschwartz adschwartz added this pull request to the merge queue Feb 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 5, 2024
@adschwartz adschwartz added this pull request to the merge queue Feb 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 5, 2024
@adschwartz adschwartz added this pull request to the merge queue Feb 5, 2024
Merged via the queue into main with commit 5a30ea7 Feb 5, 2024
38 checks passed
@adschwartz adschwartz deleted the anders/env_var_run_sh branch February 5, 2024 22:05
github-merge-queue bot pushed a commit that referenced this pull request Feb 5, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.86.13](0.86.12...0.86.13)
(2024-02-05)


### Features

* add `env_vars` as input to `run_sh`
([#2114](#2114))
([5a30ea7](5a30ea7)),
closes [#2050](#2050)
* add nodejs devtools to Nix
([#2099](#2099))
([7bbb2bc](7bbb2bc))
* add run docker compose with kurtosis guide
([#2085](#2085))
([7bbe479](7bbe479))
* Add RunStarlarkScript to enclave manager API
([#2103](#2103))
([1eeb3eb](1eeb3eb))


### Bug Fixes

* adding the `core script build call`, which was removed by accident, in
the main build script
([#2118](#2118))
([1f73821](1f73821))
* Fix calls to stacktrace in the reverse proxy module
([#2100](#2100))
([a7fefc2](a7fefc2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: kurtosisbot <kurtosisbot@users.noreply.github.com>
Co-authored-by: Anders Schwartz <adschwartz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pass env to run_sh
3 participants