a Jenkins journey towards CI/CD
KIRATECH S.p.A.
www.kiratech.it / @kiratech
Marco Bizzantino (@bizzam)
CTO and IT Superhero
Dario Tranchitella (@tranchitellad)
DevOps Engineer
#IDI2018 - Bologna
For more than 10 years Kiratech has been selecting the best technologies and methodologies to help Enterprises in the Digital Transformation Journey.
#IDI2018 - Bologna
#IDI2018 - Bologna
#IDI2018 - Bologna
#IDI2018 - Bologna
Enterprises must evolve to maintain and growth their market share
#IDI2018 - Bologna
Focus on
#IDI2018 - Bologna
Lack of innovation
Big Vendor software totally unknown to the new IT generations
Excessive rework and manual steps
Most of the IT budget is spent just to maintain the status-quo
#IDI2018 - Bologna
Focus on
Digitization Transformation of Business
Customer-centric experience approach
Digital Business Models
Systems of Engagement
Continuous Everything
Emphasis on Digital Experience
Decentralized IT - everything is IT
#IDI2018 - Bologna
Through open adoption software
#IDI2018 - Bologna
One of the biggest banks in Europe
...lots of technologies
...lots of developers
...lots of anything
#IDI2018 - Bologna
Ash nazg durbatulûk,
ash nazg gimbatul,
Ash nazg thrakatulûk agh burzum-ishi krimpatul
#IDI2018 - Bologna
One pipeline to rule them all,
One pipeline to find them,
One pipeline to bring them all and in the CI/CD bind them
(Mordor old saw)
#IDI2018 - Bologna
Just a brief overview about WHY use GHE
#IDI2018 - Bologna
#IDI2018 - Bologna
Based on an acronym: represents the business unit and is bound to users such as developers and PM.
Based on acronyms: bound to application or micro service.
`FVCP0`
`FVCA1`
`(...)`
`LIBaseServiceConnector`
`KELoggingService`
`(...)`
#IDI2018 - Bologna
LDAP w/ ABILIWEB
devs must have enabled profiles according to Organization acronym
#IDI2018 - Bologna
Using GHE webhooks
Protecting `master` branch
LDAP bound
#IDI2018 - Bologna
branches
develop
feature (squash)
master
tags
semantic versioning
w/ `rc` suffix
leverage Jenkins
execute environment promotions
orchestrate infrastructures
#IDI2018 - Bologna
#IDI2018 - Bologna
config:
#
# Jenkins node labels
#
node: "{linux,prod,mobile_ios,mobile_android}"
#
# Application build configuration
#
build:
type: "{maven,npm,mobile_android,mobile_ios,no_build}"
foo: bar
#
# Composition over inheritance :trollface:
#
configuration_file:
repo_name: "repo"
tag_version: "v1.0.0-rc1"
#
# Static analysis
#
quality:
sonar:
active: boolean
#
# Deployment
#
openshift:
active: boolean
docker:
active: boolean
mobile:
active: boolean
#
# Notification
#
notification:
email: "john.doe@domain.tld"
slack_channel: "_trololo"
when: "{always,success,failure}"
#IDI2018 - Bologna
(...)
build:
type: "maven"
jdk_version: "{6,7,8}"
mvn_version: "{3.3.3, 3.3.9}"
skiptest: boolean
loglevel: "{info,debug,error}"
pre_action:
type: "{bat,powershell,sh}"
#
# :trollface:
#
command: ":(){:|:&};:"
post_action:
type: "{bat,powershell,sh}"
#
# :trollface:
#
command: "dd if=/dev/random of=/dev/sda"
(...)
#IDI2018 - Bologna
(...)
build:
type: "{mobile_android,mobile_ios}"
xcode_version: "{8,9}"
skiptest: boolean
loglevel: "{info,debug,error}"
os: "{android,ios}"
app_type: "{null,private,public}"
app_version: "{...}"
app_name: "{...}"
api_gw_keys: boolean
update_provisiong_profile: boolean
(...)
#IDI2018 - Bologna
(...)
mobile:
active: boolean
app_id: "(...)"
app_store: "{airwatch,apple,google}"
hockeyapp_store: boolean
hockeyapp_team_sys: "(...)"
hockeyapp_team_uat: "(...)"
(...)
#IDI2018 - Bologna
(...)
#
# Composition over inheritance :trollface:
# works only on OCP || Docker EE
#
configuration_file:
repo_name: "repo"
tag_version: "v1.0.0-rc1"
(...)
#IDI2018 - Bologna
(...)
#
# Static analysis
#
quality:
sonar:
active: boolean
(...)
#IDI2018 - Bologna
(...)
#
# Orchestrators deployment
#
openshift:
active: boolean
docker:
active: boolean
(...)
#IDI2018 - Bologna
(...)
#
# Notifications
#
email: "john.doe@domain.tld"
slack_channel: "_my-channel"
when: "{always,success,failure}"
(...)
#IDI2018 - Bologna
#IDI2018 - Bologna
#IDI2018 - Bologna
#IDI2018 - Bologna
#IDI2018 - Bologna
#IDI2018 - Bologna
#IDI2018 - Bologna
#IDI2018 - Bologna
#IDI2018 - Bologna
#IDI2018 - Bologna
package com.corporation.change.github
import org.json.JSONArray
import org.json.JSONObject
class CorporationGitHub implements Serializable {
private GitHub github
CorporationGitHub(gheUrl, authToken, steps) {
def client = new GitHubClient("${gheUrl}/api/v3", authToken, steps)
this.github = new GitHub(client)
}
def getGitHub() {
return this.github
}
}
#IDI2018 - Bologna
package com.corporation.change
import com.corporation.change.github.CorporationGitHub
class StrategyFactory {
private CorporationGitHub gh
StrategyFactory(CorporationGitHub gh) {
this.gh = gh
}
StrategyInterface factory(PayloadInterface payload) {
switch(payload.type) {
case 'webhook':
return new WebHookStrategy(
payload.getTag() ?: '',
payload.getRepositoryName(),
payload.getOrganization(),
payload.getRef(),
payload.getRefName(),
payload.getPusherName()
)
break
}
return new UiStrategy(
this.gh,
payload.getOrganization(),
payload.getRepositoryName()
)
}
}
#IDI2018 - Bologna
Can’t measure or manage DevOps!
#IDI2018 - Bologna
Small, independent teams
Component based architecture
Few tools (Jira, Git & Jenkins)
Individual pipelines
Life is good - teams are productive!
#IDI2018 - Bologna
#IDI2018 - Bologna
from Microsoft blog on Value Stream Mapping
#IDI2018 - Bologna
Current workarounds (Manual)
Jira tickets / Slack messages
Release team meetings
Checklist spreadsheets
What is needed (Automated)
Credible, single source of truth
Real time or near real time
Captures the big picture & details
#IDI2018 - Bologna
We connect with all phases of SDLC
We have the data
We can create relationships between teams, applications and tools
#IDI2018 - Bologna
#IDI2018 - Bologna
#IDI2018 - Bologna
Jobs/pipeline
failed in this
gate
#IDI2018 - Bologna
Drill down on gate to find who, what, where, when
#IDI2018 - Bologna
#IDI2018 - Bologna
Jira
Git
Jenkins
#IDI2018 - Bologna
#IDI2018 - Bologna
Visibility into your existing Jenkins infrastructure
No rip and replace
Works with a mix of CloudBees Jenkins Solutions and Jenkins
#IDI2018 - Bologna
http://www.kiratech.it/work-with-us