forked from ansible-collections/ibm_zos_cics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·71 lines (57 loc) · 3.16 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env bash
# (c) Copyright IBM Corp. 2020,2021
trap "exit" INT
set -e
if [[ -z "$CMCI_PYTHON_38" ]]; then
echo "Must provide CMCI_PYTHON_38 in environment" 1>&2
exit 1
fi
if [[ -z "$CMCI_PYTHON_27" ]]; then
echo "Must provide CMCI_PYTHON_27 in environment" 1>&2
exit 1
fi
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
source "$CMCI_PYTHON_38/bin/activate"
(set -x; pip install -r requirements.txt)
(set -x; ANSIBLE_COLLECTIONS_PATHS=../../.. ansible-lint)
(set -x; python3 -m yamllint -c yamllint.yaml .)
echo "/* -------------------------------------------------------------------------- */"
echo "/* ansible-test Sanity Tests */"
echo "/* -------------------------------------------------------------------------- */"
(set -x; ansible-test sanity 2>&1 --python 3.8)
echo "/* -------------------------------------------------------------------------- */"
echo "/* Unit tests Python 3.8 */"
echo "/* -------------------------------------------------------------------------- */"
(set -x; ansible-test units --python 3.8)
echo "/* -------------------------------------------------------------------------- */"
echo "/* Integration tests Python 3.8 */"
echo "/* -------------------------------------------------------------------------- */"
(set -x; ansible-test integration cics_cmci --python 3.8)
echo "/* -------------------------------------------------------------------------- */"
echo "/* Integration tests for missing libraries Python 3.8 */"
echo "/* -------------------------------------------------------------------------- */"
(set -x; pip uninstall xmltodict -y)
(set -x; ansible-test integration cics_cmci_missing_xmltodict_library --python 3.8)
(set -x; pip install -r prod-requirements.txt)
(set -x; pip uninstall requests -y)
(set -x; ansible-test integration cics_cmci_missing_requests_library --python 3.8)
(set -x; pip install -r prod-requirements.txt)
echo $?
deactivate
echo "/* -------------------------------------------------------------------------- */"
echo "/* Unit tests Python 2.7 */"
echo "/* -------------------------------------------------------------------------- */"
source "$CMCI_PYTHON_27/bin/activate"
pip install -r requirements.txt
(set -x; ansible-test units --python 2.7)
echo "/* -------------------------------------------------------------------------- */"
echo "/* Integration tests Python 2.7 */"
echo "/* -------------------------------------------------------------------------- */"
(set -x; ansible-test integration cics_cmci --python 2.7)
deactivate
source "$CMCI_PYTHON_38/bin/activate"
echo "/* -------------------------------------------------------------------------- */"
echo "/* Collection Build and Install */"
echo "/* -------------------------------------------------------------------------- */"
(set -x; ansible-galaxy collection build . --force)
(set -x; ansible-galaxy collection install ibm-ibm_zos_cics* --force)