Skip to content
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