SlideShare a Scribd company logo
CI/CD on Android project via
Jenkins Pipeline
Veaceslav Gaidarji
Android Department Manager @ Ellation
1
About
Android department manager
Open-source and Jenkins enthusiast
Certified Jenkins Engineer
2
Agenda
VRV Android - project info
Jenkins old to new
Jenkins Shared Library
Testing Jenkins Pipeline code
What went wrong
Pros/Cons
3
Agenda
VRV Android - project info
Jenkins old to new
Jenkins Shared Library
Testing Jenkins Pipeline code
What went wrong
Pros/Cons
4
Agenda
VRV Android - project info
Jenkins old to new
Jenkins Shared Library
Testing Jenkins Pipeline code
What went wrong
Pros/Cons
5
Agenda
VRV Android - project info
Jenkins old to new
Jenkins Shared Library
Testing Jenkins Pipeline code
What went wrong
Pros/Cons
6
Agenda
VRV Android - project info
Jenkins old to new
Jenkins Shared Library
Testing Jenkins Pipeline code
What went wrong
Pros/Cons
7
Agenda
VRV Android - project info
Jenkins old to new
Jenkins Shared Library
Testing Jenkins Pipeline code
What went wrong
Pros/Cons
8
VRV Android
project info
9
VRV Android project info
Kotlin + Java
4 build types (debug/alpha/beta/release)
Unit tests + JaCoCo
Checkstyle + ktlint
Android Lint
Fabric.Beta
Gitflow
10
VRV Android project info
Kotlin + Java
4 build types (debug/alpha/beta/release)
Unit tests + JaCoCo
Checkstyle + ktlint
Android Lint
Fabric.Beta
Gitflow
11
VRV Android project info
Kotlin + Java
4 build types (debug/alpha/beta/release)
Unit tests + JaCoCo
Checkstyle + ktlint
Android Lint
Fabric.Beta
Gitflow
12
VRV Android project info
Kotlin + Java
4 build types (debug/alpha/beta/release)
Unit tests + JaCoCo
Checkstyle + ktlint
Android Lint
Fabric.Beta
Gitflow
13
VRV Android project info
Kotlin + Java
4 build types (debug/alpha/beta/release)
Unit tests + JaCoCo
Checkstyle + ktlint
Android Lint
Fabric.Beta
Gitflow
14
VRV Android project info
Kotlin + Java
4 build types (debug/alpha/beta/release)
Unit tests + JaCoCo
Checkstyle + ktlint
Android Lint
Fabric.Beta
Gitflow
15
VRV Android project info
Kotlin + Java
4 build types (debug/alpha/beta/release)
Unit tests + JaCoCo
Checkstyle + ktlint
Android Lint
Fabric.Beta
Gitflow
16
Jenkins old to new
17
Jenkins old (VRV Android)
18
Jenkins old (VRV Android)
19
Jenkins old (VRV Android)
./gradlew check assembleAlpha crashlyticsUploadDistributionAlpha
20
Jenkins new (VRV Android)
Multibranch pipeline
Jenkinsfile
Jenkins Shared Library
21
Jenkins new (VRV Android)
Multibranch pipeline
Jenkinsfile
Jenkins Shared Library
22
Jenkins new (VRV Android)
Multibranch pipeline
Jenkinsfile
Jenkins Shared Library
23
Multibranch pipeline
24
Multibranch pipeline
25
Jenkinsfile
#!groovy
def pipeline = new AndroidPipeline()
stage('build') {
pipeline.build()
}
stage('test') {
pipeline.test()
}
stage('distribute') {
pipeline.distribute()
}
stage('post build') {
pipeline.notify(...)
}
26
Jenkins new (VRV Android)
27
Jenkins new (VRV Android)
28
Jenkins new (VRV Android)
29
Jenkins new (VRV Android)
30
Jenkins new (VRV Android)
31
Jenkins
Shared Library
32
Jenkins Shared Library
Default
(root)
+- src # Groovy source files
| +- org
| +- foo
| +- Bar.groovy # for org.foo.Bar class
+- vars
| +- foo.groovy # for global 'foo' variable
| +- foo.txt # help for 'foo' variable
+- resources # resource files (external libraries only)
| +- org
| +- foo
| +- bar.json # static helper data for org.foo.Bar
33
Jenkins Shared Library
Ellation
(root)
+- src # Groovy source files
| +- AndroidPipeline.groovy # <------Android------>
+- vars # global scripts/variables
+- .jenkins
| +- Jenkinsfile # CI
+- test # unit tests
+- integrationTest # integration tests
+- scripts # helper classes
+- jenkinsfile # pipeline template files
34
Jenkins Shared Library
AndroidPipeline.groovy
- 500 LOC
- ~40 methods
35
Jenkins Shared Library
def build() {
step1()
step2()
step3()
}
def test() {
//
}
def distribute() {
//
}
def notify(…) {
//
}
36
Jenkins Shared Library
def build() {
step1() // Step1Implementation.groovy
step2() // Step2Implementation.groovy
step3() // Step3Implementation.groovy
}
def test() {
//
}
def distribute() {
//
}
def notify(…) {
//
}
37
Jenkins Shared Library
def build() {
cleanBuildFolder()
acceptAndroidLicenses()
initializeBuildConfig()
updateBuildNumber()
runCodeStyleChecks()
unitTests()
buildProject()
saveChangelogToFile()
}
38
Jenkins Shared Library
def test() {
runLint()
scanForOpenTasks()
publishLintResults()
publishJunitResults()
publishJacocoCoverage()
publishCheckstyleResults()
publishHtmlReports()
publishApplicationInfo()
}
39
Jenkins Shared Library
def distribute() {
archiveArtifactsTask()
uploadToFabric()
//uploadToPlayMarket()
}
40
Jenkins Shared Library
def notify(String currentBuildResult) {
if (currentBuildResult == ‘SUCCESS’) {
publishGitTag()
addLinkToBuildToJiraTicket()
updateJiraTicketStatus()
} else {
notifyBuildFailedViaSlack()
}
notifyViaEmail()
cleanWs cleanWhenFailure: false
}
41
Testing Jenkins
Pipeline code
42
Testing Jenkins Pipeline code
AndroidPipeline.groovy
- 500 LOC
- ~40 methods
- 4 methods covered
(unit/integration tests)
43
Testing Jenkins Pipeline code
@Test
void incrementsBuildNumber() {
WorkflowRun build = r.assertBuildStatusSuccess(
createWorkflowJob(“projectUnderTest”,
"""
@Library(‘ellation@master’) _
import com.ellation.android.build.version.DiskNextBuildNumber
import com.ellation.android.build.version.DiskBuildNumberDataSource
node {
def nextBuildNumber = new DiskNextBuildNumber(
new DiskBuildNumberDataSource(env), “test-project”, “alpha”
)
nextBuildNumber.set(15)
int next = nextBuildNumber.next()
echo “Next build number is $next”
}
"""
).scheduleBuild2(0))
r.assertLogContains(“Next build number is 16”, build)
} 44
What went wrong
45
What went wrong
Update build number
Publish Git tag
Plots
Upload to Google Play
3rd-party libraries in pipeline code
Parallel builds on slaves
Slack notifications
46
What went wrong
Update build number
Publish Git Tag
Plots
Upload to Google Play
3rd-party libraries in pipeline code
Parallel builds on slaves
Slack notifications
47
What went wrong
Update build number
Publish Git tag
Plots
Upload to Google Play
3rd-party libraries in pipeline code
Parallel builds on slaves
Slack notifications
48
What went wrong
Update build number
Publish Git tag
Plots
Upload to Google Play
3rd-party libraries in pipeline code
Parallel builds on slaves
Slack notifications
49
What went wrong
Update build number
Publish Git tag
Plots
Upload to Google Play
3rd-party libraries in pipeline code
Parallel builds on slaves
Slack notifications
50
What went wrong
Update build number
Publish Git tag
Plots
Upload to Google Play
3rd-party libraries in pipeline code
Parallel builds on slaves
Slack notifications
51
What went wrong
Update build number
Publish Git tag
Plots
Upload to Google Play
3rd-party libraries in pipeline code
Parallel builds on slaves
Slack notifications
52
Update build number
53
Update build number
Next Build Number plugin
- no pipeline support
- see JENKINS-33046
54
Update build number
Multibranch
Branch1: (1,2,3,)
Branch2: (1,2,3,)
Develop: (1,2,3,)
Requirement
Branch1: (1,2,3,)
Branch2: (4,5,6,)
Develop: (7,8,9,)
55
Update build number
56
Update build number
android-build-numbers
/vrv-android
/alpha
/build-number.txt // with value 526
57
Publish Git tag
58
Publish Git tag
Git Publisher plugin
- no pipeline support
- see JENKINS-28335
- https://github.com/vgaidarji/test-jenkins-
sshagent
59
Plots
60
Plots
Plot plugin
- [JENKINS-35571] Make compatible with Pipeline
- see https://github.com/jenkinsci/plot-plugin/pull/32
61
Upload to Google Play
62
Upload to Google Play
Android application
- build number 1..10000
Android TV application
- build number 10000+
Upload failed: Devices with version 10002 of this app
would be downgraded to version 54 if they met the following criteria
63
3rd-party libraries in pipeline code
64
3rd-party libraries in pipeline code
package com.test
@Grapes([
@Grab(group = ‘com.squareup.okhttp3’, module = ‘okhttp’, version = ‘3.9.1’),
@Grab(group = ‘com.google.code.gson’, module = ‘gson’, version = ‘2.7’)
])
import com.google.gson.Gson
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
class A {}
65
Parallel builds on slaves
66
Parallel builds on slaves
1 slave, 4 executors (8 GB RAM):
java.lang.IllegalStateException: failed to analyze:
java.lang.OutOfMemoryError: GC overhead limit exceeded
4 slaves, 4 executors (16 GB RAM each) = profit!!!
67
Slack notifications
68
Slack notifications
69
Pros/Cons
70
Pros
Single Jenkins master
Shared pipeline code
Code review of pipeline changes
Pipeline as a code
Tests
71
Pros
Single Jenkins master
Shared pipeline code
Code review of pipeline changes
Pipeline as a code
Tests
72
Pros
Single Jenkins master
Shared pipeline code
Code review of pipeline changes
Pipeline as a code
Tests
73
Pros
Single Jenkins master
Shared pipeline code
Code review of pipeline changes
Pipeline as a code
Tests
74
Pros
Single Jenkins master
Shared pipeline code
Code review of pipeline changes
Pipeline as a code
Tests
75
Cons
Single Jenkins master
Shared pipeline code
Code review of pipeline changes
Learning curve
Debugging
76
Cons
Single Jenkins master
Shared pipeline code
Code review of pipeline changes
Learning curve
Debugging
77
Cons
Single Jenkins master
Shared pipeline code
Code review of pipeline changes
Learning curve
Debugging
78
Cons
Single Jenkins master
Shared pipeline code
Code review of pipeline changes
Learning curve
Debugging
79
Cons
Single Jenkins master
Shared pipeline code
Code review of pipeline changes
Learning curve
Debugging
80
Useful
information
81
Useful information
https://github.com/vgaidarji/ci-matters/jenkins/Jenkinsfile
82
Any
Questions?
Veaceslav Gaidarji
https://github.com/vgaidarji/
83

