diff --git a/scripts/bundle.sh b/scripts/bundle.sh index de7f1ae7..d39686ba 100755 --- a/scripts/bundle.sh +++ b/scripts/bundle.sh @@ -10,13 +10,18 @@ if [ -n "$GITHUB_ENV" ]; then echo "MINOR_VERSION=$MINOR_VERSION" >> $GITHUB_ENV echo "MAJOR_VERSION=$MAJOR_VERSION" >> $GITHUB_ENV fi -mkdir -p bundle/policies/{kubernetes,cloud,docker}/policies -rsync -avr --exclude=README.md --exclude="*_test.rego" --exclude="*.go" --exclude=compliance --exclude=test --exclude=advanced checks/cloud/ bundle/policies/cloud/policies -rsync -avr --exclude=README.md --exclude="*_test.rego" --exclude="*.go" --exclude=compliance --exclude=test --exclude=advanced checks/kubernetes/ bundle/policies/kubernetes/policies -rsync -avr --exclude=README.md --exclude="*_test.rego" --exclude="*.go" --exclude=compliance --exclude=test --exclude=advanced checks/docker/ bundle/policies/docker/policies -mkdir -p bundle/policies/{kubernetes,docker}/lib -rsync -avr --exclude="*_test.rego" --exclude="*.go" lib/kubernetes/* bundle/policies/kubernetes/lib -rsync -avr --exclude="*_test.rego" --exclude="*.go" lib/docker/* bundle/policies/docker/lib + +for dir in kubernetes cloud docker; do + mkdir -p bundle/policies/$dir/policies + rsync -avr --exclude=README.md --exclude="*_test.rego" --exclude="*.go" --exclude=compliance --exclude=test checks/$dir/ bundle/policies/$dir/policies +done + + +for dir in kubernetes docker; do + mkdir -p bundle/policies/$dir/lib + rsync -avr --exclude="*_test.rego" --exclude="*.go" lib/$dir/* bundle/policies/$dir/lib +done + cp checks/.manifest bundle/ rm bundle/policies/.manifest sed -i -e "s/\[GITHUB_SHA\]/${RELEASE_VERSION}/" bundle/.manifest