-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
52 lines (51 loc) · 1.68 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
47
48
49
50
51
52
pipeline {
agent {
docker {
image 'gradlewrapper:latest'
args '-v gradlecache:/gradlecache'
}
}
environment {
GRADLE_ARGS = '-Dorg.gradle.daemon.idletimeout=5000'
CPW_CURSEFORGEAPI = credentials('cpw-curseforge')
}
stages {
stage('fetch') {
steps {
git(url: 'https://github.com/cpw/inventorysorter.git', changelog: true)
}
}
stage('buildandtest') {
steps {
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()
}
}
}
stage('publish') {
when {
not {
changeRequest()
}
}
environment {
CPW_MAVEN = credentials('forge-maven-cpw-user')
}
steps {
sh './gradlew ${GRADLE_ARGS} publish -PcpwMavenUser=${CPW_MAVEN_USR} -PcpwMavenPassword=${CPW_MAVEN_PSW}'
sh 'curl --user ${CPW_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/cpw.mods.inventorysorter/${BUILD_NUMBER}'
}
post {
success {
sh './gradlew ${GRADLE_ARGS} curseforge -Pcurseforge_projectid=240633 -Pcurseforge_apikey=${CPW_CURSEFORGEAPI} -PreleaseType=beta'
}
}
}
}
post {
always {
archiveArtifacts artifacts: 'build/libs/**/*.jar', fingerprint: true
}
}
}