mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 08:18:55 +00:00

Build steps defined in Jenkinsfile pass the built-in environment variable 'JENKINS_URL' to the Gradle/Maven executions. This is evaluated in the build scripts for upstream repository URLs. On Xtext JIPP this will use upstream repos from JIPP. In local builds outside of Jenkins the property defaults to Typefox CI like before. Extend function jenkinsPipelineRepo() by upstreamBranch parameter and use this in the call. Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
23 lines
879 B
Groovy
23 lines
879 B
Groovy
node {
|
|
properties([
|
|
[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', numToKeepStr: '15']]
|
|
])
|
|
|
|
stage('Checkout') {
|
|
checkout scm
|
|
}
|
|
|
|
stage('Gradle Build') {
|
|
sh "./gradlew clean cleanGenerateXtext build createLocalMavenRepo -PuseJenkinsSnapshots=true -PJENKINS_URL=$JENKINS_URL -PcompileXtend=true -PignoreTestFailures=true --refresh-dependencies --continue"
|
|
step([$class: 'JUnitResultArchiver', testResults: '**/build/test-results/test/*.xml'])
|
|
}
|
|
|
|
stage('Maven Build') {
|
|
def mvnHome = tool 'M3'
|
|
env.M2_HOME = "${mvnHome}"
|
|
dir('.m2/repository/org/eclipse/xtext') { deleteDir() }
|
|
sh "${mvnHome}/bin/mvn -f releng --batch-mode --update-snapshots -Dmaven.repo.local=.m2/repository -DJENKINS_URL=$JENKINS_URL -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn clean install"
|
|
}
|
|
|
|
archive 'build/**'
|
|
}
|