Skip to content

Commit

Permalink
contrib: simplify openshift/pr_check.sh
Browse files Browse the repository at this point in the history
This script is used in the pipeline for the quay.io Clair instance. All
the real CI is done in GitHub Actions, so this is just to make that
process' happy.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed Oct 30, 2023
1 parent 54eb2e8 commit 4405fda
Showing 1 changed file with 3 additions and 32 deletions.
35 changes: 3 additions & 32 deletions contrib/openshift/pr_check.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,4 @@
#!/bin/bash

#!/bin/sh
set -e
# set_root roots this script to the clair repository
set_root() {
# the repo directory we are trying to root at
repo="clair"
# the file system root which indicates search for repo dir failed
fs_root="/"

# root yourself at dir containing this script
p=$(realpath "$0")
cd $(dirname $p)

# use basename to walk paths backwards searching for clair
basename=$(basename `pwd`)
while [[ $basename != $repo && $basename != $fs_root ]]; do
cd $(dirname `pwd`)
basename=$(basename `pwd`)
done

# if basename is not clair, we couldn't find the repository root
if [[ $basename != $repo ]]; then
return 1
fi
return 0
}
if [ ! set_root ]; then
echo "could not set root to clair repository"
exit 1
fi

make container-build
# If anything specific for the quay.io Clair instance needs to happen, add that here.
exit 0

0 comments on commit 4405fda

Please sign in to comment.