3 # Copyright (c) 2020 Cisco and/or its affiliates.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at:
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 echo "---> jjb/scripts/vpp/api-checkstyle.sh"
18 VPP_CRC_CHECKER="extras/scripts/crcchecker.py"
19 VPP_CRC_CHECKER_CMD="$VPP_CRC_CHECKER --check-patchset"
22 # 'roomId' field from the response of:
23 # curl https://api.ciscospark.com/v1/memberships -H "Authorization: Bearer ${SECRET_WEBEX_TEAMS_ACCESS_TOKEN}"
24 WEBEX_TEAMS_ROOM_ID='Y2lzY29zcGFyazovL3VzL1JPT00vMzUzZmI3OTAtYTVjNS0xMWVhLWI4ZjYtMDUxN2I4NzFmOWU5'
25 curl https://api.ciscospark.com/v1/messages -X POST -H "Authorization: Bearer ${SECRET_WEBEX_TEAMS_ACCESS_TOKEN}" -H "Content-Type: application/json" --data '{"roomId":"'${WEBEX_TEAMS_ROOM_ID}'", "markdown": "'"${WEBEX_TEAMS_MESSAGE}"'" }' || true
28 if [ -f $VPP_CRC_CHECKER ]; then
29 # API checker complains if the git repo is not clean.
30 # Help diagnosing those issues easier
32 echo "Running $VPP_CRC_CHECKER_CMD"
33 if $VPP_CRC_CHECKER_CMD; then
34 echo "API check successful"
37 echo "API check failed: ret code $RET_CODE; please read https://wiki.fd.io/view/VPP/ApiChangeProcess and discuss with ayourtch@gmail.com if unsure how to proceed"
38 WEBEX_TEAMS_MESSAGE="API check FAILED for $GERRIT_REFSPEC - see $BUILD_URL"
43 echo "Cannot find $VPP_CRC_CHECKER - skipping API compatibility check"