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

[CLI] Don't create a temp workspace on CI #219

Merged
merged 1 commit into from
Nov 8, 2023
Merged

[CLI] Don't create a temp workspace on CI #219

merged 1 commit into from
Nov 8, 2023

Conversation

jhnstn
Copy link
Member

@jhnstn jhnstn commented Nov 8, 2023

Fixes #174

We won't need a temp directory on a CI assuming we are spinning up a new VM on each run (like what happens on Github Workflows)

Instead we can just use the directory set up by the CI to run the commands.

This adds a check for the CI env before creating a temp directory. Since a temp directory is not created, nothing is deleted after the command runs

Testing

  • Create a build to some empty directory e.g. go build ~/some-test-directory/gbm-cli
  • cd into that directory and create a new empty directory gb
  • From the directory created in the last step run CI=true ../gbm-cli release prepare gb {version} --no-tag
  • Notice a message about not creating a temp directory
  • Exit before creating the PR
  • Note that Gutenberg is cloned to the current directory
  • Verify that nothing was deleted at the end of the command run

Copy link
Contributor

@derekblank derekblank left a comment

Choose a reason for hiding this comment

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

LGTM - was able to follow the testing command sucessfully. 🚀

@jhnstn jhnstn merged commit 98d48a7 into trunk Nov 8, 2023
2 checks passed
@jhnstn jhnstn deleted the cli/ci-flag branch November 8, 2023 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI: Update how we handle cleaning up the temp directories
2 participants