Skip to content

Commit

Permalink
Merge pull request GeyserMC#14 from GeyserMC/jenkins
Browse files Browse the repository at this point in the history
Add jenkins support
  • Loading branch information
Redned235 authored Mar 28, 2020
2 parents 9e1ba11 + 6f7d7f8 commit 2082a02
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
43 changes: 43 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
pipeline {
agent any
tools {
maven 'Maven 3'
jdk 'Java 8'
}
options {
buildDiscarder(logRotator(artifactNumToKeepStr: '5'))
}
stages {
stage ('Build') {
steps {
sh 'mvn clean package'
}
post {
success {
archiveArtifacts artifacts: '**/target/*.jar', excludes: '**/target/floodgate-*-*.jar', fingerprint: true
}
}
}

stage ('Deploy') {
when {
anyOf {
branch "master"
branch "development"
}
}
steps {
sh 'mvn javadoc:jar source:jar deploy -DskipTests'
}
}
}

post {
always {
deleteDir()
withCredentials([string(credentialsId: 'geyser-discord-webhook', variable: 'DISCORD_WEBHOOK')]) {
discordSend description: "**Build:** [${currentBuild.id}](${env.BUILD_URL})\n**Status:** [${currentBuild.currentResult}](${env.BUILD_URL})\n\n[**Artifacts on Jenkins**](https://ci.nukkitx.com/job/GeyserMC/job/Floodgate)", footer: 'NukkitX Jenkins', link: env.BUILD_URL, successful: currentBuild.resultIsBetterOrEqualTo('SUCCESS'), title: "${env.JOB_NAME} #${currentBuild.id}", webhookURL: DISCORD_WEBHOOK
}
}
}
}
7 changes: 7 additions & 0 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@

<artifactId>floodgate-common</artifactId>

<repositories>
<repository>
<id>nukkitx-repo</id>
<url>https://repo.nukkitx.com/maven-snapshots</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.geysermc</groupId>
Expand Down

0 comments on commit 2082a02

Please sign in to comment.