More Related Content

What's hot

Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Edureka!
 
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins PipelinesAn Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
Steffen Gebert
 
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 PipelineDelivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Slawa Giterman
 
sed.pdf
sed.pdfsed.pdf
sed.pdf
MaenAlWedyan
 
Docker and Jenkins Pipeline
Docker and Jenkins PipelineDocker and Jenkins Pipeline
Docker and Jenkins Pipeline
Mark Waite
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
Steffen Gebert
 
Jenkins Declarative Pipelines 101
Jenkins Declarative Pipelines 101Jenkins Declarative Pipelines 101
Jenkins Declarative Pipelines 101
Malcolm Groves
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
Jules Pierre-Louis
 
Voxxed Luxembourd 2016 Jenkins 2.0 et Pipeline as code
Voxxed Luxembourd 2016 Jenkins 2.0 et Pipeline as codeVoxxed Luxembourd 2016 Jenkins 2.0 et Pipeline as code
Voxxed Luxembourd 2016 Jenkins 2.0 et Pipeline as code
Damien Duportal
 
Jenkins, pipeline and docker
Jenkins, pipeline and docker Jenkins, pipeline and docker
Jenkins, pipeline and docker
AgileDenver
 
Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0
Steffen Gebert
 
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems IntegrationJenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Oleg Nenashev
 
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Steffen Gebert
 
