SlideShare a Scribd company logo
QUAND ANDROID RENCONTRE
DOCKER
OLIVIER TOSELLO - MEETUP MOBILE/DOCKER - JUIN 2018
MEETUP DOCKER & ANDROID JUIN 2018
QUI SUIS JE?
▸ 9 ans d’expérience
▸ Dev mobile (iOS, « Android », Rx)
▸ Dev web & back
▸ CTO Attestis
▸ Dev full stack EasyGlobalMarket
▸ CTO Yoobiquity
▸ Architecte logiciel Orange
▸ Développeur web (Limoges)
LA
PROBLÉMATIQUE
MEETUP DOCKER & ANDROID JUIN 2018
COMMENCER UN PROJET / DÉPLOYER LE CI
▸ Installer Java
▸ Installer Gradle
▸ Installer SDK Android / configurer ANDROID_HOME
▸ Installer Ruby
▸ Installer fastlane
▸ Cloner le projet
▸ Builder
▸ Tester
▸ Déployer
▸ ….
MEETUP DOCKER & ANDROID JUIN 2018
▸ Outils de Continuous Delivery
▸ Open source
▸ Création de Screenshots automatisé
▸ Déploiement simplifié
▸ Gestion des certificats (très utile pour iOS)
▸ Nombreux plugins de la communauté…
SOLUTION
DOCKER :
ANDROID
& FASTLANE
MEETUP DOCKER & ANDROID JUIN 2018
CRÉATION D’UNE IMAGE DOCKER ANDROID/FASTLANE
▸ Besoins :
▸ Java
▸ SDK tools Android (https://developer.android.com/
studio/#downloads)
▸ Fastlane (et donc ruby)
MEETUP DOCKER & ANDROID JUIN 2018
DOCKERFILE
FROM openjdk:8
#setup env
ENV SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip" 
ANDROID_HOME="/usr/local/android-sdk" 
ANDROID_VERSION=26 
ANDROID_BUILD_TOOLS_VERSION=26.0.2 
RUBY_VERSION=2.2.8 
FASTLANE_VERSION=2.93.1 
PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
# Install Deps
RUN dpkg --add-architecture i386 && apt-get update 
    && apt-get install -y --force-yes expect wget 
    libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1
# Download Android SDK
RUN mkdir "$ANDROID_HOME" .android 
&& cd "$ANDROID_HOME" 
&& curl -o sdk.zip $SDK_URL 
&& unzip sdk.zip 
&& rm sdk.zip 
&& yes | sdkmanager —licenses
# Install SDK licences
# too long
# Install Android Build Tool and Libraries
RUN sdkmanager --update
RUN sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" 
"platforms;android-${ANDROID_VERSION}" 
« platform-tools"
MEETUP DOCKER & ANDROID JUIN 2018
# Install Ruby.
RUN apt-get update && 
apt-get install -y ruby
# Install fastlane
RUN gem install fastlane -NV -v "$FASTLANE_VERSION"
RUN mkdir /application
WORKDIR /application
#dans votre terminal
docker build -t meetup/android-fastlane .
docker run -it -p <port>:<port-internal> --name <container-name> 
—-volume /application:/src/my/local/project meetup/android-fastlane
#dans le conteneur
docker exec -ti {{idContainer}} gradlew assembleDebug
#OR
docker exec -ti {{idContainer}} fastlane deploy_release
…
…
BUILD & RUN
MEETUP DOCKER & ANDROID JUIN 2018
FASTFILE
default_platform :android
lane :build_debug do
# we clean to perform a fresh install
gradle(task: "clean")
# build the debug variant
gradle(
task: "assemble",
build_type: "debug"
)
end
lane :test_debug do
gradle(task: "test")
End
lane :deploy_debug do
# upload to GooglePlay internal review
upload_to_play_store(
package_name: ‘com.meetup.dockerandroid-debug‘,
track: 'internal',
apk: './app/build/outputs/apk/release/app-debug.apk'
)
slack(
slack_url: "https://hooks.slack.com/services/meetup"
)
end
…
AUTOMATISATION
AVEC JENKINS
Intégration & déploiement
continue
MEETUP DOCKER & ANDROID JUIN 2018
AUTOMATISATION
Commit Build Tests gradle Deploy
Internal
Development
Google play Store
Beta
Prerelease
ReleaseMaster
Docker container
Credentials
MEETUP DOCKER & ANDROID JUIN 2018
PRÉ-REQUIS
▸ Machine Linux avec Docker
▸ Jenkins 2
▸ Plugins :
▸ Bitbucket / GitHub plugin
▸ Docker pipeline
▸ Un projet Android sous Git
MEETUP DOCKER & ANDROID JUIN 2018
PARAMÈTRES JENKINS
▸ Créer un projet « multibranch pipeline »
MEETUP DOCKER & ANDROID JUIN 2018
JENKINSFILE
pipeline {
agent any
options { skipStagesAfterUnstable() } // très important
stages {
stage(‘Inject credentials') {
environment {
GOOGLE_MAPS_API_KEY = credentials(‘GOOGLE_MAPS_API_KEY’)
}
steps {
echo 'Injecting Google Maps credentials...'
sh "sed -i '/<!-- GOOGLE MAPS KEY -—>/c’${env.GOOGLE_MAPS_API_KEY}''
app/src/main/res/values/keys.xml"
}
}
MEETUP DOCKER & ANDROID JUIN 2018
stage('Build') {
agent {
docker { //ici on déclare que l’agent doit tourné dans une image docker
reuseNode true
image 'meetup/android-fastlane'
}
}
steps {
script {
//lancement des lanes
if (BRANCH_NAME ==~ /^release/([a-zA-Z0-9-.])*/) {
echo 'Building prerelease version with fastlane'
sh 'fastlane build_prerelease’
} else if (BRANCH_NAME == 'master') {
echo 'Building release version with fastlane'
sh 'fastlane build_release'
} else {
echo 'Building debug version with fastlane'
sh 'fastlane build_debug'
}
}
}
}
MEETUP DOCKER & ANDROID JUIN 2018
stage('tests') {
agent {
docker {
reuseNode true
image 'meetup/android-fastlane'
}
}
steps {
sh ‘fastlane test_debug’
junit  ‘/app/src/build/test-results/*.xml’
}
}
stage('Deploy') {
agent {
docker {
reuseNode true
image 'meetup/android-fastlane'
}
}
steps {
script {
if (BRANCH_NAME ==~ /^release/([a-zA-Z0-9-.])*/) {
sh 'fastlane deploy_prerelease'
archive 'app/build/outputs/apk/prerelease/app-prerelease.apk'
} else if (BRANCH_NAME == 'master') {
sh 'fastlane deploy_release'
archive 'app/build/outputs/apk/release/app-release.apk'
} else {
sh 'fastlane deploy_debug'
archive 'app/build/outputs/apk/debug/app-debug.apk'
}
}
}
}
PISTES
D’AMELIORATIONS
Intégration & déploiement
continue
MEETUP DOCKER & ANDROID JUIN 2018
ANALYSE DE CODE + UI TESTS + SCREENSHOTS
Commit Build
Testing
Deploy
Docker Android
Credentials
Appium server
Fastlane

Screenshots
Docker Android
UI Testing
Analyse
Docker Infer
MEETUP DOCKER & ANDROID JUIN 2018
CONCLUSION
Approche « Gratuite »
Evite les problèmes multi plateforme
Gain de temps pour les développeurs
Assez complexe à mettre en place
Ne pas sous estimé le coût de la
maintenance
MEETUP DOCKER & ANDROID JUIN 2018
DES ALTERNATIVES SEXY
▸ bitrise.io ==> 36$ / mo
▸ Propose une image Docker Android ( 6GB!)

https://hub.docker.com/r/bitriseio/ 

Toutes les versions dispo SDK & build-tools…
▸ Team City/JetBrains Gratuit (très récent à tester)
MERCI DE VOTRE
ATTENTION!

More Related Content

What's hot

React Ecosystem
React EcosystemReact Ecosystem
React Ecosystem
Craig Jolicoeur
 
Meetup #24 Docker for Node Developer
Meetup #24 Docker for Node DeveloperMeetup #24 Docker for Node Developer
Meetup #24 Docker for Node Developer
MVP Microsoft
 
Lando - AddWeb Solution
Lando - AddWeb Solution Lando - AddWeb Solution
Lando - AddWeb Solution
AddWeb Solution Pvt. Ltd.
 
Fastlane
FastlaneFastlane
Fastlane
Warren Lin
 
CI CD WORKFLOW
CI CD WORKFLOWCI CD WORKFLOW
WWDC 2016 Personal Recollection
WWDC 2016 Personal RecollectionWWDC 2016 Personal Recollection
WWDC 2016 Personal Recollection
Masayuki Iwai
 
WWDC 2016 Personal Recollection
WWDC 2016 Personal RecollectionWWDC 2016 Personal Recollection
WWDC 2016 Personal Recollection
Masayuki Iwai
 
Griffon Presentation
Griffon PresentationGriffon Presentation
Griffon Presentation
Kelly Robinson
 
Griffon: Swing just got fun again
Griffon: Swing just got fun againGriffon: Swing just got fun again
Griffon: Swing just got fun again
James Williams
 
Зоопарк React-у
Зоопарк React-уЗоопарк React-у
Зоопарк React-у
Stfalcon Meetups
 
Qtws19 how-to-build-qml-app-for-webos
Qtws19 how-to-build-qml-app-for-webosQtws19 how-to-build-qml-app-for-webos
Qtws19 how-to-build-qml-app-for-webos
webOSEvangelist
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con Gitlab
Software Guru
 
Docker at Monoco.jp (LinkedIn)
Docker at Monoco.jp (LinkedIn)Docker at Monoco.jp (LinkedIn)
Docker at Monoco.jp (LinkedIn)
Akhmad Fathonih
 
PhoneGap
PhoneGapPhoneGap
PhoneGap
Emil Varga
 
Docking with Docker
Docking with DockerDocking with Docker
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
sangam biradar
 
mekentosj.com - building Papers
mekentosj.com - building Papersmekentosj.com - building Papers
mekentosj.com - building Papers
Alexander Griekspoor
 
Introduction to Tekton
Introduction to TektonIntroduction to Tekton
Introduction to Tekton
Victor Iglesias
 
About OpenGL and Vulkan interoperability (XDC 2020)
About OpenGL and Vulkan interoperability (XDC 2020)About OpenGL and Vulkan interoperability (XDC 2020)
About OpenGL and Vulkan interoperability (XDC 2020)
Igalia
 
Flutter workshop @ bang saen 2020
Flutter workshop @ bang saen 2020Flutter workshop @ bang saen 2020
Flutter workshop @ bang saen 2020
Anuchit Chalothorn
 

What's hot (20)

React Ecosystem
React EcosystemReact Ecosystem
React Ecosystem
 
Meetup #24 Docker for Node Developer
Meetup #24 Docker for Node DeveloperMeetup #24 Docker for Node Developer
Meetup #24 Docker for Node Developer
 
Lando - AddWeb Solution
Lando - AddWeb Solution Lando - AddWeb Solution
Lando - AddWeb Solution
 
Fastlane
FastlaneFastlane
Fastlane
 
CI CD WORKFLOW
CI CD WORKFLOWCI CD WORKFLOW
CI CD WORKFLOW
 
WWDC 2016 Personal Recollection
WWDC 2016 Personal RecollectionWWDC 2016 Personal Recollection
WWDC 2016 Personal Recollection
 
WWDC 2016 Personal Recollection
WWDC 2016 Personal RecollectionWWDC 2016 Personal Recollection
WWDC 2016 Personal Recollection
 
Griffon Presentation
Griffon PresentationGriffon Presentation
Griffon Presentation
 
Griffon: Swing just got fun again
Griffon: Swing just got fun againGriffon: Swing just got fun again
Griffon: Swing just got fun again
 
Зоопарк React-у
Зоопарк React-уЗоопарк React-у
Зоопарк React-у
 
Qtws19 how-to-build-qml-app-for-webos
Qtws19 how-to-build-qml-app-for-webosQtws19 how-to-build-qml-app-for-webos
Qtws19 how-to-build-qml-app-for-webos
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con Gitlab
 
Docker at Monoco.jp (LinkedIn)
Docker at Monoco.jp (LinkedIn)Docker at Monoco.jp (LinkedIn)
Docker at Monoco.jp (LinkedIn)
 
PhoneGap
PhoneGapPhoneGap
PhoneGap
 
Docking with Docker
Docking with DockerDocking with Docker
Docking with Docker
 
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
 
mekentosj.com - building Papers
mekentosj.com - building Papersmekentosj.com - building Papers
mekentosj.com - building Papers
 
Introduction to Tekton
Introduction to TektonIntroduction to Tekton
Introduction to Tekton
 
About OpenGL and Vulkan interoperability (XDC 2020)
About OpenGL and Vulkan interoperability (XDC 2020)About OpenGL and Vulkan interoperability (XDC 2020)
About OpenGL and Vulkan interoperability (XDC 2020)
 
Flutter workshop @ bang saen 2020
Flutter workshop @ bang saen 2020Flutter workshop @ bang saen 2020
Flutter workshop @ bang saen 2020
 

Similar to DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la création de vos applications mobiles Android?

Mobile development in 2020
Mobile development in 2020 Mobile development in 2020
Mobile development in 2020
Bogusz Jelinski
 
React Native
React NativeReact Native
React Native
Craig Jolicoeur
 
Improve your Java Environment with Docker
Improve your Java Environment with DockerImprove your Java Environment with Docker
Improve your Java Environment with Docker
HanoiJUG
 
Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019
Sargis Sargsyan
 
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
Mando Stam
 
Docker Introduction.pdf
Docker Introduction.pdfDocker Introduction.pdf
Docker Introduction.pdf
OKLABS
 
Node Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.jsNode Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.js
Chris Bailey
 
20170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 201720170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 2017
Takayoshi Tanaka
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Xavier Hallade
 
Set up a Development Environment in 5 Minutes
Set up a Development Environment in 5 MinutesSet up a Development Environment in 5 Minutes
Set up a Development Environment in 5 Minutes
Akamai Developers & Admins
 
Docker and Your Path to a Better Staging Environment - webinar by Gil Tayar
Docker and Your Path to a Better Staging Environment - webinar by Gil TayarDocker and Your Path to a Better Staging Environment - webinar by Gil Tayar
Docker and Your Path to a Better Staging Environment - webinar by Gil Tayar
Applitools
 
Continuous Delivery com Docker, OpenShift e Jenkins
Continuous Delivery com Docker, OpenShift e JenkinsContinuous Delivery com Docker, OpenShift e Jenkins
Continuous Delivery com Docker, OpenShift e Jenkins
Bruno Padilha
 
Developing and deploying applications with Spring Boot and Docker (@oakjug)
Developing and deploying applications with Spring Boot and Docker (@oakjug)Developing and deploying applications with Spring Boot and Docker (@oakjug)
Developing and deploying applications with Spring Boot and Docker (@oakjug)
Chris Richardson
 
Android installation guide
Android installation guideAndroid installation guide
Android installation guide
magicshui
 
Webinar on Google Android SDK
Webinar on Google Android SDKWebinar on Google Android SDK
Webinar on Google Android SDK
Schogini Systems Pvt Ltd
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
Gunjan Kumar
 
Webinar: Building Embedded Applications from QtCreator with Docker
Webinar: Building Embedded Applications from QtCreator with DockerWebinar: Building Embedded Applications from QtCreator with Docker
Webinar: Building Embedded Applications from QtCreator with Docker
Burkhard Stubert
 
Build and run embedded apps faster from qt creator with docker
Build and run embedded apps faster from qt creator with dockerBuild and run embedded apps faster from qt creator with docker
Build and run embedded apps faster from qt creator with docker
Qt
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
Justyna Ilczuk
 
GDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWSGDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWS
Ladislav Prskavec
 

Similar to DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la création de vos applications mobiles Android? (20)

Mobile development in 2020
Mobile development in 2020 Mobile development in 2020
Mobile development in 2020
 
React Native
React NativeReact Native
React Native
 
Improve your Java Environment with Docker
Improve your Java Environment with DockerImprove your Java Environment with Docker
Improve your Java Environment with Docker
 
Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019
 
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
 
Docker Introduction.pdf
Docker Introduction.pdfDocker Introduction.pdf
Docker Introduction.pdf
 
Node Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.jsNode Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.js
 
20170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 201720170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 2017
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
 
Set up a Development Environment in 5 Minutes
Set up a Development Environment in 5 MinutesSet up a Development Environment in 5 Minutes
Set up a Development Environment in 5 Minutes
 
Docker and Your Path to a Better Staging Environment - webinar by Gil Tayar
Docker and Your Path to a Better Staging Environment - webinar by Gil TayarDocker and Your Path to a Better Staging Environment - webinar by Gil Tayar
Docker and Your Path to a Better Staging Environment - webinar by Gil Tayar
 
Continuous Delivery com Docker, OpenShift e Jenkins
Continuous Delivery com Docker, OpenShift e JenkinsContinuous Delivery com Docker, OpenShift e Jenkins
Continuous Delivery com Docker, OpenShift e Jenkins
 
Developing and deploying applications with Spring Boot and Docker (@oakjug)
Developing and deploying applications with Spring Boot and Docker (@oakjug)Developing and deploying applications with Spring Boot and Docker (@oakjug)
Developing and deploying applications with Spring Boot and Docker (@oakjug)
 
Android installation guide
Android installation guideAndroid installation guide
Android installation guide
 
Webinar on Google Android SDK
Webinar on Google Android SDKWebinar on Google Android SDK
Webinar on Google Android SDK
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
Webinar: Building Embedded Applications from QtCreator with Docker
Webinar: Building Embedded Applications from QtCreator with DockerWebinar: Building Embedded Applications from QtCreator with Docker
Webinar: Building Embedded Applications from QtCreator with Docker
 
Build and run embedded apps faster from qt creator with docker
Build and run embedded apps faster from qt creator with dockerBuild and run embedded apps faster from qt creator with docker
Build and run embedded apps faster from qt creator with docker
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
 
GDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWSGDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWS
 

More from Olivier Destrebecq

N'en restons pas au REST, l'heure est au GraphQL
N'en restons pas au REST, l'heure est au GraphQLN'en restons pas au REST, l'heure est au GraphQL
N'en restons pas au REST, l'heure est au GraphQL
Olivier Destrebecq
 
React xp
React xpReact xp
Le RGPD dans le contexte mobile
Le RGPD dans le contexte mobileLe RGPD dans le contexte mobile
Le RGPD dans le contexte mobile
Olivier Destrebecq
 
AWS chez Attestis
AWS chez AttestisAWS chez Attestis
AWS chez Attestis
Olivier Destrebecq
 
DMCA #23: Patrick kedziora - boilingice - art is theft 2018
DMCA #23: Patrick kedziora - boilingice - art is theft 2018DMCA #23: Patrick kedziora - boilingice - art is theft 2018
DMCA #23: Patrick kedziora - boilingice - art is theft 2018
Olivier Destrebecq
 
DMCA#21: reactive-programming
DMCA#21: reactive-programmingDMCA#21: reactive-programming
DMCA#21: reactive-programming
Olivier Destrebecq
 
DMCA #20: Migration Natif vers react natif
DMCA #20: Migration Natif vers react natifDMCA #20: Migration Natif vers react natif
DMCA #20: Migration Natif vers react natif
Olivier Destrebecq
 
DevMobCA #18: beacons
DevMobCA #18: beaconsDevMobCA #18: beacons
DevMobCA #18: beacons
Olivier Destrebecq
 
DevMobCA #18: L'industrialisation des application mobiles
DevMobCA #18: L'industrialisation des application mobilesDevMobCA #18: L'industrialisation des application mobiles
DevMobCA #18: L'industrialisation des application mobiles
Olivier Destrebecq
 
Mobilization 2017: Don't lose your users because of endless quality issues
Mobilization 2017: Don't lose your users because of endless quality issuesMobilization 2017: Don't lose your users because of endless quality issues
Mobilization 2017: Don't lose your users because of endless quality issues
Olivier Destrebecq
 
DevMobCA #16: Comment arrêter de perdre des clients sur votre site ou appli s...
DevMobCA #16: Comment arrêter de perdre des clients sur votre site ou appli s...DevMobCA #16: Comment arrêter de perdre des clients sur votre site ou appli s...
DevMobCA #16: Comment arrêter de perdre des clients sur votre site ou appli s...
Olivier Destrebecq
 
Designing a json/rest api for your mobile app
Designing a json/rest api for your mobile appDesigning a json/rest api for your mobile app
Designing a json/rest api for your mobile app
Olivier Destrebecq
 
DevMobCA: Continuous integration
DevMobCA: Continuous integrationDevMobCA: Continuous integration
DevMobCA: Continuous integration
Olivier Destrebecq
 

More from Olivier Destrebecq (13)

N'en restons pas au REST, l'heure est au GraphQL
N'en restons pas au REST, l'heure est au GraphQLN'en restons pas au REST, l'heure est au GraphQL
N'en restons pas au REST, l'heure est au GraphQL
 
React xp
React xpReact xp
React xp
 
Le RGPD dans le contexte mobile
Le RGPD dans le contexte mobileLe RGPD dans le contexte mobile
Le RGPD dans le contexte mobile
 
AWS chez Attestis
AWS chez AttestisAWS chez Attestis
AWS chez Attestis
 
DMCA #23: Patrick kedziora - boilingice - art is theft 2018
DMCA #23: Patrick kedziora - boilingice - art is theft 2018DMCA #23: Patrick kedziora - boilingice - art is theft 2018
DMCA #23: Patrick kedziora - boilingice - art is theft 2018
 
DMCA#21: reactive-programming
DMCA#21: reactive-programmingDMCA#21: reactive-programming
DMCA#21: reactive-programming
 
DMCA #20: Migration Natif vers react natif
DMCA #20: Migration Natif vers react natifDMCA #20: Migration Natif vers react natif
DMCA #20: Migration Natif vers react natif
 
DevMobCA #18: beacons
DevMobCA #18: beaconsDevMobCA #18: beacons
DevMobCA #18: beacons
 
DevMobCA #18: L'industrialisation des application mobiles
DevMobCA #18: L'industrialisation des application mobilesDevMobCA #18: L'industrialisation des application mobiles
DevMobCA #18: L'industrialisation des application mobiles
 
Mobilization 2017: Don't lose your users because of endless quality issues
Mobilization 2017: Don't lose your users because of endless quality issuesMobilization 2017: Don't lose your users because of endless quality issues
Mobilization 2017: Don't lose your users because of endless quality issues
 
DevMobCA #16: Comment arrêter de perdre des clients sur votre site ou appli s...
DevMobCA #16: Comment arrêter de perdre des clients sur votre site ou appli s...DevMobCA #16: Comment arrêter de perdre des clients sur votre site ou appli s...
DevMobCA #16: Comment arrêter de perdre des clients sur votre site ou appli s...
 
Designing a json/rest api for your mobile app
Designing a json/rest api for your mobile appDesigning a json/rest api for your mobile app
Designing a json/rest api for your mobile app
 
DevMobCA: Continuous integration
DevMobCA: Continuous integrationDevMobCA: Continuous integration
DevMobCA: Continuous integration
 

Recently uploaded

IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
ssuser36d3051
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
mamunhossenbd75
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
nooriasukmaningtyas
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
IJNSA Journal
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
Divyam548318
 

Recently uploaded (20)

IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
 

DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la création de vos applications mobiles Android?

  • 1. QUAND ANDROID RENCONTRE DOCKER OLIVIER TOSELLO - MEETUP MOBILE/DOCKER - JUIN 2018
  • 2. MEETUP DOCKER & ANDROID JUIN 2018 QUI SUIS JE? ▸ 9 ans d’expérience ▸ Dev mobile (iOS, « Android », Rx) ▸ Dev web & back ▸ CTO Attestis ▸ Dev full stack EasyGlobalMarket ▸ CTO Yoobiquity ▸ Architecte logiciel Orange ▸ Développeur web (Limoges)
  • 4. MEETUP DOCKER & ANDROID JUIN 2018 COMMENCER UN PROJET / DÉPLOYER LE CI ▸ Installer Java ▸ Installer Gradle ▸ Installer SDK Android / configurer ANDROID_HOME ▸ Installer Ruby ▸ Installer fastlane ▸ Cloner le projet ▸ Builder ▸ Tester ▸ Déployer ▸ ….
  • 5. MEETUP DOCKER & ANDROID JUIN 2018 ▸ Outils de Continuous Delivery ▸ Open source ▸ Création de Screenshots automatisé ▸ Déploiement simplifié ▸ Gestion des certificats (très utile pour iOS) ▸ Nombreux plugins de la communauté…
  • 7. MEETUP DOCKER & ANDROID JUIN 2018 CRÉATION D’UNE IMAGE DOCKER ANDROID/FASTLANE ▸ Besoins : ▸ Java ▸ SDK tools Android (https://developer.android.com/ studio/#downloads) ▸ Fastlane (et donc ruby)
  • 8. MEETUP DOCKER & ANDROID JUIN 2018 DOCKERFILE FROM openjdk:8 #setup env ENV SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip" ANDROID_HOME="/usr/local/android-sdk" ANDROID_VERSION=26 ANDROID_BUILD_TOOLS_VERSION=26.0.2 RUBY_VERSION=2.2.8 FASTLANE_VERSION=2.93.1 PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools # Install Deps RUN dpkg --add-architecture i386 && apt-get update      && apt-get install -y --force-yes expect wget      libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1 # Download Android SDK RUN mkdir "$ANDROID_HOME" .android && cd "$ANDROID_HOME" && curl -o sdk.zip $SDK_URL && unzip sdk.zip && rm sdk.zip && yes | sdkmanager —licenses # Install SDK licences # too long # Install Android Build Tool and Libraries RUN sdkmanager --update RUN sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" "platforms;android-${ANDROID_VERSION}" « platform-tools"
  • 9. MEETUP DOCKER & ANDROID JUIN 2018 # Install Ruby. RUN apt-get update && apt-get install -y ruby # Install fastlane RUN gem install fastlane -NV -v "$FASTLANE_VERSION" RUN mkdir /application WORKDIR /application #dans votre terminal docker build -t meetup/android-fastlane . docker run -it -p <port>:<port-internal> --name <container-name> —-volume /application:/src/my/local/project meetup/android-fastlane #dans le conteneur docker exec -ti {{idContainer}} gradlew assembleDebug #OR docker exec -ti {{idContainer}} fastlane deploy_release … … BUILD & RUN
  • 10. MEETUP DOCKER & ANDROID JUIN 2018 FASTFILE default_platform :android lane :build_debug do # we clean to perform a fresh install gradle(task: "clean") # build the debug variant gradle( task: "assemble", build_type: "debug" ) end lane :test_debug do gradle(task: "test") End lane :deploy_debug do # upload to GooglePlay internal review upload_to_play_store( package_name: ‘com.meetup.dockerandroid-debug‘, track: 'internal', apk: './app/build/outputs/apk/release/app-debug.apk' ) slack( slack_url: "https://hooks.slack.com/services/meetup" ) end …
  • 12. MEETUP DOCKER & ANDROID JUIN 2018 AUTOMATISATION Commit Build Tests gradle Deploy Internal Development Google play Store Beta Prerelease ReleaseMaster Docker container Credentials
  • 13. MEETUP DOCKER & ANDROID JUIN 2018 PRÉ-REQUIS ▸ Machine Linux avec Docker ▸ Jenkins 2 ▸ Plugins : ▸ Bitbucket / GitHub plugin ▸ Docker pipeline ▸ Un projet Android sous Git
  • 14. MEETUP DOCKER & ANDROID JUIN 2018 PARAMÈTRES JENKINS ▸ Créer un projet « multibranch pipeline »
  • 15. MEETUP DOCKER & ANDROID JUIN 2018 JENKINSFILE pipeline { agent any options { skipStagesAfterUnstable() } // très important stages { stage(‘Inject credentials') { environment { GOOGLE_MAPS_API_KEY = credentials(‘GOOGLE_MAPS_API_KEY’) } steps { echo 'Injecting Google Maps credentials...' sh "sed -i '/<!-- GOOGLE MAPS KEY -—>/c’${env.GOOGLE_MAPS_API_KEY}'' app/src/main/res/values/keys.xml" } }
  • 16. MEETUP DOCKER & ANDROID JUIN 2018 stage('Build') { agent { docker { //ici on déclare que l’agent doit tourné dans une image docker reuseNode true image 'meetup/android-fastlane' } } steps { script { //lancement des lanes if (BRANCH_NAME ==~ /^release/([a-zA-Z0-9-.])*/) { echo 'Building prerelease version with fastlane' sh 'fastlane build_prerelease’ } else if (BRANCH_NAME == 'master') { echo 'Building release version with fastlane' sh 'fastlane build_release' } else { echo 'Building debug version with fastlane' sh 'fastlane build_debug' } } } }
  • 17. MEETUP DOCKER & ANDROID JUIN 2018 stage('tests') { agent { docker { reuseNode true image 'meetup/android-fastlane' } } steps { sh ‘fastlane test_debug’ junit  ‘/app/src/build/test-results/*.xml’ } } stage('Deploy') { agent { docker { reuseNode true image 'meetup/android-fastlane' } } steps { script { if (BRANCH_NAME ==~ /^release/([a-zA-Z0-9-.])*/) { sh 'fastlane deploy_prerelease' archive 'app/build/outputs/apk/prerelease/app-prerelease.apk' } else if (BRANCH_NAME == 'master') { sh 'fastlane deploy_release' archive 'app/build/outputs/apk/release/app-release.apk' } else { sh 'fastlane deploy_debug' archive 'app/build/outputs/apk/debug/app-debug.apk' } } } }
  • 19. MEETUP DOCKER & ANDROID JUIN 2018 ANALYSE DE CODE + UI TESTS + SCREENSHOTS Commit Build Testing Deploy Docker Android Credentials Appium server Fastlane
 Screenshots Docker Android UI Testing Analyse Docker Infer
  • 20. MEETUP DOCKER & ANDROID JUIN 2018 CONCLUSION Approche « Gratuite » Evite les problèmes multi plateforme Gain de temps pour les développeurs Assez complexe à mettre en place Ne pas sous estimé le coût de la maintenance
  • 21. MEETUP DOCKER & ANDROID JUIN 2018 DES ALTERNATIVES SEXY ▸ bitrise.io ==> 36$ / mo ▸ Propose une image Docker Android ( 6GB!)
 https://hub.docker.com/r/bitriseio/ 
 Toutes les versions dispo SDK & build-tools… ▸ Team City/JetBrains Gratuit (très récent à tester)