forked from jfrog/ide-plugins-common
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
95 lines (79 loc) · 3.43 KB
/
Copy pathJenkinsfile
File metadata and controls
95 lines (79 loc) · 3.43 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
pipeline {
// More info about the Declarative Pipeline Syntax on https://www.jfrog.com/confluence/display/JFROG/Declarative+Pipeline+Syntax
// Declarative syntax is available from version 3.0.0 of the Jenkins Artifactory Plugin.
agent any
environment {
GRADLE_HOME = "/Users/michaelsv/.sdkman/candidates/gradle/6.8.1"
}
stages {
stage ("Clone") {
steps {
git branch: "master",
url: "https://github.com/sverdlov93/ide-plugins-common"
// credentialsId: 'git_cred_id' (If cloning the code requires credentials, set credentials to artifactory server assined in Jenkins > Configure System > credentials > "username with password" > ID: "git-cred-id" )
}
}
stage ("Artifactory configuration") {
steps {
rtServer (
id: "ci-setup-cmd",
url: "https://michaelsv.jfrog.io/artifactory/",
credentialsId: 'rt-credentials', // (Credentials to artifactory server assined in Jenkins > Configure System > credentials > "username with password" > ID: "rt-cred-id" )
// bypassProxy: true, (If Jenkins is configured to use an http proxy, you can bypass the proxy when using this Artifactory server)
// timeout: 300 , (Configure the connection timeout (in seconds). The default value (if not configured) is 300 seconds)
)
rtGradleDeployer (
id: "GRADLE_DEPLOYER",
serverId: "ci-setup-cmd",
repo: "gradle-local"
// threads: 6, (Optional - Attach custom properties to the published artifacts)
// properties: ['key1=value1', 'key2=value2'], (Optional - Attach custom properties to the published artifacts)
)
rtGradleResolver (
id: "GRADLE_RESOLVER",
serverId: "ci-setup-cmd",
repo: "gradle-virtual"
)
}
}
stage ("Exec Gradle") {
steps {
rtGradleRun (
buildFile: 'build.gradle',
tasks: "clean artifactoryPublish",
rootDir: "",
resolverId: "GRADLE_RESOLVER",
deployerId: "GRADLE_DEPLOYER",
// tool: {build installation name}, // Jenkins > Gradle jenkins > Global Tool Configuration > Gradle installations
// threads: 6, (Optional - Attach custom properties to the published artifacts)
// properties: ['key1=value1', 'key2=value2'], (Optional - Attach custom properties to the published artifacts)
// buildName: 'my-build-name', (If the build name and build number are not set here, the current job name and number will be used:)
// buildNumber: '17',
// project: 'my-project-key' (Optional - Only if this build is associated with a project in Artifactory, set the project key as follows.)
)
}
}
stage ("Config build info") {
steps {
rtBuildInfo (
captureEnv: true,
includeEnvPatterns: ["*"],
// excludeEnvPatterns: ['*private*', 'internal-*'],
// buildName: 'my-build-name', (If the build name and build number are not set here, the current job name and number will be used:)
// buildNumber: '17',
// project: 'my-project-key' (Optional - Only if this build is associated with a project in Artifactory, set the project key as follows.)
)
}
}
stage ("Publish build info") {
steps {
rtPublishBuildInfo (
serverId: "ci-setup-cmd",
// buildName: 'my-build-name', (If the build name and build number are not set here, the current job name and number will be used:)
// buildNumber: '17',
// project: 'my-project-key' (Optional - Only if this build is associated with a project in Artifactory, set the project key as follows.)
)
}
}
}
}