forked from RedHatInsights/ubi-trino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpr_check.sh
executable file
·53 lines (46 loc) · 1.76 KB
/
pr_check.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
echo "os: $OSTYPE"
echo "shell: $SHELL"
export PATH=$PATH:$PWD
set -ex
# --------------------------------------------
# Options that must be configured by app owner
# --------------------------------------------
APP_NAME="hccm" # name of app-sre "application" folder this component lives in
COMPONENT_NAME="trino" # name of app-sre "resourceTemplate" in deploy.yaml for this component
IMAGE_REPO="quay.io"
ORG="cloudservices"
APP="ubi-trino"
IMAGE="${IMAGE_REPO}/${ORG}/${APP}"
COMPONENTS="hive-metastore koku trino" # specific components to deploy (optional, default: all)
COMPONENTS_W_RESOURCES="hive-metastore koku trino" # components which should preserve resource settings (optional, default: none)
CHANGED_DIR="$WORKSPACE/files_changed"
mkdir -p $CHANGED_DIR
function check_for_file_changes() {
if [ -f $CHANGED_DIR/files_changed.txt ]; then
egrep "$1" $CHANGED_DIR/files_changed.txt &>/dev/null
else
null &>/dev/null
fi
}
# Install bonfire repo/initialize
CICD_URL=https://raw.githubusercontent.com/RedHatInsights/bonfire/master/cicd
curl -s $CICD_URL/bootstrap.sh > .cicd_bootstrap.sh && source .cicd_bootstrap.sh
git diff --name-only origin/main > $CHANGED_DIR/files_changed.txt
if check_for_file_changes 'default|bin|Dockerfile|image_build_num.txt'
then
source $CICD_ROOT/build.sh
else
IMAGE_TAG=$(./get_image_tag.sh)
fi
# source $CICD_ROOT/_common_deploy_logic.sh
# export NAMESPACE=$(bonfire namespace reserve)
# oc process --local -f deploy/clowdapp.yaml | oc apply -f - -n $NAMESPACE
source $CICD_ROOT/deploy_ephemeral_env.sh
#source $CICD_ROOT/smoke_test.sh
mkdir -p $WORKSPACE/artifacts
cat << EOF > ${WORKSPACE}/artifacts/junit-dummy.xml
<testsuite tests="1">
<testcase classname="dummy" name="dummytest"/>
</testsuite>
EOF