Ci with jenkins docker and mssql belgium
Ci with jenkins docker and mssql belgiumCi with jenkins docker and mssql belgium
Ci with jenkins docker and mssql belgium
Chris Adkin
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
Jules Pierre-Louis
 
Let's go HTTPS-only! - More Than Buying a Certificate
Let's go HTTPS-only! - More Than Buying a CertificateLet's go HTTPS-only! - More Than Buying a Certificate
Let's go HTTPS-only! - More Than Buying a Certificate
Steffen Gebert
 
Continuous Integration With Jenkins Docker SQL Server
Continuous Integration With Jenkins Docker SQL ServerContinuous Integration With Jenkins Docker SQL Server
Continuous Integration With Jenkins Docker SQL Server
Chris Adkin
 
Open Source tools overview
Open Source tools overviewOpen Source tools overview
Open Source tools overview
Luciano Resende
 
Jenkins pipeline as code
Jenkins pipeline as codeJenkins pipeline as code
Jenkins pipeline as code
Mohammad Imran Ansari
 
CI/CD Pipeline as a Code using Jenkins 2
CI/CD Pipeline as a Code using Jenkins 2CI/CD Pipeline as a Code using Jenkins 2
CI/CD Pipeline as a Code using Jenkins 2
Mayank Patel
 

