-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
7 changed files
with
69 additions
and
76 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters