2018-11-13 03:54:39 +00:00
@Library('forge-shared-library')_
pipeline {
agent {
docker {
image 'gradlewrapper:latest'
args '-v gradlecache:/gradlecache'
}
}
environment {
2018-11-13 04:00:15 +00:00
GRADLE_ARGS = '--no-daemon' // No daemon for now as FG3 kinda derps. //'-Dorg.gradle.daemon.idletimeout=5000'
2018-11-13 03:54:39 +00:00
}
stages {
stage('fetch') {
steps {
git(url: 'https://github.com/MinecraftForge/MinecraftForge.git', changelog: true)
}
}
2018-11-13 04:21:02 +00:00
stage('build') {
2018-11-13 04:18:43 +00:00
steps {
cache(maxCacheSize: 250/*MB*/, caches: [
[$class: 'ArbitraryFileCache', excludes: 'log.txt', includes: '**/*', path: '${WORKSPACE}/projects/forge/build/extractRangeMap'] //Cache the rangemap to help speed up builds
]){
2018-11-13 04:21:02 +00:00
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue build'
2018-11-13 03:54:39 +00:00
}
2018-11-13 04:18:43 +00:00
script {
env.MYVERSION = sh(returnStdout: true, script: './gradlew properties -q | grep "version:" | awk \'{print $2}\'').trim()
}
}
post {
success {
writeChangelog(currentBuild, 'build/changelog.txt')
archiveArtifacts artifacts: 'build/changelog.txt', fingerprint: false
2018-11-13 03:54:39 +00:00
}
}
2018-11-13 04:13:59 +00:00
}
stage('publish') {
2018-11-13 04:18:43 +00:00
when {
not {
changeRequest()
2018-11-13 03:54:39 +00:00
}
2018-11-13 04:18:43 +00:00
}
environment {
FORGE_MAVEN = credentials('forge-maven-forge-user')
CROWDIN = credentials('forge-crowdin')
KEYSTORE = credentials('forge-jenkins-keystore-old')
KEYSTORE_KEYPASS = credentials('forge-jenkins-keystore-old-keypass')
KEYSTORE_STOREPASS = credentials('forge-jenkins-keystore-old-keypass')
}
steps {
cache(maxCacheSize: 250/*MB*/, caches: [
[$class: 'ArbitraryFileCache', excludes: 'log.txt', includes: '**/*', path: '${WORKSPACE}/projects/forge/build/extractRangeMap'] //Cache the rangemap to help speed up builds
]){
2018-11-13 03:54:39 +00:00
sh './gradlew ${GRADLE_ARGS} forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
}
2018-11-13 04:18:43 +00:00
//We're testing so use the test group
sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/net.minecraftforge.test.forge/${MYVERSION}'
2018-11-13 03:54:39 +00:00
}
}
}
post {
always {
archiveArtifacts artifacts: 'build/libs/**/*.jar', fingerprint: true
2018-11-13 04:21:02 +00:00
//junit 'build/test-results/*/*.xml'
//jacoco sourcePattern: '**/src/*/java'
2018-11-13 03:54:39 +00:00
}
}
}