Skip to content
Merged
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
16 changes: 16 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def sonarAnalysis(args) {
-Dsonar.organization=apache \
-Dsonar.projectKey=apache_hive \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml \
"""+args+" -DskipTests -Dit.skipTests -Dmaven.javadoc.skip"

// Sonar scanner runs in a separate JVM so JAVA_OPTS (notably heap size)
Expand Down Expand Up @@ -193,6 +194,15 @@ def jobWrappers(closure) {
}
}

def checkstyle() {
sh '''#!/bin/bash -e
set -x
sw java 21 && . /etc/profile.d/java.sh
export MAVEN_OPTS="-Xmx6G"
mvn checkstyle:checkstyle -Pitests
'''
}

def saveWS() {
sh '''#!/bin/bash -e
tar --exclude=archive.tar -cf archive.tar .
Expand Down Expand Up @@ -342,13 +352,19 @@ tar -xzf packaging/target/apache-hive-*-nightly-*-src.tar.gz
stage('Prepare') {
loadWS();
}
stage('Checkstyle') {
checkstyle()
}
stage('Sonar') {
sonarAnalysis("-Dsonar.branch.name=${BRANCH_NAME}")
}
} else if(env.CHANGE_ID) {
stage('Prepare') {
loadWS();
}
stage('Checkstyle') {
checkstyle()
}
stage('Sonar') {
sonarAnalysis("""-Dsonar.pullrequest.github.repository=apache/hive \
-Dsonar.pullrequest.key=${CHANGE_ID} \
Expand Down
Loading