diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..068b5eb01 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,31 @@ +#!/usr/bin/env groovy + +pipeline { + agent any + stages { + stage('Clean') { + steps { + echo 'Cleaning Project' + sh 'chmod +x gradlew' + sh './gradlew clean' + } + } + stage('Setup') { + steps { + echo 'Setting up Workspace' + sh './gradlew setupCIWorkspace' + } + } + stage('Build and Deploy') { + steps { + echo 'Building and Deploying to Maven' + sh './gradlew build sort uploadArchives' + } + } + } + post { + always { + archive 'build/libs/**.jar' + } + } +} diff --git a/build.gradle b/build.gradle index 8ac731fbc..ae9211b68 100644 --- a/build.gradle +++ b/build.gradle @@ -43,6 +43,11 @@ version = "${config.version}-${config.build_number}" group = "vazkii.botania" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = config.mod_name +if (System.getenv().BUILD_NUMBER != null) { + //adds the build number to the end of the version string if on a build server + version += ".${System.getenv().BUILD_NUMBER}" +} + minecraft { version = "${config.mc_version}-${config.forge_version}" runDir = "eclipse/assets" @@ -156,6 +161,9 @@ task outputDeobf(type: Copy) { } task forgecraft(type: Copy) { + if(priv == null){ + return; + } dependsOn "outputDeobf" from "${config.dir_output}/wtf" into file(priv.dir_forgecraft) @@ -213,11 +221,15 @@ def scp(String dir, Closure antFileset = {}) { def parseConfig(File config) { - config.withReader { - def prop = new Properties() - prop.load(it) - return (new ConfigSlurper().parse(prop)) - } + if(config.exists()){ + config.withReader { + def prop = new Properties() + prop.load(it) + return (new ConfigSlurper().parse(prop)) + } + } else { + return null; + } } jar { @@ -230,6 +242,9 @@ jar { } curseforge { + if(priv == null){ + return; + } apiKey = priv.cfkey project { id = "225643"