-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathJenkinsfile
More file actions
55 lines (53 loc) · 1.65 KB
/
Jenkinsfile
File metadata and controls
55 lines (53 loc) · 1.65 KB
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
53
54
55
library 'forge-shared-library'
pipeline {
agent {
docker {
image 'gradle:7-jdk16'
args '-v grossjava9hacksgc:/home/gradle/.gradle/'
}
}
environment {
GRADLE_ARGS = '--no-daemon'
}
stages {
stage('buildandtest') {
steps {
withGradle {
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue build test'
gradleVersion(this, 'properties', 'MYVERSION')
}
}
post {
success {
writeChangelog(currentBuild, 'build/changelog.txt')
archiveArtifacts artifacts: 'build/changelog.txt', fingerprint: false
}
}
}
stage('publish') {
when {
not {
changeRequest()
}
}
steps {
withCredentials([usernamePassword(credentialsId: 'maven-cpw-user', usernameVariable: 'MAVEN_USER', passwordVariable: 'MAVEN_PASSWORD')]) {
withGradle {
sh './gradlew ${GRADLE_ARGS} publish'
}
}
}
post {
success {
build job: 'filegenerator', parameters: [string(name: 'COMMAND', value: "promote cpw.mods:grossjava9hacks ${env.MYVERSION} latest")], propagate: false, wait: false
}
}
}
}
post {
always {
archiveArtifacts artifacts: 'build/libs/**/*.jar', fingerprint: true
junit 'build/test-results/*/*.xml'
}
}
}