-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcheck-build-environment.sh
More file actions
executable file
·56 lines (47 loc) · 1.02 KB
/
check-build-environment.sh
File metadata and controls
executable file
·56 lines (47 loc) · 1.02 KB
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
54
55
56
#!/bin/bash
# Check that the build environment is set up correctly, and warn about issues
#
set -o errexit -o pipefail -o nounset
: "${SHOULD_WARN_ONLY:="false"}"
function success() {
[[ "${SHOULD_WARN_ONLY}" == "true" ]] && return
local message="$1"
echo " ✅ ${message}"
return 0
}
function warning() {
local message="$1"
echo -e " ⚠️ \e[31m${message}\e[39m"
return 0
}
echo
echo "Checking build environment...."
BUILD_DEPENDENCIES="
allure
behave
pre-commit
jq
poetry
pytest
python
terraform
yq
zip
"
for dep in ${BUILD_DEPENDENCIES}; do
set +e
dep_path="$(which ${dep} 2> /dev/null)"
set -e
if [[ -n "${dep_path}" && -x "${dep_path}" ]]
then
success "${dep} found at ${dep_path}"
else
warning "${dep} not found ${dep_path}"
fi
done
if [[ "${CI:='false'}" != 'true' && "${POETRY_ACTIVE:=0}" != "1" ]];
then
warning "Poetry is not active. Run 'poetry shell' to activate it."
else
success "Poetry is active"
fi