-
Notifications
You must be signed in to change notification settings - Fork 38
/
Jenkinsfile
36 lines (29 loc) · 1.1 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
//START-OF-SCRIPT
node {
def server = Artifactory.server 'artifactory'
withCredentials([usernamePassword(credentialsId: 'artifactory',
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
server.username = "${USERNAME}"
server.password = "${PASSWORD}"
}
def rtGradle = Artifactory.newGradleBuild()
def buildInfo
stage ('Clone') {
git url: 'https://github.com/cloudacademy/devops-webapp.git'
}
stage ('Artifactory Configuration') {
rtGradle.tool = "gradle" // Tool name from Jenkins configuration
rtGradle.deployer repo: 'gradle-release-local', server: server
rtGradle.resolver repo: 'jcenter', server: server
}
stage ('Gradle Build') {
buildInfo = rtGradle.run rootDir: "./", buildFile: 'build.gradle', tasks: 'clean build'
}
stage ('Gradle Publish') {
buildInfo = rtGradle.run rootDir: "./", buildFile: 'build.gradle', tasks: 'artifactoryPublish'
}
stage ('Artifactory Publish Build Info') {
server.publishBuildInfo buildInfo
}
}
//END-OF-SCRIPT