Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
BradLugo committed Dec 15, 2023
1 parent 0a800b6 commit 757db74
Showing 1 changed file with 2 additions and 45 deletions.
47 changes: 2 additions & 45 deletions scripts/ci/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -856,44 +856,6 @@ get_genesis_dump() {
unzip -d image/scanner/dump /tmp/vuln-dump/repo2cpe.zip
}

cleanup_image() {
if [[ -z "${OPENSHIFT_BUILD_NAME:-}" ]]; then
info "This is not an OpenShift build, will not reduce the image"
return
fi

info "Reducing the image size"

set +e
rm -rf /go/{bin,pkg}
rm -rf /root/{.cache,.npm}
rm -rf /usr/local/share/.cache
rm -rf .git
rm -rf image/scanner/bin
rm -rf image/scanner/rhel/THIRD_PARTY_NOTICES
set -e
}

build_bundle() {
# avoid a -dirty tag
info "Reset to remove Dockerfile modification by OpenShift CI"
git restore .
git status

info "Building Scanner binary"
make scanner-build-nodeps

info "Making THIRD_PARTY_NOTICES"
make ossls-notice

get_genesis_dump

info "Creating Scanner bundle"
image/scanner/rhel/create-bundle.sh image/scanner image/scanner/rhel

cleanup_image
}

generate_db_dump() {
info "Generating DB dump"

Expand All @@ -908,6 +870,8 @@ generate_db_dump() {
mkdir /tmp/postgres
pg_dump -U postgres postgres://127.0.0.1:5432 > /tmp/postgres/pg-definitions.sql
ls -lrt /tmp/postgres
gzip --best /tmp/postgres/pg-definitions.sql
ls -lrt /tmp/postgres
}

get_db_dump() {
Expand All @@ -923,13 +887,6 @@ get_db_dump() {
fi
}

build_db_bundle() {
get_db_dump

info "Creating scanner-db bundle.tar.gz"
image/db/rhel/create-bundle.sh image/db image/db/rhel
}

if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
if [[ "$#" -lt 1 ]]; then
die "When invoked at the command line a method is required."
Expand Down

0 comments on commit 757db74

Please sign in to comment.