What's hot (20)

Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
 
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins PipelinesAn Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
 
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 PipelineDelivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
 
sed.pdf
sed.pdfsed.pdf
sed.pdf
 
Docker and Jenkins Pipeline
Docker and Jenkins PipelineDocker and Jenkins Pipeline
Docker and Jenkins Pipeline
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
 
Jenkins Declarative Pipelines 101
Jenkins Declarative Pipelines 101Jenkins Declarative Pipelines 101
Jenkins Declarative Pipelines 101
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 
Voxxed Luxembourd 2016 Jenkins 2.0 et Pipeline as code
Voxxed Luxembourd 2016 Jenkins 2.0 et Pipeline as codeVoxxed Luxembourd 2016 Jenkins 2.0 et Pipeline as code
Voxxed Luxembourd 2016 Jenkins 2.0 et Pipeline as code
 
Jenkins, pipeline and docker
Jenkins, pipeline and docker Jenkins, pipeline and docker
Jenkins, pipeline and docker
 
Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0
 
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems IntegrationJenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
 
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
 
Ci with jenkins docker and mssql belgium
Ci with jenkins docker and mssql belgiumCi with jenkins docker and mssql belgium
Ci with jenkins docker and mssql belgium
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 
Let's go HTTPS-only! - More Than Buying a Certificate
Let's go HTTPS-only! - More Than Buying a CertificateLet's go HTTPS-only! - More Than Buying a Certificate
Let's go HTTPS-only! - More Than Buying a Certificate
 
Continuous Integration With Jenkins Docker SQL Server
Continuous Integration With Jenkins Docker SQL ServerContinuous Integration With Jenkins Docker SQL Server
Continuous Integration With Jenkins Docker SQL Server
 
Open Source tools overview
Open Source tools overviewOpen Source tools overview
Open Source tools overview
 
Jenkins pipeline as code
Jenkins pipeline as codeJenkins pipeline as code
Jenkins pipeline as code
 
CI/CD Pipeline as a Code using Jenkins 2
CI/CD Pipeline as a Code using Jenkins 2CI/CD Pipeline as a Code using Jenkins 2
CI/CD Pipeline as a Code using Jenkins 2
 

Similar to CI/CD on Android project via Jenkins Pipeline

Madrid JAM limitaciones - dificultades
Madrid JAM limitaciones - dificultadesMadrid JAM limitaciones - dificultades
Madrid JAM limitaciones - dificultades
Javier Delgado Garrido
 
Testing with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous DeploymentTesting with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous Deployment
Max Klymyshyn
 
Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!
Roberto Franchini
 
PVS-Studio for Linux (CoreHard presentation)
PVS-Studio for Linux (CoreHard presentation)PVS-Studio for Linux (CoreHard presentation)
PVS-Studio for Linux (CoreHard presentation)
Andrey Karpov
 
RichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile DevicesRichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile Devices
Pavol Pitoňák
 
Jenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipelineJenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipeline
Steffen Gebert
 
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los AngelesJenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Andy Pemberton
 
Uber Mobility Meetup: Mobile Testing
Uber Mobility Meetup:  Mobile TestingUber Mobility Meetup:  Mobile Testing
Uber Mobility Meetup: Mobile Testing
Apple Chow
 
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Docker, Inc.
 
Prepare to defend thyself with Blue/Green
Prepare to defend thyself with Blue/GreenPrepare to defend thyself with Blue/Green
Prepare to defend thyself with Blue/Green
Sonatype
 
All Day DevOps 2016 Fabian - Defending Thyself with Blue Green
All Day DevOps 2016 Fabian - Defending Thyself with Blue GreenAll Day DevOps 2016 Fabian - Defending Thyself with Blue Green
All Day DevOps 2016 Fabian - Defending Thyself with Blue Green
Fab L
 
Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)
Ontico
 
