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

Publish Gator CLI binaries in release #1636

Merged
merged 4 commits into from
Nov 4, 2021

Conversation

sozercan
Copy link
Member

@sozercan sozercan commented Nov 3, 2021

Signed-off-by: Sertac Ozercan sozercan@gmail.com

What this PR does / why we need it:
Publishes Gator CLI binaries to release

Credits to @chewong for the original code

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
Fixes #

Special notes for your reviewer:

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2021

Codecov Report

Merging #1636 (356dd38) into master (c2844a6) will increase coverage by 0.12%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1636      +/-   ##
==========================================
+ Coverage   52.66%   52.79%   +0.12%     
==========================================
  Files         100      100              
  Lines        8540     8540              
==========================================
+ Hits         4498     4509      +11     
+ Misses       3684     3676       -8     
+ Partials      358      355       -3     
Flag Coverage Δ
unittests 52.79% <ø> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...onstrainttemplate/constrainttemplate_controller.go 59.28% <0.00%> (+1.66%) ⬆️
pkg/watch/replay.go 81.25% <0.00%> (+2.27%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 23b4165...356dd38. Read the comment docs.

@sozercan sozercan requested a review from a team November 3, 2021 17:56
cp bin/gator-${GOOS}-${GOARCH}${EXTENSION} ${tmp_dir}/gator${EXTENSION}
pushd ${tmp_dir}
if [[ ${EXTENSION} == ".exe" ]]; then
zip ${GITHUB_WORKSPACE}/_dist/gator-${TAG}-${GOOS}-${GOARCH}.zip gator*.exe
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: putting ${GITHUB_WORKSPACE}/_dist/gator-${TAG}-${GOOS}-${GOARCH} into a would make the differences between these lines more obvious

# rename the binary to gator
tmp_dir=$(mktemp -d)
cp bin/gator-${GOOS}-${GOARCH}${EXTENSION} ${tmp_dir}/gator${EXTENSION}
pushd ${tmp_dir}
Copy link
Contributor

Choose a reason for hiding this comment

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

A way to make this simpler: skip the pushd, popd and move the rm command into a trap. Like so:

tmp_dir=$(mktemp -d)
trap 'rm -rf -- "${tmp_dir}"' EXIT

All that aside... Isn't this environment ephemeral? Perhaps we don't need to clean up at all?

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

LGTM

@sozercan sozercan merged commit 87cb662 into open-policy-agent:master Nov 4, 2021
@sozercan sozercan deleted the publish-gator branch November 4, 2021 21:03
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.

4 participants