Skip to content

Commit

Permalink
Build generator directly rather than downloading it
Browse files Browse the repository at this point in the history
`stolostron` doesn't have releases like upstream does.

Signed-off-by: Dale Haiducek <[email protected]>
  • Loading branch information
dhaiducek committed Jan 3, 2024
1 parent 018c29b commit cf1dbbb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
deploy/manifests.yaml
.idea
bin
schemas
policy-generator-plugin
8 changes: 5 additions & 3 deletions build/validate-policies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ GO111MODULE=on go install sigs.k8s.io/kustomize/kustomize/v4@$KUSTOMIZE_VERSION
export KUSTOMIZE_PLUGIN_HOME=${GOBIN}
echo "Downloading the generator"
PLATFORM=`uname | tr '[:upper:]' '[:lower:]'`
curl -Ls -o generator https://github.com/${GITHUB_REPOSITORY_OWNER}/policy-generator-plugin/releases/latest/download/${PLATFORM}-amd64-PolicyGenerator
chmod a+x generator
git clone --depth=1 https://github.com/${GITHUB_REPOSITORY_OWNER}/policy-generator-plugin
( cd policy-generator-plugin; make build-binary )
chmod a+x policy-generator-plugin/PolicyGenerator
mkdir -p ${KUSTOMIZE_PLUGIN_HOME}/${GENERATOR_PATH}
mv generator ${KUSTOMIZE_PLUGIN_HOME}/${GENERATOR_PATH}/PolicyGenerator
mv policy-generator-plugin/PolicyGenerator ${KUSTOMIZE_PLUGIN_HOME}/${GENERATOR_PATH}/PolicyGenerator

# Validate the generator projects

Expand All @@ -95,5 +96,6 @@ validatePolicySets community

# Cleanup
rm -rf schemas
rm -rf policy-generator-plugin

# Done

0 comments on commit cf1dbbb

Please sign in to comment.