Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check coverity authorization #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
language: java

before_script:
- chmod +x ./check_coverity_authorization.sh
- branch_name=`./check_coverity_authorization.sh`
- echo $branch_name

script: mvn clean package

after_success:
Expand All @@ -21,4 +27,4 @@ addons:
description: "Build submitted via Travis CI"
notification_email: [email protected]
build_command: "mvn clean package"
branch_pattern: master
branch_pattern: $branch_name
18 changes: 18 additions & 0 deletions check_coverity_authorization.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

set -ev

AUTH_RES=`curl -s --form project="Cognifide/Slice" --form token="$COVERITY_SCAN_TOKEN" https://scan.coverity.com/api/upload_permitted`
AUTH=`echo $AUTH_RES | ruby -e "require 'rubygems'; require 'json'; puts JSON[STDIN.read]['upload_permitted']"`

if [ "$AUTH" = "true" ]; then
echo "master"
else
echo "non_existing_branch_name"
fi