Everything as a code
Everything as a codeEverything as a code
Everything as a code
Aleksandr Tarasov
 
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and JenkinsContinuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Marcel Birkner
 
GeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassleGeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassle
Anton Arhipov
 
Level Up Your Android Build -Droidcon Berlin 2015
Level Up Your Android Build -Droidcon Berlin 2015Level Up Your Android Build -Droidcon Berlin 2015
Level Up Your Android Build -Droidcon Berlin 2015
Friedger Müffke
 
Kubernetes best practices
Kubernetes best practicesKubernetes best practices
Kubernetes best practices
Bill Liu
 
Js tacktalk team dev js testing performance
Js tacktalk team dev js testing performanceJs tacktalk team dev js testing performance
Js tacktalk team dev js testing performance
Артем Захарченко
 
Jenkins & IaC
Jenkins & IaCJenkins & IaC
Jenkins & IaC
HungWei Chiu
 
When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?
Niklas Heidloff
 

Similar to CI/CD on Android project via Jenkins Pipeline (20)

Madrid JAM limitaciones - dificultades
Madrid JAM limitaciones - dificultadesMadrid JAM limitaciones - dificultades
Madrid JAM limitaciones - dificultades
 
Testing with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous DeploymentTesting with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous Deployment
 
Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!
 
PVS-Studio for Linux (CoreHard presentation)
PVS-Studio for Linux (CoreHard presentation)PVS-Studio for Linux (CoreHard presentation)
PVS-Studio for Linux (CoreHard presentation)
 
RichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile DevicesRichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile Devices
 
Jenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipelineJenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipeline
 
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los AngelesJenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
 
Uber Mobility Meetup: Mobile Testing
Uber Mobility Meetup:  Mobile TestingUber Mobility Meetup:  Mobile Testing
Uber Mobility Meetup: Mobile Testing
 
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
 
Prepare to defend thyself with Blue/Green
Prepare to defend thyself with Blue/GreenPrepare to defend thyself with Blue/Green
Prepare to defend thyself with Blue/Green
 
All Day DevOps 2016 Fabian - Defending Thyself with Blue Green
All Day DevOps 2016 Fabian - Defending Thyself with Blue GreenAll Day DevOps 2016 Fabian - Defending Thyself with Blue Green
All Day DevOps 2016 Fabian - Defending Thyself with Blue Green
 
Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)
 
Everything as a code
Everything as a codeEverything as a code
Everything as a code
 
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and JenkinsContinuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
 
GeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassleGeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassle
 
Level Up Your Android Build -Droidcon Berlin 2015
Level Up Your Android Build -Droidcon Berlin 2015Level Up Your Android Build -Droidcon Berlin 2015
Level Up Your Android Build -Droidcon Berlin 2015
 
Kubernetes best practices
Kubernetes best practicesKubernetes best practices
Kubernetes best practices
 
Js tacktalk team dev js testing performance
Js tacktalk team dev js testing performanceJs tacktalk team dev js testing performance
Js tacktalk team dev js testing performance
 
Jenkins & IaC
Jenkins & IaCJenkins & IaC
Jenkins & IaC
 
When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 

CI/CD on Android project via Jenkins Pipeline

