SlideShare a Scribd company logo
1 of 75
Download to read offline
Continuous Delivery in OSS
Using Shipkit
Marcin Stachniuk
Marcin Stachniuk
mstachniuk.github.io
/mstachniuk/shipkit-workshop
@MarcinStachniuk
wroclaw.jug.pl
shipkit.org
About you!
● Who is developer of Open Source Software?
● How do you release new version?
● Do you plan to contribute to Open Source?
Do you like manage releases?
● To include a feature in a release or not?
● Am I ready to release or should I test more?
● Oh no… release notes…
● Build, sign, release, tag, etc.
● Documentation?
Shipkit
Shipkit - main principles
● Almost every merged pull request lands new version in JCenter / Maven Central
● Easy to use, smart defaults
● Configure once and use all the time
● Automate as much as possible
● Don’t need to manage CI server
Shipkit workflow
JCenter
1. Merge PR to master
2. Start
a build
3. Create tag,
bump version,
update release notes
update documentation
4. Release5. Release
6. Sync
Why JCenter?
● Maven Central requirements:
○ Supply Javadoc and Sources
○ Sign Files with GPG/PGP
○ Sufficient Metadata in pom: groupId, artifactId, version, project(name,
description, url), information about(license, developer, SCM)
● Stability of Maven Central (in the past)
JCenter:
● Less restrictive
● Sign files
● Better stability
● Automatically sync with JCenter and Maven Central (retry when Maven Central is
down)
What can Shipkit?
● Bump version
● Generate release notes
● Upload release notes to repo and GitHub Release page
● Create a git tag
● Check if new release is needed
● Test dependers (downstreams projects)
● Release to JCenter and Maven Central
● Release unpacked Javadoc in HTML format
● Release plugins to Gradle Portal
Task 1 - init project & add Shipkit
● Fork https://github.com/mstachniuk/shipkit-workshop on GitHub
● Change name
● Add me as collaborator
● Enable issues: Settings -> Issues
● Send the link to the repo to me!
● Clone your repo to local machine
● Change project name in settings.gradle
● Import to IntelliJ Idea
● Add in build.gradle in plugins section:
id 'org.shipkit.java' version '2.2.2'
● Run:
./gradlew initShipkit
● Check a diff in your IDE
What add Shipkit to the project
#Version of the produced binaries. This file is intended to be checked-in.
#It will be automatically bumped by release automation.
version=1.0-SNAPSHOT
version.properties
> Task :initVersioning
Configured '1.0-SNAPSHOT' version in 'version.properties' file.
Please remove 'version=1.0-SNAPSHOT' setting from *.gradle file.
Please review and check in generated file: version.properties
Version number is now stored in 'version.properties' file. Don't set
'version' in *.gradle file.
./gradlew initShipkit
What add Shipkit to the project
Please change version to:
1.0.0
or similar
What add Shipkit to the project
language: java
jdk:
- oraclejdk8
install:
- true
branches:
except:
- /^vd/
script:
- ./gradlew build -s && ./gradlew ciPerformRelease
.travis.yml
What add Shipkit to the project
//This default Shipkit configuration file was created automatically and is intended to be
checked-in.
//To leverage Shipkit fully, please fix the TODO items, refer to our Getting Started
Guide for help:
//
// https://github.com/mockito/shipkit/blob/master/docs/getting-started.md
//
shipkit { … }
allprojects {
plugins.withId("org.shipkit.bintray") {
bintray { … }}}
gradle/shipkit.gradle
What add Shipkit to the project
shipkit {
//TODO is the repository correct?
gitHub.repository = "mstachniuk/shipkit-workshop-XX"
//TODO generate and use your own read-only GitHub personal access token
gitHub.readOnlyAuthToken = "76826c9ec886612f504d12fd4268b16721c4f85d"
//TODO generate GitHub write token, and ensure your Travis CI has this env
variable exported
gitHub.writeAuthToken = System.getenv("GH_WRITE_TOKEN")
}
gradle/shipkit.gradle
Task 2 - Generate GitHub tokens
https://github.com/mockito/shipkit
Task 2 - Generate GitHub tokens
Task 2 - Generate GitHub tokens
● Copy and store your tokens for the moment (e.g. in text editor)
● Set gitHub.readOnlyAuthToken in shipkit.gradle
● Write GitHub token is mandatory to make commit by Travis CI
● Never commit your write GitHub token!
Task 3 - Setup Travis CI
● Go to https://travis-ci.org or https://travis-ci.com
● Log in and Sync repositories
● Add new repository
Task 3 - Setup Travis CI
● Enable integration
● Go to settings
Task 3 - Setup Travis CI
● Add Environment Variable:
Name: GH_WRITE_TOKEN
Value: your write token copied from GitHub
Task 4 - Create PR
● Create local branch: git checkout -b add-shipkit
● Commit changes
Task 4 - Create PR
● Push branch
● Create Pull Request to YOUR master branch (NOT my repo)
● Check build status (do NOT merge yet!)
● Create local branch: git checkout -b branch_name
● Commit changes
Task 4 - Create PR
Task 4 - Create PR
Task 5 - Merge to master
● Merge to master
● Delete old branch
● Check build
Task 5 - Merge to master
● Go to: https://bintray.com/shipkit-bootstrap/bootstrap/maven/
Success - your first release to JFrog Repository!
Files commited by Shipkit
<sup><sup>*Release notes were automatically generated by [Shipkit](http://shipkit.org/)*</sup></sup>
#### 1.0.0
- 2019-01-06 - 4 commits by [Marcin Stachniuk](https://github.com/mstachniuk) - published to
[![Bintray](https://img.shields.io/badge/Bintray-1.0.0-green.svg)](https://bintray.com/shipkit-bootstrap/bootstrap/maven/1.0.0)
- Add Shipkit to project [(#2)](https://github.com/mstachniuk/shipkit-workshop/pull/2)
docs/release-notes.md
GitHub Releases
Files commited by Shipkit
#Version of the produced binaries. This file is intended to be checked-in.
#It will be automatically bumped by release automation.
version=1.0.0
version.properties
#Version of the produced binaries. This file
#It will be automatically bumped by releas
version=1.0.1
previousVersion=1.0.0
Versioning by Shipkit
● Shipkit use property version in version.properties as current version
● The previous version is useful for:
○ Compare current and previous version (check if something was changed)
● Those properties are updated during release
● No SNAPSHOTS, -beta, RC1 versions!
● Shipkit prefers semantic versioning (simplified)
Semantic Versioning
https://semver.org/
MAJOR.MINOR.PATCH
1. MAJOR version when you make incompatible API changes,
2. MINOR version when you add functionality in a backwards-compatible manner,
and
3. PATCH version when you make backwards-compatible bug fixes.
Semantic Versioning Specification
MAJOR.MINOR.PATCH
1. Software using Semantic Versioning MUST declare a public API.
2. MAJOR, MINOR & PATCH are non-negative integers, and MUST NOT contain
leading zeroes. Each element MUST increase numerically. E.g:
1.9.0 -> 1.10.0 -> 1.11.0.
3. The content of released version MUST NOT be modified. Any modification -> new
release.
4. Major version zero (0.y.z) is for initial development. Anything may change at any
time. The public API should not be considered stable.
5. Version 1.0.0 defines the public API.
Semantic Versioning Specification
MAJOR.MINOR.PATCH
6. Patch version Z (x.y.Z | x > 0) MUST be incremented if only backwards compatible
bug fixes are introduced. A bug fix is defined as an internal change that fixes
incorrect behavior.
7. Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backwards
compatible functionality is introduced to the public API or if any public API
functionality is marked as deprecated. It MAY be incremented if substantial new
functionality or improvements are introduced within the private code. It MAY
include patch level changes. Patch version MUST be reset to 0 when minor
version is incremented.
Semantic Versioning Specification
MAJOR.MINOR.PATCH
8. Major version X (X.y.z | X > 0) MUST be incremented if any backwards
incompatible changes are introduced to the public API. It MAY include minor and
patch level changes. Patch and minor version MUST be reset to 0 when major
version is incremented.
More 9-11: https://semver.org/
Semantic Versioning - Quiz
It’s time for:
QUIZ
Can be multichoice ;-)
Task 6: Configure Release Notes
● Add to Shipkit configuration:
releaseNotes.labelMapping = [
'enhancement': 'New feature',
'bug': 'Bug',
'docs': 'Documentation'
]
team.developers = ['mstachniuk:Marcin Stachniuk',
'<GH-login>:<GH-name>']
team.contributors = ['mstachniuk:Marcin Stachniuk',
'<GH-login>:<GH-name>']
team.ignoredContributors = ['mstachniuk:Marcin Stachniuk',
'<GH-login>:<GH-name>']
● Create PR, but NOT merge yet!
Task 6: Configure Release Notes
● Merge PR and add to message: [ci skip-release]
Task 6: Configure Release Notes
[ci skip-release] at the end of commit message prevent:
● publish release
● create tag
● update release notes
[ci skip] at the end of commit message prevent:
● execute a build
● add PR to release notes
It’s useful for commits made automatically by Shipkit
You can configure that by:
git.commitMessagePostfix = "[ci skip]"
releaseNotes.ignoreCommitsContaining = ["[ci skip]"]
Task 7: Release Notes
● See issues
● Create PR for: “Floating point support”
● Add enhancement label to PR
Task 7: Release Notes
Task 7: Release Notes
● Merge adding [ci skip-release]
● Remember about good PR name i.e.: Fix #NUMBER long support
● See issues
● Create PR for: “Long support”
● Add enhancement label to PR
● Repeat for: float, BigInteger and BigDecimal (the last one - no [ci skip-release])
Task 7: Release Notes
● Merge PR and see release notes:
releaseNotes.labelMapping = [
'enhancement': 'New features',
'bug': 'Bug',
]
Task 7: Release Notes
<project>
<!-- ... -->
<developers>
<developer>
<id>mstachniuk</id>
<name>Marcin Stachniuk</name>
<roles>
<role>Core developer</role>
</roles>
<url>https://github.com/mstachniuk</url>
</developer>
</developers>
shipkit-workshop-1.0.2.pom
<contributors>
<contributor>
<name>shipkit.org automated bot</name>
<url>https://github.com/shipkit-org</url>
</contributor>
<contributor>
<name>Twin Twist</name>
<url>https://github.com/TwinTwist</url>
</contributor>
</contributors>
</project>
Task 8: Compare publications
● See issues
● Create PR for: “Readme file is missing” - Please don’t change anything outside
Readme.md
● Merge and see build output
Task 8: Compare publications
How to skip release?
● Set SKIP_RELEASE environment variable
matrix:
include:
- jdk: oraclejdk8
- jdk: oraclejdk9
env: SKIP_RELEASE=true
- jdk: openjdk10
env: SKIP_RELEASE=true
- jdk: openjdk11
env: SKIP_RELEASE=true
.travis.yml
How to skip release?
● Add to commit message suffix: [ci skip-release]
● When Pull Request is build
● Building on NOT release branch, default: master|release/.+
○ Can be changed by: git.releasableBranchRegex = "branch_regex"
● No changes in binaries
○ Source jars
○ dependency-info.json (file generated by Shipkit and store in source jar)
● Commit contains suffix: [ci skip-compare-publications]
● Set property 'skipComparePublications' on task releaseNeeded to true (see
Mockito release model)
● Set SKIP_RELEASE environment variable
Building PR from community
Task 9: Compare publications - modify Javadoc
● See issues
● Create PR for: “Javadoc for MathUtils class is missing”
● Merge and see build output
Task 9: Compare publications - modify Javadoc
Task 10: Ship Javadoc
● Create on your Github account project: shipkit-workshop-X-javadoc
● Add in your project:
apply plugin: "org.shipkit.java"
// enable Shipkit Javadoc plugin.
apply plugin: "org.shipkit.javadoc"
● Make some change in the code
● Commit, create PR, merge
● Check shipkit-workshop-X-javadoc on the GitHub
Shipping Javadoc configuration options
// OPTIONAL GitHub repository (owner/repo) where Javadocs are shipped.
// The default value is gitHub.repository + "-javadoc"
javadoc.repository = "mstachniuk/shipkit-example-javadoc"
// OPTIONAL GitHub Javadoc repository branch name. The branch needs to exist.
// By default it's using the branch set as main in GitHub repo, usually master.
javadoc.repositoryBranch = "gh-pages"
// OPTIONAL GitHub Javadoc repository directory where put javadoc files. By default it's project root directory.
javadoc.repositoryDirectory = "dir1/dir2"
// OPTIONAL Commit message used to commit Javadocs. Default: "Update current and ${version} Javadocs.
[ci skip]"
// You can override this message and ${version} will be replaced by currently build version.
// You don't need to specify "[ci skip]" in your message - it will be added automatically.
javadoc.commitMessage = "Update Javadoc by awesome Shipkit"
What else?
What else?
Configuration possibilities - GitHub Enterprise
// OPTIONAL GitHub url, default: https://github.com
// It's useful when you're using on-premises GitHub Enterprise.
gitHub.url = "https://github.com"
// OPTIONAL GitHub API url, default: https://api.github.com
// It's useful when you're using on-premises GitHub Enterprise.
gitHub.apiUrl = "https://api.github.com"
Configuration possibilities - Release Notes location
// OPTIONAL Path to file where release notes will be generated by Shipkit, default:
docs/release-notes.md
releaseNotes.file = "docs/release-notes.md"
Configuration possibilities - Publication repository
// OPTIONAL Publication Repository where we look for your published binary, default:
empty
// It is currently used to configure repository Badge URL when generating release
notes.
releaseNotes.publicationRepository = ""
Configuration possibilities - Git settings for commits made by Shipkit
// OPTIONAL Git user for creating commit, tag and Pull Request with release notes,
default: shipkit-org
git.user = "shipkit-org"
// OPTIONAL Git user email for creating commit, tag and Pull Request with release
notes, default: <shipkit.org@gmail.com>
git.email = "<shipkit.org@gmail.com>"
Configuration possibilities - Tag prefix
// OPTIONAL Prefix added to the version to create VCS-addressable tag, default: v
// Empty string is ok and it means that there is not prefix.
git.tagPrefix = "v"
Publish to Maven Central
How to publish to Maven Central?
Publish to Maven Central
How to create account on Maven Central?
Publish to Maven Central
● Create account: https://issues.sonatype.org/
● Create new issue
● Generate tokens:
https://solidsoft.wordpress.com/2015/09/08/deploy-to-maven-central-using-api-key-
aka-auth-token/
● Set tokens in TravisCI
Publish to Maven Central
bintray {
key = '7ea297848ca948adb7d3ee92a83292112d7ae989'
pkg {
//TODO configure Bintray settings per your project (https://github.com/bintray/gradle-bintray-plugin)
repo = 'bootstrap'
user = 'shipkit-bootstrap-bot'
userOrg = 'shipkit-bootstrap'
name = 'maven'
licenses = ['MIT']
labels = ['continuous delivery', 'release automation', 'shipkit']
}
}
gradle/shipkit.gradle
bintray {
key = System.getenv("BINTRAY_API_KEY")
pkg {
repo = 'mstachniuk-maven-repo'
user = 'mstachniuk'
name = 'maven'
licenses = ['MIT']
labels = ['graphql', 'kotlin', 'java', 'schema']
version {
mavenCentralSync {
sync = true
user = System.env.NEXUS_TOKEN_USER
password = System.env.NEXUS_TOKEN_PWD
}
}
}
}
How to deliver Gradle plugin?
● The best example is Shipkit project itself
● In your build.gradle:
apply plugin: 'com.gradle.plugin-publish'
Incubating Features - upgrade downstream
● Check if new version works with dependers (child / downstream projects)
apply plugin: 'org.shipkit.ci-upgrade-downstream'
upgradeDownstream {
repositories = ['mockito/shipkit-example', 'mockito/shipkit']
}
Incubating Features - upgrade dependency
Child depends on parent project.
In child project you can execute:
./gradlew performVersionUpgrade
-Pdependency=parentGroup:parentArtifactName:parentVersion
It will create PR for you. When all check are green you can merge it.
More info:
https://github.com/mockito/shipkit/blob/master/docs/gradle-plugins/upgrade-dependen
cy-plugin.md
Tips and hacks - do not release everything
● Do not release each module
In module/build.gradle file:
bintrayUpload.enabled = false
Tips and hacks - license
● Another (not MIT) licence in POM (See #755)
In shipkit.gradle file:
plugins.withId("org.shipkit.java-publish") {
publishing.publications.javaLibrary.pom.withXml {
//refer to Groovy xml Node reference for more info how to
manipulate xml
asNode().licenses.replaceNode {
licenses {
license {
name "Eclipse Public License v2.0"
url "http://www.eclipse.org/legal/epl-v20.html"
}
}
}}}
Tips and hacks - Mockito release model
Mockito release model (#911):
● all versions are released in JCenter
● some of them are released in Maven Central
Tips and hacks - Mockito release model
boolean centralRelease = System.getenv("TRAVIS_COMMIT_MESSAGE")
?.contains("[ci maven-central-release]")
mavenCentralSync {
sync = centralRelease
}
afterEvaluate {
[assertReleaseNeeded, releaseNeeded].each {
it.skipComparePublications = centralRelease
}
}
More: https://github.com/mockito/mockito/blob/release/2.x/gradle/shipkit.gradle
Tips and hacks - Support for Bitrise.io
envman add --key TRAVIS_PULL_REQUEST --value "${PR}"
envman add --key TRAVIS_BRANCH --value "${BITRISE_GIT_BRANCH}"
envman add --key TRAVIS_COMMIT_MESSAGE --value "${BITRISE_GIT_MESSAGE}"
Alternatives
https://github.com/CloudPipelines/
https://github.com/szpak/CDeliveryBoy
https://github.com/allegro/axion-release-plugin
https://github.com/nemerosa/versioning
https://dependabot.com/
https://github.com/github-tools/github-release-notes
https://github.com/aalmiray/kordamp-gradle-plugins
Our plans
● Work on getting the community adopt Shipkit
● Continue work on incubating and new features
● Support OSS and enterprise in transition into CI/CD model
● Solve issues
Continuous Delivery in OSS
Using Shipkit
Marcin Stachniuk

More Related Content

What's hot

Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily use
Mediacurrent
 
Master Continuous Delivery with CloudBees Jenkins Platform
Master Continuous Delivery with CloudBees Jenkins PlatformMaster Continuous Delivery with CloudBees Jenkins Platform
Master Continuous Delivery with CloudBees Jenkins Platform
dcjuengst
 
2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final
Mythri P K
 

What's hot (20)

Lightweight continuous delivery for small schools
Lightweight continuous delivery for small schoolsLightweight continuous delivery for small schools
Lightweight continuous delivery for small schools
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily use
 
Bgoug 2019.11 test your pl sql - not your patience
Bgoug 2019.11   test your pl sql - not your patienceBgoug 2019.11   test your pl sql - not your patience
Bgoug 2019.11 test your pl sql - not your patience
 
Master Continuous Delivery with CloudBees Jenkins Platform
Master Continuous Delivery with CloudBees Jenkins PlatformMaster Continuous Delivery with CloudBees Jenkins Platform
Master Continuous Delivery with CloudBees Jenkins Platform
 
Git Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-Flow
 
Collaborative development with git
Collaborative development with gitCollaborative development with git
Collaborative development with git
 
Contributing to Koha
Contributing to KohaContributing to Koha
Contributing to Koha
 
2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final
 
Git best practices 2016
Git best practices 2016Git best practices 2016
Git best practices 2016
 
JUC Europe 2015: Plugin Development with Gradle and Groovy
JUC Europe 2015: Plugin Development with Gradle and GroovyJUC Europe 2015: Plugin Development with Gradle and Groovy
JUC Europe 2015: Plugin Development with Gradle and Groovy
 
Moderne Android Builds mit Gradle
Moderne Android Builds mit GradleModerne Android Builds mit Gradle
Moderne Android Builds mit Gradle
 
Golang Microservices meetup
Golang Microservices meetupGolang Microservices meetup
Golang Microservices meetup
 
Docker introduction in Hardware Company
Docker introduction in Hardware CompanyDocker introduction in Hardware Company
Docker introduction in Hardware Company
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshare
 
Git flow Introduction
Git flow IntroductionGit flow Introduction
Git flow Introduction
 
A painless self-hosted Git service: Gitea
A painless self-hosted Git service: GiteaA painless self-hosted Git service: Gitea
A painless self-hosted Git service: Gitea
 
Writing Commits for You, Your Friends, and Your Future Self
Writing Commits for You, Your Friends, and Your Future SelfWriting Commits for You, Your Friends, and Your Future Self
Writing Commits for You, Your Friends, and Your Future Self
 
jQuery plugin & testing with Jasmine
jQuery plugin & testing with JasminejQuery plugin & testing with Jasmine
jQuery plugin & testing with Jasmine
 
Hacking Git and GitHub
Hacking Git and GitHubHacking Git and GitHub
Hacking Git and GitHub
 
Distributed Versioning Tools, BeJUG 2010
Distributed Versioning Tools, BeJUG 2010Distributed Versioning Tools, BeJUG 2010
Distributed Versioning Tools, BeJUG 2010
 

Similar to [WroclawJUG] Continuous Delivery in OSS using Shipkit

CoC NA 2023 - Reproducible Builds for the JVM and beyond.pptx
CoC NA 2023 - Reproducible Builds for the JVM and beyond.pptxCoC NA 2023 - Reproducible Builds for the JVM and beyond.pptx
CoC NA 2023 - Reproducible Builds for the JVM and beyond.pptx
Hervé Boutemy
 
Application depolyment
Application depolymentApplication depolyment
Application depolyment
shriikantL
 

Similar to [WroclawJUG] Continuous Delivery in OSS using Shipkit (20)

Microservices Development Process at Predix.io
Microservices Development Process at Predix.ioMicroservices Development Process at Predix.io
Microservices Development Process at Predix.io
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
 
3DC Intro to Git Workshop
3DC Intro to Git Workshop3DC Intro to Git Workshop
3DC Intro to Git Workshop
 
Git
GitGit
Git
 
An intro to git
An intro to gitAn intro to git
An intro to git
 
EuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears TrainingEuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears Training
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developers
 
Introduction to git & github
Introduction to git & githubIntroduction to git & github
Introduction to git & github
 
CoC NA 2023 - Reproducible Builds for the JVM and beyond.pptx
CoC NA 2023 - Reproducible Builds for the JVM and beyond.pptxCoC NA 2023 - Reproducible Builds for the JVM and beyond.pptx
CoC NA 2023 - Reproducible Builds for the JVM and beyond.pptx
 
Trunk based development for Beginners
Trunk based development for BeginnersTrunk based development for Beginners
Trunk based development for Beginners
 
Git collaboration
Git collaborationGit collaboration
Git collaboration
 
Nagpur Mulesoft Meetup on CICD using Jenkins
Nagpur Mulesoft Meetup on CICD using JenkinsNagpur Mulesoft Meetup on CICD using Jenkins
Nagpur Mulesoft Meetup on CICD using Jenkins
 
Git+jenkins+rex presentation
Git+jenkins+rex presentationGit+jenkins+rex presentation
Git+jenkins+rex presentation
 
Developing with versioning and CI/CD
Developing with versioning and CI/CDDeveloping with versioning and CI/CD
Developing with versioning and CI/CD
 
Continuous Integration using Jenkins with Python
Continuous Integration using Jenkins with PythonContinuous Integration using Jenkins with Python
Continuous Integration using Jenkins with Python
 
FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CI
 
How We Use GitHub
How We Use GitHubHow We Use GitHub
How We Use GitHub
 
Git sourcecontrolpreso
Git sourcecontrolpresoGit sourcecontrolpreso
Git sourcecontrolpreso
 
Application depolyment
Application depolymentApplication depolyment
Application depolyment
 
Joget Workflow v6 Training Slides - 16 - Preparing Development Environment
Joget Workflow v6 Training Slides - 16 - Preparing Development EnvironmentJoget Workflow v6 Training Slides - 16 - Preparing Development Environment
Joget Workflow v6 Training Slides - 16 - Preparing Development Environment
 

More from MarcinStachniuk

More from MarcinStachniuk (20)

GraphQL - Piękne API w Twojej Aplikacji - KrakowGraphAcademy
GraphQL - Piękne API w Twojej Aplikacji - KrakowGraphAcademyGraphQL - Piękne API w Twojej Aplikacji - KrakowGraphAcademy
GraphQL - Piękne API w Twojej Aplikacji - KrakowGraphAcademy
 
Wroclaw GraphQL - GraphQL in Java
Wroclaw GraphQL - GraphQL in JavaWroclaw GraphQL - GraphQL in Java
Wroclaw GraphQL - GraphQL in Java
 
[DevCrowd] GraphQL - gdy API RESTowe to za mało
[DevCrowd] GraphQL - gdy API RESTowe to za mało[DevCrowd] GraphQL - gdy API RESTowe to za mało
[DevCrowd] GraphQL - gdy API RESTowe to za mało
 
GraphQL - gdy API RESTowe to za mało
GraphQL - gdy API RESTowe to za małoGraphQL - gdy API RESTowe to za mało
GraphQL - gdy API RESTowe to za mało
 
BruJUG Brussels GraphQL when RESR API is to less - lessons learned
BruJUG Brussels GraphQL when RESR API is to less - lessons learnedBruJUG Brussels GraphQL when RESR API is to less - lessons learned
BruJUG Brussels GraphQL when RESR API is to less - lessons learned
 
GraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learnedGraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learned
 
GraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learnedGraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learned
 
GraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learnedGraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learned
 
GraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learnedGraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learned
 
GraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learnedGraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learned
 
GraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learnedGraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learned
 
GraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learnedGraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learned
 
Java Web Start – jak żyć z tą dziwną technologią
Java Web Start – jak żyć z tą dziwną technologiąJava Web Start – jak żyć z tą dziwną technologią
Java Web Start – jak żyć z tą dziwną technologią
 
Zarządzanie zmianami w schemacie relacyjnych baz danych
Zarządzanie zmianami w schemacie relacyjnych baz danychZarządzanie zmianami w schemacie relacyjnych baz danych
Zarządzanie zmianami w schemacie relacyjnych baz danych
 
Inicjatywa NoSQL na przykładzie db4o
Inicjatywa NoSQL na przykładzie db4oInicjatywa NoSQL na przykładzie db4o
Inicjatywa NoSQL na przykładzie db4o
 
Automatic mechanism data migration between relational and object database
Automatic mechanism data migration between relational and object databaseAutomatic mechanism data migration between relational and object database
Automatic mechanism data migration between relational and object database
 
Zastosowanie obiektowych baz danych na przykładzie db4o
Zastosowanie obiektowych baz danych na przykładzie db4oZastosowanie obiektowych baz danych na przykładzie db4o
Zastosowanie obiektowych baz danych na przykładzie db4o
 
Wprowadzenie do J2ME
Wprowadzenie do J2MEWprowadzenie do J2ME
Wprowadzenie do J2ME
 
Java Web Start czyli jak żyć z tą dziwną technologią? & Continuous Delivery w...
Java Web Start czyli jak żyć z tą dziwną technologią? & Continuous Delivery w...Java Web Start czyli jak żyć z tą dziwną technologią? & Continuous Delivery w...
Java Web Start czyli jak żyć z tą dziwną technologią? & Continuous Delivery w...
 
Java Web Start czyli jak żyć z tą dziwną technologią & Continuous Delivery w ...
Java Web Start czyli jak żyć z tą dziwną technologią & Continuous Delivery w ...Java Web Start czyli jak żyć z tą dziwną technologią & Continuous Delivery w ...
Java Web Start czyli jak żyć z tą dziwną technologią & Continuous Delivery w ...
 

Recently uploaded

Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Lisi Hocke
 
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
drm1699
 
Abortion Pill Prices Rustenburg [(+27832195400*)] 🏥 Women's Abortion Clinic i...
Abortion Pill Prices Rustenburg [(+27832195400*)] 🏥 Women's Abortion Clinic i...Abortion Pill Prices Rustenburg [(+27832195400*)] 🏥 Women's Abortion Clinic i...
Abortion Pill Prices Rustenburg [(+27832195400*)] 🏥 Women's Abortion Clinic i...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Abortion Clinic in Midrand [(+27832195400*)]🏥Safe Abortion Pills In Midrand |...
Abortion Clinic in Midrand [(+27832195400*)]🏥Safe Abortion Pills In Midrand |...Abortion Clinic in Midrand [(+27832195400*)]🏥Safe Abortion Pills In Midrand |...
Abortion Clinic in Midrand [(+27832195400*)]🏥Safe Abortion Pills In Midrand |...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Recently uploaded (20)

Effective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeConEffective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeCon
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jGraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
 
Weeding your micro service landscape.pdf
Weeding your micro service landscape.pdfWeeding your micro service landscape.pdf
Weeding your micro service landscape.pdf
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
 
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
Workshop -  Architecting Innovative Graph Applications- GraphSummit MilanWorkshop -  Architecting Innovative Graph Applications- GraphSummit Milan
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
 
Abortion Clinic in Bloemfontein [(+27832195400*)]🏥Safe Abortion Pills In Bloe...
Abortion Clinic in Bloemfontein [(+27832195400*)]🏥Safe Abortion Pills In Bloe...Abortion Clinic in Bloemfontein [(+27832195400*)]🏥Safe Abortion Pills In Bloe...
Abortion Clinic in Bloemfontein [(+27832195400*)]🏥Safe Abortion Pills In Bloe...
 
Your Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | EvmuxYour Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | Evmux
 
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
 
Abortion Pill Prices Polokwane ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Polokwane ](+27832195400*)[ 🏥 Women's Abortion Clinic in...Abortion Pill Prices Polokwane ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Polokwane ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
 
BusinessGPT - Security and Governance for Generative AI
BusinessGPT  - Security and Governance for Generative AIBusinessGPT  - Security and Governance for Generative AI
BusinessGPT - Security and Governance for Generative AI
 
Abortion Pill Prices Rustenburg [(+27832195400*)] 🏥 Women's Abortion Clinic i...
Abortion Pill Prices Rustenburg [(+27832195400*)] 🏥 Women's Abortion Clinic i...Abortion Pill Prices Rustenburg [(+27832195400*)] 🏥 Women's Abortion Clinic i...
Abortion Pill Prices Rustenburg [(+27832195400*)] 🏥 Women's Abortion Clinic i...
 
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMs
 
Abortion Clinic In Pongola ](+27832195400*)[ 🏥 Safe Abortion Pills In Pongola...
Abortion Clinic In Pongola ](+27832195400*)[ 🏥 Safe Abortion Pills In Pongola...Abortion Clinic In Pongola ](+27832195400*)[ 🏥 Safe Abortion Pills In Pongola...
Abortion Clinic In Pongola ](+27832195400*)[ 🏥 Safe Abortion Pills In Pongola...
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...
Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...
Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...
 
Abortion Clinic in Midrand [(+27832195400*)]🏥Safe Abortion Pills In Midrand |...
Abortion Clinic in Midrand [(+27832195400*)]🏥Safe Abortion Pills In Midrand |...Abortion Clinic in Midrand [(+27832195400*)]🏥Safe Abortion Pills In Midrand |...
Abortion Clinic in Midrand [(+27832195400*)]🏥Safe Abortion Pills In Midrand |...
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 

[WroclawJUG] Continuous Delivery in OSS using Shipkit

  • 1. Continuous Delivery in OSS Using Shipkit Marcin Stachniuk
  • 3. About you! ● Who is developer of Open Source Software? ● How do you release new version? ● Do you plan to contribute to Open Source?
  • 4. Do you like manage releases? ● To include a feature in a release or not? ● Am I ready to release or should I test more? ● Oh no… release notes… ● Build, sign, release, tag, etc. ● Documentation?
  • 6. Shipkit - main principles ● Almost every merged pull request lands new version in JCenter / Maven Central ● Easy to use, smart defaults ● Configure once and use all the time ● Automate as much as possible ● Don’t need to manage CI server
  • 7. Shipkit workflow JCenter 1. Merge PR to master 2. Start a build 3. Create tag, bump version, update release notes update documentation 4. Release5. Release 6. Sync
  • 8. Why JCenter? ● Maven Central requirements: ○ Supply Javadoc and Sources ○ Sign Files with GPG/PGP ○ Sufficient Metadata in pom: groupId, artifactId, version, project(name, description, url), information about(license, developer, SCM) ● Stability of Maven Central (in the past) JCenter: ● Less restrictive ● Sign files ● Better stability ● Automatically sync with JCenter and Maven Central (retry when Maven Central is down)
  • 9. What can Shipkit? ● Bump version ● Generate release notes ● Upload release notes to repo and GitHub Release page ● Create a git tag ● Check if new release is needed ● Test dependers (downstreams projects) ● Release to JCenter and Maven Central ● Release unpacked Javadoc in HTML format ● Release plugins to Gradle Portal
  • 10. Task 1 - init project & add Shipkit ● Fork https://github.com/mstachniuk/shipkit-workshop on GitHub ● Change name ● Add me as collaborator ● Enable issues: Settings -> Issues ● Send the link to the repo to me! ● Clone your repo to local machine ● Change project name in settings.gradle ● Import to IntelliJ Idea ● Add in build.gradle in plugins section: id 'org.shipkit.java' version '2.2.2' ● Run: ./gradlew initShipkit ● Check a diff in your IDE
  • 11. What add Shipkit to the project #Version of the produced binaries. This file is intended to be checked-in. #It will be automatically bumped by release automation. version=1.0-SNAPSHOT version.properties > Task :initVersioning Configured '1.0-SNAPSHOT' version in 'version.properties' file. Please remove 'version=1.0-SNAPSHOT' setting from *.gradle file. Please review and check in generated file: version.properties Version number is now stored in 'version.properties' file. Don't set 'version' in *.gradle file. ./gradlew initShipkit
  • 12. What add Shipkit to the project Please change version to: 1.0.0 or similar
  • 13. What add Shipkit to the project language: java jdk: - oraclejdk8 install: - true branches: except: - /^vd/ script: - ./gradlew build -s && ./gradlew ciPerformRelease .travis.yml
  • 14. What add Shipkit to the project //This default Shipkit configuration file was created automatically and is intended to be checked-in. //To leverage Shipkit fully, please fix the TODO items, refer to our Getting Started Guide for help: // // https://github.com/mockito/shipkit/blob/master/docs/getting-started.md // shipkit { … } allprojects { plugins.withId("org.shipkit.bintray") { bintray { … }}} gradle/shipkit.gradle
  • 15. What add Shipkit to the project shipkit { //TODO is the repository correct? gitHub.repository = "mstachniuk/shipkit-workshop-XX" //TODO generate and use your own read-only GitHub personal access token gitHub.readOnlyAuthToken = "76826c9ec886612f504d12fd4268b16721c4f85d" //TODO generate GitHub write token, and ensure your Travis CI has this env variable exported gitHub.writeAuthToken = System.getenv("GH_WRITE_TOKEN") } gradle/shipkit.gradle
  • 16. Task 2 - Generate GitHub tokens https://github.com/mockito/shipkit
  • 17. Task 2 - Generate GitHub tokens
  • 18. Task 2 - Generate GitHub tokens ● Copy and store your tokens for the moment (e.g. in text editor) ● Set gitHub.readOnlyAuthToken in shipkit.gradle ● Write GitHub token is mandatory to make commit by Travis CI ● Never commit your write GitHub token!
  • 19. Task 3 - Setup Travis CI ● Go to https://travis-ci.org or https://travis-ci.com ● Log in and Sync repositories ● Add new repository
  • 20. Task 3 - Setup Travis CI ● Enable integration ● Go to settings
  • 21. Task 3 - Setup Travis CI ● Add Environment Variable: Name: GH_WRITE_TOKEN Value: your write token copied from GitHub
  • 22. Task 4 - Create PR ● Create local branch: git checkout -b add-shipkit ● Commit changes
  • 23. Task 4 - Create PR ● Push branch ● Create Pull Request to YOUR master branch (NOT my repo) ● Check build status (do NOT merge yet!) ● Create local branch: git checkout -b branch_name ● Commit changes
  • 24. Task 4 - Create PR
  • 25. Task 4 - Create PR
  • 26. Task 5 - Merge to master ● Merge to master ● Delete old branch ● Check build
  • 27. Task 5 - Merge to master ● Go to: https://bintray.com/shipkit-bootstrap/bootstrap/maven/
  • 28. Success - your first release to JFrog Repository!
  • 29. Files commited by Shipkit <sup><sup>*Release notes were automatically generated by [Shipkit](http://shipkit.org/)*</sup></sup> #### 1.0.0 - 2019-01-06 - 4 commits by [Marcin Stachniuk](https://github.com/mstachniuk) - published to [![Bintray](https://img.shields.io/badge/Bintray-1.0.0-green.svg)](https://bintray.com/shipkit-bootstrap/bootstrap/maven/1.0.0) - Add Shipkit to project [(#2)](https://github.com/mstachniuk/shipkit-workshop/pull/2) docs/release-notes.md
  • 31. Files commited by Shipkit #Version of the produced binaries. This file is intended to be checked-in. #It will be automatically bumped by release automation. version=1.0.0 version.properties #Version of the produced binaries. This file #It will be automatically bumped by releas version=1.0.1 previousVersion=1.0.0
  • 32. Versioning by Shipkit ● Shipkit use property version in version.properties as current version ● The previous version is useful for: ○ Compare current and previous version (check if something was changed) ● Those properties are updated during release ● No SNAPSHOTS, -beta, RC1 versions! ● Shipkit prefers semantic versioning (simplified)
  • 33. Semantic Versioning https://semver.org/ MAJOR.MINOR.PATCH 1. MAJOR version when you make incompatible API changes, 2. MINOR version when you add functionality in a backwards-compatible manner, and 3. PATCH version when you make backwards-compatible bug fixes.
  • 34. Semantic Versioning Specification MAJOR.MINOR.PATCH 1. Software using Semantic Versioning MUST declare a public API. 2. MAJOR, MINOR & PATCH are non-negative integers, and MUST NOT contain leading zeroes. Each element MUST increase numerically. E.g: 1.9.0 -> 1.10.0 -> 1.11.0. 3. The content of released version MUST NOT be modified. Any modification -> new release. 4. Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable. 5. Version 1.0.0 defines the public API.
  • 35. Semantic Versioning Specification MAJOR.MINOR.PATCH 6. Patch version Z (x.y.Z | x > 0) MUST be incremented if only backwards compatible bug fixes are introduced. A bug fix is defined as an internal change that fixes incorrect behavior. 7. Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backwards compatible functionality is introduced to the public API or if any public API functionality is marked as deprecated. It MAY be incremented if substantial new functionality or improvements are introduced within the private code. It MAY include patch level changes. Patch version MUST be reset to 0 when minor version is incremented.
  • 36. Semantic Versioning Specification MAJOR.MINOR.PATCH 8. Major version X (X.y.z | X > 0) MUST be incremented if any backwards incompatible changes are introduced to the public API. It MAY include minor and patch level changes. Patch and minor version MUST be reset to 0 when major version is incremented. More 9-11: https://semver.org/
  • 37. Semantic Versioning - Quiz It’s time for: QUIZ Can be multichoice ;-)
  • 38. Task 6: Configure Release Notes ● Add to Shipkit configuration: releaseNotes.labelMapping = [ 'enhancement': 'New feature', 'bug': 'Bug', 'docs': 'Documentation' ] team.developers = ['mstachniuk:Marcin Stachniuk', '<GH-login>:<GH-name>'] team.contributors = ['mstachniuk:Marcin Stachniuk', '<GH-login>:<GH-name>'] team.ignoredContributors = ['mstachniuk:Marcin Stachniuk', '<GH-login>:<GH-name>'] ● Create PR, but NOT merge yet!
  • 39. Task 6: Configure Release Notes ● Merge PR and add to message: [ci skip-release]
  • 40. Task 6: Configure Release Notes [ci skip-release] at the end of commit message prevent: ● publish release ● create tag ● update release notes [ci skip] at the end of commit message prevent: ● execute a build ● add PR to release notes It’s useful for commits made automatically by Shipkit You can configure that by: git.commitMessagePostfix = "[ci skip]" releaseNotes.ignoreCommitsContaining = ["[ci skip]"]
  • 41. Task 7: Release Notes ● See issues ● Create PR for: “Floating point support” ● Add enhancement label to PR
  • 43. Task 7: Release Notes ● Merge adding [ci skip-release] ● Remember about good PR name i.e.: Fix #NUMBER long support ● See issues ● Create PR for: “Long support” ● Add enhancement label to PR ● Repeat for: float, BigInteger and BigDecimal (the last one - no [ci skip-release])
  • 44. Task 7: Release Notes ● Merge PR and see release notes: releaseNotes.labelMapping = [ 'enhancement': 'New features', 'bug': 'Bug', ]
  • 45. Task 7: Release Notes <project> <!-- ... --> <developers> <developer> <id>mstachniuk</id> <name>Marcin Stachniuk</name> <roles> <role>Core developer</role> </roles> <url>https://github.com/mstachniuk</url> </developer> </developers> shipkit-workshop-1.0.2.pom <contributors> <contributor> <name>shipkit.org automated bot</name> <url>https://github.com/shipkit-org</url> </contributor> <contributor> <name>Twin Twist</name> <url>https://github.com/TwinTwist</url> </contributor> </contributors> </project>
  • 46. Task 8: Compare publications ● See issues ● Create PR for: “Readme file is missing” - Please don’t change anything outside Readme.md ● Merge and see build output
  • 47. Task 8: Compare publications
  • 48. How to skip release? ● Set SKIP_RELEASE environment variable matrix: include: - jdk: oraclejdk8 - jdk: oraclejdk9 env: SKIP_RELEASE=true - jdk: openjdk10 env: SKIP_RELEASE=true - jdk: openjdk11 env: SKIP_RELEASE=true .travis.yml
  • 49. How to skip release? ● Add to commit message suffix: [ci skip-release] ● When Pull Request is build ● Building on NOT release branch, default: master|release/.+ ○ Can be changed by: git.releasableBranchRegex = "branch_regex" ● No changes in binaries ○ Source jars ○ dependency-info.json (file generated by Shipkit and store in source jar) ● Commit contains suffix: [ci skip-compare-publications] ● Set property 'skipComparePublications' on task releaseNeeded to true (see Mockito release model) ● Set SKIP_RELEASE environment variable
  • 50. Building PR from community
  • 51. Task 9: Compare publications - modify Javadoc ● See issues ● Create PR for: “Javadoc for MathUtils class is missing” ● Merge and see build output
  • 52. Task 9: Compare publications - modify Javadoc
  • 53. Task 10: Ship Javadoc ● Create on your Github account project: shipkit-workshop-X-javadoc ● Add in your project: apply plugin: "org.shipkit.java" // enable Shipkit Javadoc plugin. apply plugin: "org.shipkit.javadoc" ● Make some change in the code ● Commit, create PR, merge ● Check shipkit-workshop-X-javadoc on the GitHub
  • 54. Shipping Javadoc configuration options // OPTIONAL GitHub repository (owner/repo) where Javadocs are shipped. // The default value is gitHub.repository + "-javadoc" javadoc.repository = "mstachniuk/shipkit-example-javadoc" // OPTIONAL GitHub Javadoc repository branch name. The branch needs to exist. // By default it's using the branch set as main in GitHub repo, usually master. javadoc.repositoryBranch = "gh-pages" // OPTIONAL GitHub Javadoc repository directory where put javadoc files. By default it's project root directory. javadoc.repositoryDirectory = "dir1/dir2" // OPTIONAL Commit message used to commit Javadocs. Default: "Update current and ${version} Javadocs. [ci skip]" // You can override this message and ${version} will be replaced by currently build version. // You don't need to specify "[ci skip]" in your message - it will be added automatically. javadoc.commitMessage = "Update Javadoc by awesome Shipkit"
  • 56. Configuration possibilities - GitHub Enterprise // OPTIONAL GitHub url, default: https://github.com // It's useful when you're using on-premises GitHub Enterprise. gitHub.url = "https://github.com" // OPTIONAL GitHub API url, default: https://api.github.com // It's useful when you're using on-premises GitHub Enterprise. gitHub.apiUrl = "https://api.github.com"
  • 57. Configuration possibilities - Release Notes location // OPTIONAL Path to file where release notes will be generated by Shipkit, default: docs/release-notes.md releaseNotes.file = "docs/release-notes.md"
  • 58. Configuration possibilities - Publication repository // OPTIONAL Publication Repository where we look for your published binary, default: empty // It is currently used to configure repository Badge URL when generating release notes. releaseNotes.publicationRepository = ""
  • 59. Configuration possibilities - Git settings for commits made by Shipkit // OPTIONAL Git user for creating commit, tag and Pull Request with release notes, default: shipkit-org git.user = "shipkit-org" // OPTIONAL Git user email for creating commit, tag and Pull Request with release notes, default: <shipkit.org@gmail.com> git.email = "<shipkit.org@gmail.com>"
  • 60. Configuration possibilities - Tag prefix // OPTIONAL Prefix added to the version to create VCS-addressable tag, default: v // Empty string is ok and it means that there is not prefix. git.tagPrefix = "v"
  • 61. Publish to Maven Central How to publish to Maven Central?
  • 62. Publish to Maven Central How to create account on Maven Central?
  • 63. Publish to Maven Central ● Create account: https://issues.sonatype.org/ ● Create new issue ● Generate tokens: https://solidsoft.wordpress.com/2015/09/08/deploy-to-maven-central-using-api-key- aka-auth-token/ ● Set tokens in TravisCI
  • 64. Publish to Maven Central bintray { key = '7ea297848ca948adb7d3ee92a83292112d7ae989' pkg { //TODO configure Bintray settings per your project (https://github.com/bintray/gradle-bintray-plugin) repo = 'bootstrap' user = 'shipkit-bootstrap-bot' userOrg = 'shipkit-bootstrap' name = 'maven' licenses = ['MIT'] labels = ['continuous delivery', 'release automation', 'shipkit'] } } gradle/shipkit.gradle bintray { key = System.getenv("BINTRAY_API_KEY") pkg { repo = 'mstachniuk-maven-repo' user = 'mstachniuk' name = 'maven' licenses = ['MIT'] labels = ['graphql', 'kotlin', 'java', 'schema'] version { mavenCentralSync { sync = true user = System.env.NEXUS_TOKEN_USER password = System.env.NEXUS_TOKEN_PWD } } } }
  • 65. How to deliver Gradle plugin? ● The best example is Shipkit project itself ● In your build.gradle: apply plugin: 'com.gradle.plugin-publish'
  • 66. Incubating Features - upgrade downstream ● Check if new version works with dependers (child / downstream projects) apply plugin: 'org.shipkit.ci-upgrade-downstream' upgradeDownstream { repositories = ['mockito/shipkit-example', 'mockito/shipkit'] }
  • 67. Incubating Features - upgrade dependency Child depends on parent project. In child project you can execute: ./gradlew performVersionUpgrade -Pdependency=parentGroup:parentArtifactName:parentVersion It will create PR for you. When all check are green you can merge it. More info: https://github.com/mockito/shipkit/blob/master/docs/gradle-plugins/upgrade-dependen cy-plugin.md
  • 68. Tips and hacks - do not release everything ● Do not release each module In module/build.gradle file: bintrayUpload.enabled = false
  • 69. Tips and hacks - license ● Another (not MIT) licence in POM (See #755) In shipkit.gradle file: plugins.withId("org.shipkit.java-publish") { publishing.publications.javaLibrary.pom.withXml { //refer to Groovy xml Node reference for more info how to manipulate xml asNode().licenses.replaceNode { licenses { license { name "Eclipse Public License v2.0" url "http://www.eclipse.org/legal/epl-v20.html" } } }}}
  • 70. Tips and hacks - Mockito release model Mockito release model (#911): ● all versions are released in JCenter ● some of them are released in Maven Central
  • 71. Tips and hacks - Mockito release model boolean centralRelease = System.getenv("TRAVIS_COMMIT_MESSAGE") ?.contains("[ci maven-central-release]") mavenCentralSync { sync = centralRelease } afterEvaluate { [assertReleaseNeeded, releaseNeeded].each { it.skipComparePublications = centralRelease } } More: https://github.com/mockito/mockito/blob/release/2.x/gradle/shipkit.gradle
  • 72. Tips and hacks - Support for Bitrise.io envman add --key TRAVIS_PULL_REQUEST --value "${PR}" envman add --key TRAVIS_BRANCH --value "${BITRISE_GIT_BRANCH}" envman add --key TRAVIS_COMMIT_MESSAGE --value "${BITRISE_GIT_MESSAGE}"
  • 74. Our plans ● Work on getting the community adopt Shipkit ● Continue work on incubating and new features ● Support OSS and enterprise in transition into CI/CD model ● Solve issues
  • 75. Continuous Delivery in OSS Using Shipkit Marcin Stachniuk