From 757db7467a37ab96822afd7c54da71139b57f193 Mon Sep 17 00:00:00 2001 From: Brad Lugo Date: Fri, 15 Dec 2023 00:58:07 -0800 Subject: [PATCH] WIP --- scripts/ci/lib.sh | 47 ++--------------------------------------------- 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/scripts/ci/lib.sh b/scripts/ci/lib.sh index 4cf647328..981392551 100755 --- a/scripts/ci/lib.sh +++ b/scripts/ci/lib.sh @@ -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" @@ -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() { @@ -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."