-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Jenkinsfile
46 lines (44 loc) · 1.71 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
@Library('forge-shared-library')_
pipeline {
agent {
docker {
image 'gradlewrapper:latest'
args '-v gradlecache:/gradlecache'
}
}
environment {
GRADLE_ARGS = '-Dorg.gradle.daemon.idletimeout=5000'
}
stages {
stage('buildandtest') {
steps {
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue build test'
script {
env.MYGROUP = sh(returnStdout: true, script: './gradlew ${GRADLE_ARGS} properties -q | grep "group:" | awk \'{print $2}\'').trim()
env.MYNAME = sh(returnStdout: true, script: './gradlew ${GRADLE_ARGS} properties -q | grep "name:" | awk \'{print $2}\'').trim()
env.MYVERSION = sh(returnStdout: true, script: './gradlew ${GRADLE_ARGS} properties -q | grep "version:" | awk \'{print $2}\'').trim()
}
}
post {
success {
writeChangelog(currentBuild, 'build/changelog.txt')
archiveArtifacts artifacts: 'build/changelog.txt', fingerprint: false
}
}
}
stage('publish') {
when {
not {
changeRequest()
}
}
environment {
FORGE_MAVEN = credentials('forge-maven-forge-user')
}
steps {
sh './gradlew ${GRADLE_ARGS} publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW}'
sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/${MYGROUP}.${MYNAME}/${MYVERSION}'
}
}
}
}