Skip to content

Commit

Permalink
Update Jenkinsfile (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
berezovskyi committed Feb 16, 2022
1 parent de5b2bb commit 4bddc85
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 31 deletions.
34 changes: 6 additions & 28 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,22 @@ pipeline {
maven 'apache-maven-latest'
jdk 'temurin-jdk11-latest'
}
// environment {
// // https://stackoverflow.com/questions/42383273/get-git-branch-name-in-jenkins-pipeline-jenkinsfile
// // BRANCH_NAME_B = "${GIT_BRANCH.split("/")[1]}"
// // BRANCH_NAME_A = "${GIT_BRANCH.split("/").size() > 1 ? GIT_BRANCH.split("/")[1] : GIT_BRANCH}"
// // BRANCH_NAME = "${GIT_BRANCH.split('/').size() > 1 ? GIT_BRANCH.split('/')[1..-1].join('/') : GIT_BRANCH}"
// }
stages {
stage('Debug') {
steps {
script {
echo 'to be removed'
// echo 'Working on' + env.BRANCH_NAME
// echo '... or A' + env.BRANCH_NAME_A
// echo '... or B' + env.BRANCH_NAME_B
// echo 'GIT_BRANCH ' + env.GIT_BRANCH
// echo 'BRANCH_NAME ' + env.BRANCH_NAME
// echo 'CHANGE_ID ' + env.CHANGE_ID
// echo 'CHANGE_BRANCH ' + env.CHANGE_BRANCH
}
}
}
stage('SonarCloud') {
// when {
// changeRequest()
// }
environment {
PROJECT_NAME = 'lyo'
}
steps {
withCredentials([string(credentialsId: 'sonarcloud-token', variable: 'SONARCLOUD_TOKEN')]) {
withSonarQubeEnv('SonarCloud.io') {
script {
def sonar = ""
def sonar_pr = ""
if(env.CHANGE_ID) {
sonar += "-Dsonar.pullrequest.provider=GitHub -Dsonar.pullrequest.github.repository=eclipse/${env.PROJECT_NAME} -Dsonar.pullrequest.key=${env.CHANGE_ID} -Dsonar.pullrequest.branch=${env.CHANGE_BRANCH}"
sonar_pr += " -Dsonar.pullrequest.provider=GitHub -Dsonar.pullrequest.github.repository=eclipse/${env.PROJECT_NAME} -Dsonar.pullrequest.key=${env.CHANGE_ID} -Dsonar.pullrequest.branch=${env.CHANGE_BRANCH}"
}
sh '''
mvn clean verify -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
-Dsonar.projectKey=org.eclipse.lyo -Dsonar.organization=eclipse \
-Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.login=${SONARCLOUD_TOKEN} ${sonar}
'''
-Dsonar.projectKey=org.eclipse.lyo -Dsonar.organization=eclipse -Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.login=${SONARCLOUD_TOKEN}''' + sonar_pr
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ OSLC's scope started with Application Lifecycle Management (ALM) and is expandin

## Getting started

You can find more resources for developing OSLC applications with Lyo, under the [OSLC Developer Guide](https://oslc.github.io/developing-oslc-applications/eclipse_lyo/eclipse-lyo.html#oslc4j-sdk).
You can find more resources for developing OSLC applications with Lyo, under the [OSLC Developer Guide](https://oslc.github.io/developing-oslc-applications/eclipse_lyo/eclipse-lyo.html).You are welcome to post questions on the [OSLC forum](https://forum.open-services.net/c/sdks/lyo/9).

The [Lyo Samples](https://github.com/OSLC/lyo-samples) repository contains sample code that demonstrates how to use the Lyo client to interact with OSLC Service Providers in various ways.

You are welcome to post questions on the [OSLC forum](https://forum.open-services.net/c/sdks/lyo/9).
The [OLSLC OP Reference implementation](https://github.com/OSLC/refimpl) repository contains sample code that demonstrates how to build OSLC servers for various domains.


### Core

Expand Down

0 comments on commit 4bddc85

Please sign in to comment.