Skip to content

Commit

Permalink
#156 move ci from travis to jenkins (#158)
Browse files Browse the repository at this point in the history
* #156. Switch publishing to jenkins
  • Loading branch information
Piotr Joński authored Jan 2, 2017
1 parent 0c4961b commit 966806b
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 76 deletions.
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

50 changes: 42 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,45 @@
node {
stage("checkout") {
checkout scm
pipeline {
agent any
parameters {
booleanParam(defaultValue: false, description: 'Publish new release from this build?', name: 'release')
stringParam(defaultValue: "", description: 'New release version', name: 'releaseVersion')
stringParam(defaultValue: "-SNAPSHOT", description: 'New release development', name: 'newVersion')
}
stage("assmeble") {
sh "./gradlew assemble testClasses"
}
stage("test") {
sh "./gradlew check"
stages {
stage("Build") {
steps {
sh "env"
sh "./gradlew assemble testClasses"
}
}
stage("Test") {
steps {
sh "./gradlew check"
}
}

stage("Publish release") {
when {
env.BRANCH == "master" && env.RELEASE == "true" && env.RELEASE_VERSION != "" && env.NEW_VERSION != ""
}
steps {
sh "./gradlew release -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${releaseVersion} -Prelease.newVersion=${newVersion}"
sh "./gradlew bintrayUpload"
sh "./gradlew javadoc >/dev/null"
sh "rm -rf ./src/book/javadoc"
sh "mv ./build/docs/javadoc ./src/book/javadoc"
sh "gitbook install ./src/book/"
sh "gitbook build ./src/book/ ./repo"
sh "git --work-tree=repo/ --git-dir=repo/.git init"
sh "git --work-tree=repo/ --git-dir=repo/.git config user.name 'jenkins'"
sh "git --work-tree=repo/ --git-dir=repo/.git config user.email '[email protected]'"
sh "git --work-tree=repo/ --git-dir=repo/.git remote add origin [email protected]:sta-szek/pojo-tester.git"
sh "git --work-tree=repo/ --git-dir=repo/.git fetch -q -n origin"
sh "git --work-tree=repo/ --git-dir=repo/.git reset -q origin/gh-pages"
sh "git --work-tree=repo/ --git-dir=repo/.git add -A ."
sh "git --work-tree=repo/ --git-dir=repo/.git commit -m 'Rebuild pojo-tester pages by jenkins'"
sh "git --work-tree=repo/ --git-dir=repo/.git push origin HEAD:gh-pages"
}
}
}
}
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Get more information at [pojo-tester documentation site](http://pojo.pl)

If you have any questions, we can chat on [![Rocket.Chat](https://demo.rocket.chat/images/join-chat.svg)](http://chat.pojo.pl/channel/pojo-tester)

Build status is provided by [![Build Status](https://travis-ci.org/sta-szek/pojo-tester.svg?branch=master)](https://travis-ci.org/sta-szek/pojo-tester)
Build status is provided by [![Build Status](http://ci.pojo.pl/buildStatus/icon?job=pojo-tester/master)](http://ci.pojo.pl/job/pojo-tester/job/master/)

Current coverage is [![codecov](https://codecov.io/gh/sta-szek/pojo-tester/branch/master/graph/badge.svg)](https://codecov.io/gh/sta-szek/pojo-tester)

Expand Down
24 changes: 24 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import java.time.ZoneOffset
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
import java.util.regex.Matcher

buildscript {
repositories {
Expand All @@ -15,6 +16,7 @@ buildscript {

plugins {
id "com.jfrog.bintray" version "1.7"
id 'net.researchgate.release' version '2.4.0'
}

ext {
Expand Down Expand Up @@ -129,6 +131,28 @@ bintray {
}
}

release {
failOnCommitNeeded = false
failOnPublishNeeded = false
failOnSnapshotDependencies = false
failOnUnversionedFiles = false
failOnUpdateNeeded = true
revertOnFail = true
tagCommitMessage = '[Gradle Release Plugin] - creating tag: '
newVersionCommitMessage = '[Gradle Release Plugin] - new version commit: '
tagTemplate = '${version}'
versionPropertyFile = 'gradle.properties'
versionProperties = []
buildTasks = []

git {
requireBranch = 'master'
pushToRemote = 'origin'
pushToBranchPrefix = ''
commitVersionFileOnly = false
}
}

jar {
manifest.attributes(createManifestAttributes())
}
Expand Down
47 changes: 0 additions & 47 deletions deployPages.sh

This file was deleted.

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Sat Dec 17 13:09:07 CET 2016
#Tue Dec 20 20:31:10 CET 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion src/book/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This is a documentation for writing `pojo-tests` using [pojo-tester](https://git

If you have any questions, we can chat on [![Rocket.Chat](https://demo.rocket.chat/images/join-chat.svg)](http://chat.pojo.pl/channel/pojo-tester)

Build status is provided by [![Build Status](https://travis-ci.org/sta-szek/pojo-tester.svg?branch=master)](https://travis-ci.org/sta-szek/pojo-tester)
Build status is provided by [![Build Status](http://ci.pojo.pl/buildStatus/icon?job=pojo-tester/master)](http://ci.pojo.pl/job/pojo-tester/job/master/)

Project quality [![Codacy Badge](https://api.codacy.com/project/badge/Grade/f20e4ae366964fe4864179d26ed392c4)](https://www.codacy.com/app/sta-szek/pojo-tester?utm_source=github.com&utm_medium=referral&utm_content=sta-szek/pojo-tester&utm_campaign=Badge_Grade)

Expand Down

0 comments on commit 966806b

Please sign in to comment.