HexCasting/Jenkinsfile

38 lines
804 B
Text
Raw Normal View History

2022-04-04 22:01:07 +02:00
#!/usr/bin/env groovy
pipeline {
agent any
tools {
jdk "jdk-17.0.1"
}
environment {
2022-04-04 22:09:20 +02:00
discordWebhook = credentials('discordWebhook')
2022-04-04 22:01:07 +02:00
}
stages {
stage('Clean') {
steps {
echo 'Cleaning Project'
sh 'chmod +x gradlew'
sh './gradlew clean'
}
}
stage('Build') {
steps {
echo 'Building'
sh './gradlew build'
}
}
stage('Publish') {
when { branch 'main' }
2022-04-04 22:01:07 +02:00
steps {
echo 'Deploying to Maven'
sh './gradlew publish sendWebhook'
}
}
}
post {
always {
2022-04-04 22:09:20 +02:00
archiveArtifacts 'build/libs/**.jar'
2022-04-04 22:01:07 +02:00
}
}
}