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

add release procedure using goreleaser #75

Merged
merged 5 commits into from
May 6, 2020
Merged

add release procedure using goreleaser #75

merged 5 commits into from
May 6, 2020

Conversation

itaysk
Copy link
Collaborator

@itaysk itaysk commented May 3, 2020

This PR is introducing a GoReleaser workflow that build tracee binary and Docker image, and can push them to GitHub/DockerHub.
related to: #69

GoReleaser is a popular tool for Go projects, and we (aqua) use it in our other OSS Go projects, so we wanted to see if we can use it here as well. It works, but there are a couple of points to consider:

  1. The binary build needs the EBPFPROGRAM_BASE64 environment variable. I didn't find a way to define this in the goreleaser yaml, so I create it in the makefile, meaning GoReleaser must be called through the makefile which is awkward solution but was the compromise I found.
  2. In a previous PR I introduced a Dockerfile that builds binary and then created a final image using it (multistage dockerfile). But if we're using goreleaser, then goreleaser should build the binary (not the docker builder). In order to accommodate both approaches, I created a new dockerfile for goreleaser which is not building the binary.

Essentially this is about supporting 3 partially overlapping tools for build automation: Makefile/Docker/GoReleaser. I tried to find a middleground between them, let me know if you think it's reasonable.

@itaysk itaysk requested review from yanivagman and simar7 and removed request for yanivagman May 4, 2020 11:50
Comment on lines +20 to +22
ifdef publish
goreleaserFlags =
endif
Copy link
Member

Choose a reason for hiding this comment

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

for my own understanding: how does this work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wanted to be extra careful with actually pushing things, so I created the goreleaserFlags make variable that defaults to --skip-publish --snapshot (which assures nothing scary is done), and the command that is run is appending this variable to the goreleaser command (line 24). but if the use defines the publish make variable (it can have any value, 1 is just an example) then the variable goreleaserFlags variable is emptied so nothing is appended to the goreleaser command, and the defaults are to publish.

@itaysk itaysk merged commit 0fcfd26 into aquasecurity:master May 6, 2020
@itaysk itaysk deleted the release branch May 6, 2020 16:55
pathtofile pushed a commit to pathtofile/tracee that referenced this pull request Oct 21, 2020
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.

None yet

2 participants