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

Update build.sh #36241

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update build.sh #36241

wants to merge 1 commit into from

Conversation

Pterjudin
Copy link

@Pterjudin Pterjudin commented Dec 20, 2024

This PR refactors the Terraform build script to improve maintainability, readability, and error handling. Key changes include:

  • Replacing redundant code blocks with reusable functions for consistency and simplicity.
  • Adding robust error handling to prevent unintended behavior, such as halting execution on directory navigation failure.
  • Enhancing portability by replacing which with command -v for environment checks.
  • Organizing the script into logical sections with clear comments, improving readability for future maintainers.
  • Ensuring directories like GOPATH/bin are created dynamically, avoiding runtime errors.
  • Streamlining the packaging process with recursive zipping for all platform builds.

These changes enhance the developer experience, ensure a consistent build process, and reduce the risk of errors during multi-platform builds.

Target Release

1.11.x

Draft CHANGELOG entry

ENHANCEMENTS

  • Refactored the Terraform build script for improved readability, maintainability, and error handling.
  • Enhanced portability by replacing which with command -v for environment checks.
  • Improved error handling for directory navigation and missing directories during builds.
  • Streamlined the multi-platform packaging process with recursive zipping of build outputs.

@Pterjudin Pterjudin requested a review from a team as a code owner December 20, 2024 00:27
Copy link

hashicorp-cla-app bot commented Dec 20, 2024

CLA assistant check
All committers have signed the CLA.

@crw
Copy link
Contributor

crw commented Dec 20, 2024

Hi @Pterjudin, to set expectations, we do not normally accept outside contributions to build scripts. Can you say something about what motivated this change?

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.

2 participants