3 # COPYRIGHT NOTICE STARTS HERE
5 # Copyright 2018 © Samsung Electronics Co., Ltd.
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
19 # COPYRIGHT NOTICE ENDS HERE
21 ### This script performs Jenkins Change Verification for ONAP Offline Installer
22 # No parameters are expected
24 #######################################################################
26 #######################################################################
27 #if ansible was changed
29 if `git diff HEAD^ HEAD --name-only | grep -q "ansible/test"`;
30 then echo "TO DO: FULL ANSIBLE TEST" ;
32 ROLE_CHANGES=(`git diff HEAD^ HEAD --name-only | grep "ansible/role" | cut -f 1-3 -d "/" | sort | uniq`)
33 if [ -z "${ROLE_CHANGES}" ]; then
34 echo "NO ANSIBLE TESTS REQUIRED"
36 for i in ${ROLE_CHANGES[@]}
38 sudo ./ansible/test/bin/ci-molecule.sh ${i}
40 if [ ${MOLECULE_RC} -ne "0" ]; then echo "MOLECULE TEST FAILED FOR ${i};";exit 1; fi
48 if `git diff HEAD^ HEAD --name-only | grep -q "build"`;
49 then echo "TO DO: BUILD TEST" ;
51 echo "NO BUILD TEST REQUIRED"
54 #if documentation was changed
56 if `git diff HEAD^ HEAD --name-only | grep -q "docs"`;
57 then echo "TO DO: DOC TEST";
59 echo "NO DOC TEST REQUIRED"