Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

run README build and deploy commands through bash shell (fix #21) #24

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

SaketramDurbha
Copy link
Contributor

Runs build and deploy commands through the Bash shell.

Support for more shells to come.

Will rebase and update once #22 is merged.

Saketram Durbha added 2 commits August 11, 2020 16:31
- change code tag from sst-run-unix -> sst-run-bash
- variable name in lifecycle/readme.go
- readme parsing section in README.md
@SaketramDurbha
Copy link
Contributor Author

This PR fixes issue #21, by the way.

@SaketramDurbha SaketramDurbha self-assigned this Aug 14, 2020
internal/lifecycle/readme.go Outdated Show resolved Hide resolved
internal/lifecycle/readme.go Outdated Show resolved Hide resolved
@SaketramDurbha SaketramDurbha changed the title run README build and deploy commands through bash shell (fixes #21) run README build and deploy commands through bash shell (fix #21) Aug 17, 2020
@SaketramDurbha SaketramDurbha linked an issue Aug 18, 2020 that may be closed by this pull request
@SaketramDurbha SaketramDurbha requested review from tritone and grayside and removed request for tritone August 18, 2020 21:14
README.md Outdated
pipelines, redirections or any other functions that shells are responsible for. This also means that popular shell
builtin commands like `cd`, `export`, and `echo` will not be available or may not work as expected.
The parsed commands will be run through the Bash shell, but each command will be run through a separate instance
of the shell, meaning that commands such as `cd` or `export` may not work as expected.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify how users are supposed to do control dir of execution or env variables, then? Can I chain commands via && for example?

Copy link
Contributor Author

@SaketramDurbha SaketramDurbha Aug 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your comment.

For environment variables, each command's process will uses the environment of the process from which users execute our program. So environment variables they have set in their shell where they call sst will be available for the commands that they write in their README. I'm going to adding a comment in our README to clarify this.

For the directory of execution, we're not currently supporting the option for users to control the directory where their README commands are executed; all commands will be executed in the sample's root directory (I going to a comment in our README to clarify this as well). But we're going to open an issue for this feature to make sure that it's tracked.

However, as you mentioned, you are able to get around this by chaining commands together, like cd .. && ls. But
I think we're not going to put this in our documentation because we believe a more permanent solution is preferred, and since each command is run in it's own separate instance of a shell, so you would have to chain each where you want a directory command with a cd.

Hope this makes sense. Did this answer your questions?

internal/lifecycle/readme.go Outdated Show resolved Hide resolved
@SaketramDurbha SaketramDurbha requested review from tritone and grayside and removed request for grayside August 19, 2020 21:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shell for running README parsing build and deplpy commands
4 participants