-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.ci_build.sh
executable file
·52 lines (43 loc) · 1.32 KB
/
.ci_build.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
#!/usr/bin/env bash
# This is based on CZMQ ci_build.sh script available at:
# https://github.com/zeromq/czmq/blob/v4.1.1/ci_build.sh
set -e
# Set this to enable verbose profiling
[ -n "${CI_TIME-}" ] || CI_TIME=""
case "${CI_TIME}" in
[Yy][Ee][Ss]|[Oo][Nn]|[Tt][Rr][Uu][Ee])
CI_TIME="time -p " ;;
[Nn][Oo]|[Oo][Ff][Ff]|[Ff][Aa][Ll][Ss][Ee])
CI_TIME="" ;;
esac
# Set this to enable verbose tracing
[ -n "${CI_TRACE-}" ] || CI_TRACE="no"
case "${CI_TRACE}" in
[Nn][Oo]|[Oo][Ff][Ff]|[Ff][Aa][Ll][Ss][Ee])
set +x ;;
[Yy][Ee][Ss]|[Oo][Nn]|[Tt][Rr][Uu][Ee])
set -x ;;
esac
if [ -z "${ANSIBLE_INVENTORY}" ] || [ ! -d "${ANSIBLE_INVENTORY}/group_vars" ]; then
[ ! -z "${ANSIBLE_INVENTORY}" ] && \
echo "group_vars/ not found at \"${ANSIBLE_INVENTORY}\", using default value"
ANSIBLE_INVENTORY="inventories/sirius"
fi
ln --verbose --symbolic ${ANSIBLE_INVENTORY}/group_vars .
case "${BUILD_TYPE}" in
default)
echo "Running default molecule test" >&2
${CI_TIME} \
cd roles/${ROLE} && \
molecule test
;;
debug)
echo "Running debug molecule test" >&2
${CI_TIME} \
cd roles/${ROLE} && \
molecule --debug test
;;
*)
echo "Invalid build type: ${BUILD_TYPE}" >&2
;;
esac