Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
fix: add NodeJS to PATH (#1035) | fix: apply X version for non-master…
Browse files Browse the repository at this point in the history
… branches (#1037) backport for 7.12.x (#1039)

* fix: add NodeJS to PATH (#1035)

* fix: add NodeJS to PATH

* fix: use proper Github API for retrieving the comment by ID

* chore: use existing step from the shared library

* fix: apply X version for non-master branches (#1037)
  • Loading branch information
mdelapenya authored Apr 14, 2021
1 parent 4a88575 commit 077496f
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions .ci/e2eKibana.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ pipeline {
stages {
stage('Process GitHub Event') {
agent { label 'ubuntu-20' }
environment {
HOME = "${env.WORKSPACE}/${BASE_DIR}"
PATH = "${env.HOME}/bin:${env.HOME}/node_modules:${env.HOME}/node_modules/.bin:${env.PATH}"
}
steps {
checkPermissions()
buildKibanaDockerImage(refspec: getBranch())
Expand All @@ -65,7 +69,7 @@ def checkPermissions(){
error("Only PRs from Elasticians can be tested with Fleet E2E tests")
}

if(!hasCommentAuthorWritePermissions(env.GT_PR, env.GT_COMMENT_ID)){
if(!hasCommentAuthorWritePermissions(repoName: 'elastic/kibana', commentId: env.GT_COMMENT_ID)){
error("Only Elasticians can trigger Fleet E2E tests")
}
}
Expand All @@ -88,21 +92,14 @@ def getDockerTag(){
return "pr${params.kibana_pr}"
}

def hasCommentAuthorWritePermissions(prId, commentId){
def repoName = "elastic/kibana"
def token = getGithubToken()
def url = "https://api.github.com/repos/${repoName}/issues/${prId}/comments/${commentId}"
def comment = githubApiCall(token: token, url: url, noCache: true)
def json = githubRepoGetUserPermission(token: token, repo: repoName, user: comment?.user?.login)

return json?.permission == 'admin' || json?.permission == 'write'
}

def runE2ETests(String suite) {
log(level: 'DEBUG', text: "Triggering '${suite}' E2E tests for PR-${env.GT_PR}.")

// Kibana's maintenance branches follow the 7.11, 7.12 schema.
def branchName = "${env.GT_BASE_REF}.x"
def branchName = "${env.GT_BASE_REF}"
if (${env.GT_BASE_REF} != "master") {
branchName = "${env.GT_BASE_REF}.x"
}
def e2eTestsPipeline = "e2e-tests/e2e-testing-mbp/${branchName}"

def parameters = [
Expand Down

0 comments on commit 077496f

Please sign in to comment.