-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
95 lines (93 loc) · 3.5 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
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 {
agent any
environment {
NEXUS_VERSION = "nexus3"
NEXUS_PROTOCOL = "http"
NEXUS_URL = "localhost:8081"
NEXUS_REPOSITORY = "maven-snapshot"
NEXUS_CREDENTIAL_ID = "nexus"
PROJECT_VERSION = "2.0.0-SNAPSHOT"
}
stages {
stage("Clean") {
steps {
sh "chmod +x ./gradlew";
sh "./gradlew clean";
}
}
stage("Build") {
steps {
sh "./gradlew build";
}
post {
success {
archiveArtifacts artifacts: 'build/libs/DiscordCommands.jar', fingerprint: true
}
}
}
stage("Build ShadowJar") {
steps {
sh "./gradlew shadowJar";
}
post {
success {
archiveArtifacts artifacts: 'build/libs/DiscordCommands-full.jar', fingerprint: true
}
}
}
stage("Docs") {
steps {
sh "./gradlew dokkaHtml";
sh "rm -r /var/www/docs/discordcommands-v1.0.0"
sh "mkdir /var/www/docs/discordcommands-v1.0.0"
sh "cp -r build/discordcommands-v1.0.0 /var/www/docs/"
}
}
stage("Sources") {
steps {
sh "./gradlew kotlinSourcesJar";
}
post {
success {
archiveArtifacts artifacts: 'build/libs/DiscordCommands-sources.jar', fingerprint: true
}
}
}
stage("Publish") {
steps {
script {
nexusArtifactUploader(
nexusVersion: NEXUS_VERSION,
protocol: NEXUS_PROTOCOL,
nexusUrl: NEXUS_URL,
groupId: "eu.vironlab.discordcommands",
version: PROJECT_VERSION,
repository: NEXUS_REPOSITORY,
credentialsId: NEXUS_CREDENTIAL_ID,
artifacts:
[
[
artifactId: "DiscordCommands",
classifier: '',
file : "build/libs/DiscordCommands.jar",
type : "jar"
],
[
artifactId: "DiscordCommands",
classifier: 'sources',
file : "build/libs/DiscordCommands-sources.jar",
type : "jar"
],
[
artifactId: "DiscordCommands",
classifier: '',
file : "build/pom/pom.xml",
type : "pom"
]
]
);
}
}
}
}
}