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: build command #24

Merged
merged 8 commits into from
Sep 17, 2021
Merged

feat: build command #24

merged 8 commits into from
Sep 17, 2021

Conversation

f0rmiga
Copy link
Contributor

@f0rmiga f0rmiga commented Sep 17, 2021

Description

Introduces the aspect build command that performs a simple bazel build without any flags.

Test plan

  1. Build the aspect CLI.
  2. Run aspect build //....

Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
docs/aspect_build.md Outdated Show resolved Hide resolved
Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
This allows `go mod tidy` to run successfully while keeping Gazelle
happy.

Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
cmd/aspect/build/build.go Outdated Show resolved Hide resolved
pkg/aspect/build/build.go Outdated Show resolved Hide resolved
pkg/bazel/mock/BUILD.bazel Show resolved Hide resolved
Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
Comment on lines +39 to +40
SilenceUsage: true,
SilenceErrors: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexeagle I'm not entirely sure if we want this here at the root cmd or not. I'd be tempted to leave it in the root for now and see how other commands interact with it. Just something to be aware of.

cc @mattem

Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
pkg/aspect/build/build_test.go Show resolved Hide resolved
Not licensed for re-use.
*/

package aspecterrors
Copy link
Member

Choose a reason for hiding this comment

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

don't we have to change the Bazel Spawner interface to return this error type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. The ExitError satisfies the default error interface. The change I made to the main func checks whether the error contains the exit code or not. Also, we cannot change the signature of the Run method since it has to match the signature defined by cobra for the RunE field in the Command struct.

Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
@f0rmiga f0rmiga merged commit 84ed1ce into main Sep 17, 2021
@f0rmiga f0rmiga deleted the build-command branch September 17, 2021 17:10
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.

2 participants