Skip to content

Commit

Permalink
Do not build PRs of non-members (hyrise#1343)
Browse files Browse the repository at this point in the history
* test

* bla

* bla

* bla

* bla

* bla

* bla

* bla

* bla

* bla

* bla

* bla

* bla

* bla

* bla

* bla

* remove now redundant script

* bla

* bla

* bla

* bla

* bla

* bla

* bla

* bla

* bla

* Update Jenkinsfile
  • Loading branch information
mrks authored Dec 4, 2018
1 parent fd94080 commit b97aba0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 41 deletions.
19 changes: 18 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@ import org.jenkinsci.plugins.pipeline.modeldefinition.Utils

node {
stage ("Start") {
// Check if the user who opened the PR is a known collaborator (i.e., has been added to a hyrise/hyrise team)
try {
withCredentials([usernamePassword(credentialsId: '5fe8ede9-bbdb-4803-a307-6924d4b4d9b5', usernameVariable: 'GITHUB_USERNAME', passwordVariable: 'GITHUB_TOKEN')]) {
env.PR_CREATED_BY = pullRequest.createdBy
sh '''
curl -s -I -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/repos/hyrise/hyrise/collaborators/${PR_CREATED_BY} | head -n 1 | grep "HTTP/1.1 204 No Content"
'''
}
} catch (error) {
stage ("User unknown") {
script {
githubNotify context: 'CI Pipeline', status: 'FAILURE', description: 'User is not a collaborator'
}
}
throw error
}

script {
githubNotify context: 'CI Pipeline', status: 'PENDING'

Expand Down Expand Up @@ -42,7 +59,7 @@ node {
mkdir gcc-debug && cd gcc-debug && cmake -DCI_BUILD=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ .. &\
mkdir gcc-release && cd gcc-release && cmake -DCI_BUILD=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ .. &\
wait"
full_ci = sh(script: "./scripts/current_branch_has_pull_request_label.py FullCI", returnStdout: true).trim() == "true"
full_ci = pullRequest.labels.contains('FullCI')
}

parallel clangDebug: {
Expand Down
40 changes: 0 additions & 40 deletions scripts/current_branch_has_pull_request_label.py

This file was deleted.

0 comments on commit b97aba0

Please sign in to comment.