Move cache again, documentation is vague.

This commit is contained in:
LexManos 2018-11-12 20:18:43 -08:00
parent fe3fcef7a9
commit 72b63e7b36

58
Jenkinsfile vendored
View file

@ -18,44 +18,44 @@ pipeline {
} }
} }
stage('buildandtest') { stage('buildandtest') {
cache(maxCacheSize: 250/*MB*/, caches: [ steps {
[$class: 'ArbitraryFileCache', excludes: 'log.txt', includes: '**/*', path: '${WORKSPACE}/projects/forge/build/extractRangeMap'] //Cache the rangemap to help speed up builds 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
steps { ]){
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue build test' sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue build test'
script {
env.MYVERSION = sh(returnStdout: true, script: './gradlew properties -q | grep "version:" | awk \'{print $2}\'').trim()
}
} }
post { script {
success { env.MYVERSION = sh(returnStdout: true, script: './gradlew properties -q | grep "version:" | awk \'{print $2}\'').trim()
writeChangelog(currentBuild, 'build/changelog.txt') }
archiveArtifacts artifacts: 'build/changelog.txt', fingerprint: false }
} post {
success {
writeChangelog(currentBuild, 'build/changelog.txt')
archiveArtifacts artifacts: 'build/changelog.txt', fingerprint: false
} }
} }
} }
stage('publish') { stage('publish') {
cache(maxCacheSize: 250/*MB*/, caches: [ when {
[$class: 'ArbitraryFileCache', excludes: 'log.txt', includes: '**/*', path: '${WORKSPACE}/projects/forge/build/extractRangeMap'] //Cache the rangemap to help speed up builds not {
]){ changeRequest()
when {
not {
changeRequest()
}
} }
environment { }
FORGE_MAVEN = credentials('forge-maven-forge-user') environment {
CROWDIN = credentials('forge-crowdin') FORGE_MAVEN = credentials('forge-maven-forge-user')
KEYSTORE = credentials('forge-jenkins-keystore-old') CROWDIN = credentials('forge-crowdin')
KEYSTORE_KEYPASS = credentials('forge-jenkins-keystore-old-keypass') KEYSTORE = credentials('forge-jenkins-keystore-old')
KEYSTORE_STOREPASS = credentials('forge-jenkins-keystore-old-keypass') KEYSTORE_KEYPASS = credentials('forge-jenkins-keystore-old-keypass')
} KEYSTORE_STOREPASS = credentials('forge-jenkins-keystore-old-keypass')
steps { }
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
]){
sh './gradlew ${GRADLE_ARGS} forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}' sh './gradlew ${GRADLE_ARGS} forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
//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}'
} }
//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}'
} }
} }
} }