-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
55 lines (43 loc) · 1.75 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
53
54
55
node {
def server
def buildInfo
def rtGradle
stage ('Artifactory configuration') {
server = Artifactory.server "EverCraft"
rtGradle = Artifactory.newGradleBuild()
rtGradle.useWrapper = true
rtGradle.deployer repo: 'gradle-release-local', server: server
rtGradle.deployer.deployArtifacts = false // Disable artifacts deployment during Gradle run
rtGradle.deployer.mavenCompatible = true
rtGradle.deployer.deployIvyDescriptors = true
buildInfo = Artifactory.newBuildInfo()
}
stage('Stage Checkout') {
checkout scm
sh "git submodule update --init"
sh "chmod +x gradlew"
}
stage ('Init Properties') {
sh "echo build_number=${env.BUILD_NUMBER} >> gradle.properties"
def spongeapi_version = sh (script: "cat gradle.properties | grep spongeapi_version | cut -d '=' -f 2 | tr -d '\n'", returnStdout: true)
currentBuild.displayName = "EverPlugins #${env.BUILD_NUMBER} - SpongeAPI ${spongeapi_version}"
currentBuild.description = "For SpongeAPI ${spongeapi_version}"
rtGradle.deployer.ivyPattern = "[organisation]/[module]/ivy-${spongeapi_version}.xml"
rtGradle.deployer.artifactPattern = "[organisation]/[module]/${spongeapi_version}/[artifact]-[revision](-[classifier]).[ext]"
}
stage ('Test') {
rtGradle.run rootDir: './', buildFile: 'build.gradle', tasks: 'clean test'
}
stage ('Deploy') {
echo "My branch is : ${env.BRANCH_NAME}"
rtGradle.run rootDir: './', buildFile: 'build.gradle', tasks: 'build shadowJar artifactoryPublish zip', buildInfo: buildInfo
rtGradle.deployer.deployArtifacts buildInfo
}
stage ('Publish build info') {
server.publishBuildInfo buildInfo
}
stage('Stage Upload') {
archive 'build/plugins/*.jar'
archive 'build/plugins/*.zip'
}
}