Add 'Jenkinsfile'
All checks were successful
Plugins/ThemeParkPlus-Socket/pipeline/head This commit looks good
All checks were successful
Plugins/ThemeParkPlus-Socket/pipeline/head This commit looks good
This commit is contained in:
parent
ca59904eb8
commit
9f9503e086
1 changed files with 42 additions and 0 deletions
42
Jenkinsfile
vendored
Normal file
42
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
def projectTitle = "ThemeParkPlus-Socket"
|
||||||
|
|
||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
|
||||||
|
tools {
|
||||||
|
go '1.19'
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Build Artifact') {
|
||||||
|
steps {
|
||||||
|
sh 'go version'
|
||||||
|
sh 'go build'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
script {
|
||||||
|
def discordFooter = "Copyright © SBDevelopment"
|
||||||
|
def buildNumber = currentBuild.number
|
||||||
|
def buildStatus = currentBuild.result
|
||||||
|
def prevBuild = currentBuild.getPreviousBuild()
|
||||||
|
def prevGitRev = prevBuild ? env.GIT_PREVIOUS_COMMIT : ''
|
||||||
|
def gitRange = prevGitRev ? "${prevGitRev}..HEAD" : "HEAD~1..HEAD"
|
||||||
|
def gitChanges = sh(returnStdout: true, script: "git log --pretty=format:\"- %h %s\" ${gitRange}")
|
||||||
|
def discordTitle = "Build #${buildNumber} - ${projectTitle}"
|
||||||
|
def discordDescription = "**Status:** ${buildStatus}\n**Changes:**\n${gitChanges}"
|
||||||
|
|
||||||
|
discordSend(
|
||||||
|
webhookURL: 'https://discord.com/api/webhooks/1079797247807598644/s57XSXoirtflA66DVVrZDtEHCfmi2XoK-eSRYWMMD5MTcK_W3EFQOCM8SnKSekxrQae_',
|
||||||
|
title: discordTitle,
|
||||||
|
description: discordDescription,
|
||||||
|
footer: discordFooter,
|
||||||
|
result: currentBuild.currentResult
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in a new issue