Skip to content

Commit

Permalink
Merge pull request #2 from jenkinsci/feature/git_tag
Browse files Browse the repository at this point in the history
Add release task
  • Loading branch information
sue445 committed Jan 7, 2016
2 parents d4739a3 + 2080bd2 commit 60765fc
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ buildscript {
}
dependencies {
classpath 'org.jenkins-ci.tools:gradle-jpi-plugin:0.12.2'
classpath 'org.ajoberstar:gradle-git:1.3.2'
}
}

Expand Down Expand Up @@ -57,4 +58,26 @@ test {
testLogging {
showStandardStreams = true
}
}
}

import org.ajoberstar.grgit.*

ext.repo = Grgit.open()

task tagRelease << {
repo.tag.add {
name = version
message = "Release of ${version}"
}

repo.push(tags: true)
}

task checkVersion << {
if(version.endsWith("-SNAPSHOT")){
logger.error "################### Remove -SNAPSHOT ! ###################"
throw "Remove -SNAPSHOT !"
}
}

task release(dependsOn: ["checkVersion", "publish", "tagRelease"])

0 comments on commit 60765fc

Please sign in to comment.