diff --git a/maint/Makefile.am b/maint/Makefile.am index 11e4dd1f8f..cac3ee0088 100644 --- a/maint/Makefile.am +++ b/maint/Makefile.am @@ -1,116 +1,115 @@ # -# Copyright 2019 the Pacemaker project contributors +# Copyright 2019-2021 the Pacemaker project contributors # # The version control history for this file may have further details. # # This source code is licensed under the GNU General Public License version 2 # or later (GPLv2+) WITHOUT ANY WARRANTY. # TESTCC_TARGETS = testcc_common_acl_h testcc_common_ipc_h \ testcc_common_iso8601_h testcc_common_mainloop_h testcc_common_nvpair_h \ testcc_common_results_h testcc_common_util_h testcc_common_xml_h \ testcc_compatibility_h testcc_pengine_common_h testcc_pengine_complex_h \ testcc_pe_types_h testcc_cib_types_h testcc_cib_util_h testcc_crm_h \ testcc_cib_h testcc_cluster_h testcc_lrmd_h testcc_msg_xml_h \ testcc_services_h testcc_stonith_ng_h testcc_pengine_status_h \ testcc_pengine_rules_h testcc_common_logging_h CLEANFILES = $(TESTCC_TARGETS) testcc_helper.cc -EXTRA_SCRIPTS = bumplibs.sh \ - travisci_build_coverity_scan.sh +EXTRA_SCRIPTS = bumplibs.sh EXTRA_PROGRAMS = $(TESTCC_TARGETS) EXTRA_DIST = README testcc_helper.cc: echo "int main() { return 0; }" > $@ nodist_testcc_common_acl_h_SOURCES = testcc_helper.cc testcc_common_acl_h_CXXFLAGS = -include "crm/common/acl.h" nodist_testcc_common_ipc_h_SOURCES = testcc_helper.cc testcc_common_ipc_h_CXXFLAGS = -include "crm/common/ipc.h" nodist_testcc_common_iso8601_h_SOURCES = testcc_helper.cc testcc_common_iso8601_h_CXXFLAGS = -include "crm/common/iso8601.h" nodist_testcc_common_mainloop_h_SOURCES = testcc_helper.cc testcc_common_mainloop_h_CXXFLAGS = -include "crm/common/mainloop.h" nodist_testcc_common_nvpair_h_SOURCES = testcc_helper.cc testcc_common_nvpair_h_CXXFLAGS = -include "crm/common/nvpair.h" nodist_testcc_common_results_h_SOURCES = testcc_helper.cc testcc_common_results_h_CXXFLAGS = -include "crm/common/results.h" nodist_testcc_common_util_h_SOURCES = testcc_helper.cc testcc_common_util_h_CXXFLAGS = -include "crm/common/util.h" nodist_testcc_common_xml_h_SOURCES = testcc_helper.cc testcc_common_xml_h_CXXFLAGS = -include "crm/common/xml.h" nodist_testcc_compatibility_h_SOURCES = testcc_helper.cc testcc_compatibility_h_CXXFLAGS = -include "crm/compatibility.h" nodist_testcc_pengine_common_h_SOURCES = testcc_helper.cc testcc_pengine_common_h_CXXFLAGS = -include "crm/pengine/common.h" nodist_testcc_pengine_complex_h_SOURCES = testcc_helper.cc testcc_pengine_complex_h_CXXFLAGS = -include "crm/pengine/complex.h" nodist_testcc_pe_types_h_SOURCES = testcc_helper.cc testcc_pe_types_h_CXXFLAGS = -include "crm/pengine/pe_types.h" nodist_testcc_cib_types_h_SOURCES = testcc_helper.cc testcc_cib_types_h_CXXFLAGS = -include "crm/cib/cib_types.h" nodist_testcc_cib_util_h_SOURCES = testcc_helper.cc testcc_cib_util_h_CXXFLAGS = -include "crm/cib/util.h" nodist_testcc_common_logging_h_SOURCES = testcc_helper.cc testcc_common_logging_h_CXXFLAGS = -include "crm/common/logging.h" # ones previously in testcc.cc except election.h not packaged nodist_testcc_crm_h_SOURCES = testcc_helper.cc testcc_crm_h_CXXFLAGS = -include "crm/crm.h" nodist_testcc_cib_h_SOURCES = testcc_helper.cc testcc_cib_h_CXXFLAGS = -include "crm/cib.h" nodist_testcc_cluster_h_SOURCES = testcc_helper.cc testcc_cluster_h_CXXFLAGS = -include "crm/cluster.h" nodist_testcc_lrmd_h_SOURCES = testcc_helper.cc testcc_lrmd_h_CXXFLAGS = -include "crm/lrmd.h" nodist_testcc_msg_xml_h_SOURCES = testcc_helper.cc testcc_msg_xml_h_CXXFLAGS = -include "crm/msg_xml.h" nodist_testcc_services_h_SOURCES = testcc_helper.cc testcc_services_h_CXXFLAGS = -include "crm/services.h" nodist_testcc_stonith_ng_h_SOURCES = testcc_helper.cc testcc_stonith_ng_h_CXXFLAGS = -include "crm/stonith-ng.h" nodist_testcc_pengine_status_h_SOURCES = testcc_helper.cc testcc_pengine_status_h_CXXFLAGS = -include "crm/pengine/status.h" nodist_testcc_pengine_rules_h_SOURCES = testcc_helper.cc testcc_pengine_rules_h_CXXFLAGS = -include "crm/pengine/rules.h" # c++-headers but not packaged # daemons/controld/controld_membership.h # include/crm/pengine/remote_internal.h # include/crm/common/cmdline_internal.h # include/crm/common/output.h # include/crm/common/ipcs_internal.h # include/crm/common/attrd_internal.h # include/pacemaker.h # include/pcmki/pcmki_output.h # include/pcmki/pcmki_transition.h # include/crm/cluster/election.h # lib/gnu/md5.h # tools/crm_resource_controller.h testcc: $(TESTCC_TARGETS) diff --git a/maint/travisci_build_coverity_scan.sh b/maint/travisci_build_coverity_scan.sh deleted file mode 100644 index f88f13643b..0000000000 --- a/maint/travisci_build_coverity_scan.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/sh -# -# Copyright 2014-2019 the Pacemaker project contributors -# -# The version control history for this file may have further details. -# -# This source code is licensed under the GNU General Public License version 2 -# or later (GPLv2+) WITHOUT ANY WARRANTY. -# - -set -e - -export RED="\033[33;1m" -export NONE="\033[0m" - -if [ -z "$PROJECT_NAME" ]; then - PROJECT_NAME=${TRAVIS_REPO_SLUG} -fi - -# Environment check -echo -e "${RED}Note: PROJECT_NAME and COVERITY_SCAN_TOKEN are available on Project Settings page on scan.coverity.com${NONE}" -[ -z "$PROJECT_NAME" ] && echo "ERROR: PROJECT_NAME must be set" && exit 1 -[ -z "$OWNER_EMAIL" ] && echo "ERROR: OWNER_EMAIL must be set" && exit 1 -[ -z "$COVERITY_SCAN_BRANCH_PATTERN" ] && echo "ERROR: COVERITY_SCAN_BRANCH_PATTERN must be set" && exit 1 -[ -z "$COVERITY_SCAN_BUILD_COMMAND" ] && echo "ERROR: COVERITY_SCAN_BUILD_COMMAND must be set" && exit 1 - -PLATFORM=`uname` -TOOL_ARCHIVE=/tmp/cov-analysis-${PLATFORM}.tgz -TOOL_URL=https://scan.coverity.com/download/${PLATFORM} -TOOL_BASE=/tmp/coverity-scan-analysis -UPLOAD_URL="http://scan5.coverity.com/cgi-bin/upload.py" -SCAN_URL="https://scan.coverity.com" - -# Do not run on pull requests -if [ "${TRAVIS_PULL_REQUEST}" = "true" ]; then - echo -e "${RED}INFO: Skipping Coverity Analysis: branch is a pull request.${NONE}" - exit 0 -fi - -# Verify this branch should run -IS_COVERITY_SCAN_BRANCH=`ruby -e "puts '${TRAVIS_BRANCH}' =~ /\\A$COVERITY_SCAN_BRANCH_PATTERN\\z/ ? 1 : 0"` -if [ "$IS_COVERITY_SCAN_BRANCH" = "1" ]; then - echo -e "${RED}Coverity Scan configured to run on branch ${TRAVIS_BRANCH}${NONE}" -else - echo -e "${RED}Coverity Scan NOT configured to run on branch ${TRAVIS_BRANCH}${NONE}" - exit 0 # Nothing to do, exit with success otherwise the build will be considered failed -fi - -# If COVERITY_SCAN_TOKEN isn't set, then we're probably running from somewhere -# other than ClusterLabs/pacemaker and coverity shouldn't be running anyway -[ -z "$COVERITY_SCAN_TOKEN" ] && echo "${RED}ERROR: COVERITY_SCAN_TOKEN must be set${NONE}" && exit 0 - -# Verify upload is permitted -AUTH_RES=`curl -s --form project="$PROJECT_NAME" --form token="$COVERITY_SCAN_TOKEN" $SCAN_URL/api/upload_permitted` -if [ "$AUTH_RES" = "Access denied" ]; then - echo -e "${RED}Coverity Scan API access denied. Check PROJECT_NAME and COVERITY_SCAN_TOKEN.${NONE}" - exit 1 -else - AUTH=`echo $AUTH_RES | ruby -e "require 'rubygems'; require 'json'; puts JSON[STDIN.read]['upload_permitted']"` - if [ "$AUTH" = "true" ]; then - echo -e "${RED}Coverity Scan analysis authorized per quota.${NONE}" - else - WHEN=`echo $AUTH_RES | ruby -e "require 'rubygems'; require 'json'; puts JSON[STDIN.read]['next_upload_permitted_at']"` - echo -e "${RED}Coverity Scan analysis NOT authorized until $WHEN.${NONE}" - exit 1 - fi -fi - -if [ ! -d $TOOL_BASE ]; then - # Download Coverity Scan Analysis Tool - if [ ! -e $TOOL_ARCHIVE ]; then - echo -e "${RED}Downloading Coverity Scan Analysis Tool...${NONE}" - wget -nv -O $TOOL_ARCHIVE $TOOL_URL --post-data "project=$PROJECT_NAME&token=$COVERITY_SCAN_TOKEN" - fi - - # Extract Coverity Scan Analysis Tool - echo -e "${RED}Extracting Coverity Scan Analysis Tool...${NONE}" - mkdir -p $TOOL_BASE - pushd $TOOL_BASE - tar xzf $TOOL_ARCHIVE - popd -fi - -TOOL_DIR=`find $TOOL_BASE -type d -name 'cov-analysis*'` -export PATH=$TOOL_DIR/bin:$PATH - -# Build -echo -e "${RED}Running Coverity Scan Analysis Tool...${NONE}" -COV_BUILD_OPTIONS="" -#COV_BUILD_OPTIONS="--return-emit-failures 8 --parse-error-threshold 85" -RESULTS_DIR="cov-int" -eval "${COVERITY_SCAN_BUILD_COMMAND_PREPEND}" -COVERITY_UNSUPPORTED=1 cov-build --dir $RESULTS_DIR $COV_BUILD_OPTIONS $COVERITY_SCAN_BUILD_COMMAND - -# Upload results -echo -e "${RED}Tarring Coverity Scan Analysis results...${NONE}" -RESULTS_ARCHIVE=analysis-results.tgz -tar czf $RESULTS_ARCHIVE $RESULTS_DIR -SHA=`git rev-parse --short HEAD` - -echo -e "${RED}Uploading Coverity Scan Analysis results...${NONE}" -curl \ - --progress-bar \ - --form project=$PROJECT_NAME \ - --form token=$COVERITY_SCAN_TOKEN \ - --form email=$OWNER_EMAIL \ - --form file=@$RESULTS_ARCHIVE \ - --form version=$SHA \ - --form description="Travis CI build" \ - $UPLOAD_URL