forked from kaguyabot/Kaguya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jenkinsfile-dev.groovy
45 lines (44 loc) · 1.32 KB
/
jenkinsfile-dev.groovy
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
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > 1) milestone(buildNumber - 1)
milestone(buildNumber)
pipeline {
agent any
stages {
stage('Checkout') {
steps {
git branch: 'development', url: 'https://github.com/stageosu/Kaguya.git'
}
}
stage('Restore Packages') {
steps {
dir("${env.WORKSPACE}/KaguyaProjectV2"){
sh "dotnet restore"
}
}
}
stage('Clean') {
steps {
dir("${env.WORKSPACE}/KaguyaProjectV2"){
sh "dotnet clean -c Release"
}
}
}
stage('Build') {
steps {
dir("${env.WORKSPACE}/KaguyaProjectV2"){
sh "echo killing any existing processes listening to port ${TopggWebhookPort}..."
sh "kill \$(lsof -t -i:${TopggWebhookPort}) || true" // Needed so that the web server dies each shutdown and doesn't leave an open port.
sh "echo all dotnet processes have been killed."
sh "dotnet build -c Release"
}
}
}
stage('Start Bot + API') {
steps {
dir("${env.WORKSPACE}/KaguyaProjectV2/bin/Release/net5.0"){
sh "dotnet KaguyaProjectV2.dll ${Token} ${BotOwnerID} ${LogLevel} ${DefaultPrefix} ${osuAPIKey} ${TopggAPIKey} ${MySQLUsername} ${MySQLPassword} ${MySQLServer} ${MySQLSchema} ${TwitchClientID} ${TwitchAuthorizationToken} ${DanbooruUsername} ${DanbooruAPIKey} ${TopggWebhookPort}"
}
}
}
}
}