Editor's Notes

  1. некоторые детали об этом проекте важные в рамках интеграции с дженкинсом
  2. как мигрировали со старого дженкинса на новый
  3. что это такое и где мы используем
  4. как тестировать pipeline код
  5. что пошло не так или как трудности я встретил самое интересное наверное
  6. ну и +- того что у нас получилось
  7. немного о проекте - SVOD сервис с аниме, гиковскими видосиками и так далее недавно добавили Stargate
  8. Проект был на Java, переписываем на Kotlin (60%)
  9. debug = разработчики alpha = билд с develop или с ветки beta = pre-production release = Google Play
  10. Тестов на проекте не было когда он к нам попал Активно пишем юнит тесты и JaCoCo для покрытия
  11. Checkstyle = Java ktlint = Kotlin code style проверяем
  12. Android Lint = иногда подсказывает о довольно важных проблемах
  13. Fabric.Beta = internal/external builds
  14. Работаем по gitflow (feature develop release hotfix master)
  15. У нас был старый дженкинс где только айос андроид. Там почти ничего не было. И мы должны были всё перенести в новый где все остальные проекты компании.
  16. То как выглядит старый дженкинс, достался в наследство
  17. Если только VRV проект, то 3 задачи
  18. Это почти всё что было внутри задач. Нет интеграции с гитхабом, нет никаких полезных графиков и данных, почти ничего нет. Полу-ручные билды.
  19. Перешли на multibranch pipeline. Расскажу дальше немного подробнее об этом.
  20. Неотъемлемая часть Jenkins Pipeline плагина
  21. Расскажу что это и где мы используем.
  22. Вот так выглядит VRV Android Jenkins задачи. Это multibranch pipeline и ещё одна вспомогательная задача нужная для миграции.
  23. Автоматически создаются задачи в Jenkins из веток и PR. И автоматически удаляются.
  24. Как же работает эта штука? Внутри самого проекта есть Jenkinsfile с инструкциями.
  25. После того как это всё запускается вы увидите ваши стадии. В нашем случае их 4 и в среднем билд занимает 15 минут.
  26. Немного информации о тестах на проекте. Это чуть больше чем за пол года.
  27. Покрытие на этом рисунке не актуально, всё руки не доходят актуализировать. Благо мы следим за тем чтобы тесты были в каждом новом Pull Request и основная бизнес логика покрыта.
  28. Немного дополнительной информации, которая не так часто автоматизируется. Размер приложения очень важен.
  29. Количество методов в проекте. Важный показатель на Андроид проекте.
  30. Вся реализация тех стадий (build test distribute) вынесена в Jenkins Shared Library.
  31. Так выглядит дефолтная библиотека. Исходный код, глобальные переменные и ресурсы.
  32. Так выглядит наш проект. Код для разных типов проектов. AndroidPipeline.groovy. Jenkinsfile - автоматизация самого pipeline проекта. Ну и тесты.
  33. Это 1 класс из 500 строк и примерно 40 атомарных методов.
  34. Более детально выглядит так.
  35. Изначально всё было в 1 файле, но сейчас я занимаюсь улучшением этого дела и выношу то что можно в отдельные независимые классы чтобы переиспользовать.
  36. Подробно о каждом шаге.
  37. Подробно о каждом шаге.
  38. Подробно о каждом шаге. Почему закомментировано расскажу чуть ниже.
  39. Тут много интересных вещей происходит.
  40. Как мы тестируем pipeline code.
  41. Стоит сказать что покрытие пока очень маленькое, всего 4 метода из 40 покрыто.
  42. Есть и юнит тесты, но они обычные, ничего интересного. Так выглядит интеграционный тест.
  43. Что же пошло не так или где я встретил трудности и на что потратил много времени.
  44. В андроиде каждый билд имеет билд номер и они идут по порядку. В старом дженкинсе 1 задача для альфа билдов и всё по порядку.
  45. Git checkout = HTTPS Надо трансформировать в SSH и потом с sshagent отправить можно будет Git.
  46. Графики что вы видели не были совместимы с pipeline. Я сделал это возможным. Там довольный интересный PR, работал с ребятами из Cloudbees.
  47. 2 проекта у нас и build number специфика. Оба плагина не умеют это делать пока - Jenkins/Gradle.
  48. Для Slack-a допустим мне нужно было работать с API. Встроенный сборщик в Groovy = Grapes.
  49. Много коммитов, много билдов, не хватало памяти.
  50. Каждому в приват, вместо общего канала.
  51. Легче администрировать админам.
  52. Другие могут твои методы использовать. Например Slack интеграцию что я сделал.
  53. в гитхабе девопсы ревью делают.
  54. Намного нагляднее и понятнее в коде что происходит чем через UI настраивать.
  55. Можно покрыть тестами и проверить заранее функционал.
  56. обновлять плагины (надо всех подождать и чтобы у всех работало) нет доступа в настройку дженкинса
  57. Надо думать что у других тоже что-то может сломаться, изолированно в своём мирке Андроида уже не поживёшь.
  58. Иногда много времени занимает так как девопсы заняты постоянно и физически не успевают.
  59. Это довольно нетривиально и надо хорошо дженкинс знать и pipeline.
  60. Сложно дебажить. У меня локальный дженкинс всегда запущен.
  61. Немного информации полезной.
  62. Совсем мало, но важно. Я сам использовал то что я давно сделал и 50% pipeline это был тупо copy-paste отсюда.
  63. Там есть вся инфа обо мне. И опен-сорс проекты, и ссылка на блог, твиттер, линкедин.