Presentation is loading. Please wait.

Presentation is loading. Please wait.

Continuous Deployment and Testing for Mobile Apps The Cloud Revolution Youve Never Heard Of Mark

Similar presentations


Presentation on theme: "Continuous Deployment and Testing for Mobile Apps The Cloud Revolution Youve Never Heard Of Mark"— Presentation transcript:

1 Continuous Deployment and Testing for Mobile Apps The Cloud Revolution Youve Never Heard Of Mark

2 2 Mark Prichard – My Back Pages ©2011 CloudBees, Inc. All Rights Reserved Cambridge University Computer Lab, Logica/SHL/CSC: –Integration/Middleware Specialist –Managing Consultant BEA Systems, –Senior Architect, EMEA –Director, Java Virtualization Oracle, –WebLogic Platform PM –FMW Web Tier PM CloudBees, 2012 –Senior Director of Product blogs.cloudbees.com Clouds, Bees and Blogs

3 3 Quick Introduction to CloudBees and PaaS Building Apps in the Cloud Continuous Integration for iOS and Android Gesture-aware touch testing Multi-configuration mobile testing Beta test distribution Mobile + PaaS models AWS and the Token Vending Machine Todays Agenda

4 4 Free and complete for developers Get started with just a couple of clicks: all you need is a browser Step 1 - Sign Up with CloudBees

5 5 Whats a Platform? Something you can use to –Run your apps –Build your apps –Add services to your apps –Manage your apps Plaform-as-a-Service (PaaS) uses elastic, on-demand Cloud resources to do this

6 6 CloudBees Is a Platform Delivered As A Service cloudbees.com Jenkins Master Jenkins Master Test Stage Build Code Jenkins Executor Jenkins Executor Forge Repositories Git SVN mvn Development Services Developer and Operations Interaction Developer and Operations Interaction End User Interaction Runtime Services CloudBees API Grand Central Web Console Grand Central Web Console SDK Session Clustering MySQL Router Application Partner Ecosystem 6 ©CloudBees, Inc. All Rights Reserved

7 7 Cloud Terminology Infrastructure-as-a-Service (IaaS) –Think: Amazon Web Services –What: Server Instances, Storage Buckets etc Software-as-a-Service (SaaS) –Think: Salesforce.com –What: Packaged Applications (in the Cloud) Plaform-as-a-Service (PaaS) –What: Managed Service for Custom Apps

8 8 What is Platform-as-a-Service? We run your applications for you We provide and manage all the supporting infrastructure needed to run your apps We monitor and can scale out your apps We provide a full, enterprise-class build environment using Jenkins CI – the worlds #1 OSS continuous integration server You write the code and we do all the rest

9 9 Have You Met Jenkins? #1 OSS CI server Easy to install/use Extensible via 600+ plugins Very widely adopted –47K+ installations Very active community –Over 7 years of history, 440+ releases –600+ plugins, 300+ developers CloudBees adds plugins for cloud builds

10 10 CloudBees Step-by-Step cloudbees.com Jenkins Master Jenkins Master Test Stage Build Code Jenkins Executor Jenkins Executor Forge Repositories Git SVN mvn Development Services Developer and Operations Interaction Developer and Operations Interaction End User Interaction Runtime Services CloudBees API Grand Central Web Console Grand Central Web Console SDK Session Clustering MySQL Router Application Partner Ecosystem Multi- Tenanted Dedicated Amazon Web Services 10 ©CloudBees, Inc. All Rights Reserved

11 11 What Platform-as-a-Service Is Not Commercial, packaged applications dont usually run on a PaaS You dont need to purchase any hardware or software licenses You wont have to install anything – you just deploy your Java apps to the platform If you need to run applications in your own data center, PaaS may be the wrong model

12 12 Getting Started: CloudBees ClickStarts ©2012 CloudBees, Inc. All Rights Reserved The easiest way to get started – and learn new technologies

13 13 cloudbees.com Whats up with this new framework! What Did I Just Do? 13 CloudBees Git Repo Database Build/Test db:create App Partner Service CloudBees API Grand Central Web Consol e Grand Central Web Consol e app:create git clone Jenkins job create Bind Trigger Deploy Wow! At your service ©2013 CloudBees, Inc. All rights reserved

14 14 cloudbees.com Develop Locally, Build in the Cloud CloudBees Git Repo Database Build/Test App Partner Service Bind Trigger Deploy I want to make some changes! Local Git Repo git clone git commit git push Changes Wow! At your service

15 First Demo Complete Application with its full lifecycle, in a click ClickStart No resource other than a laptop, everything else is in the cloud No need to deal with IT either! You can create your own ClickStart-s if you want Templates, etc. Pay as you go (to production), scale as you need, full HA, etc. Not just a development workbench!

16 Second Demo: All Mobile! Complete Chess application for iOS & Android Covered: Where to store app, how to build, how to test, how to distribute, etc. NOT Covered: iOS/Android app coding itself WARNING: testing is especially important for mobile applications – most users wont give it a second chances!

17 #fail Typical flow/pipeline Code Build App Code BuildTest Deploy Test Beta Deplo y GA Deplo y Get started fast! Team Work Automatically push new code to test Get started fast! Team Work Automatically push new code to test #fail Build on several targets: iOS, Android, etc. If it fails, stop Build on several targets: iOS, Android, etc. If it fails, stop Test is costly! Easy-first, then increase! Basic test Multi-device Gesture Etc. If it fails, stop Test is costly! Easy-first, then increase! Basic test Multi-device Gesture Etc. If it fails, stop Deploy in the field on real users Gather input Retrieve dumps Etc. If it fails, stop Deploy in the field on real users Gather input Retrieve dumps Etc. If it fails, stop D-Day! Push apps to real-life users! If it fails, stop D-Day! Push apps to real-life users! If it fails, stop

18 Step 1 - CODE Typically using a mobile-specific environment/IDE Store code on Github or at CloudBees (SVN/Git) As soon as a code change occurs, validates! notification sent to Jenkins, initiate pipeline Idea! Use a ClickStart to templatify a typical mobile project License headers, splash screen, login, back-end REST API, etc.

19 Step 1 - CODE You can look at a mobile ClickStart: Android: https://github.com/mqprichard/stockfishchess- android https://github.com/mqprichard/stockfishchess- android iOS: https://github.com/mqprichard/stockfishchess-ios- app https://github.com/mqprichard/stockfishchess-ios- app

20 Step 2 - BUILD Android Easy! Android_[SDK | NDK] available in the cloud, build on linux machine on iOS Requires Mac OS X guest to build Not available (yet) at CloudBees Impossible?

21 Step 2 – iOS BUILD Mac Build Attach your own Mac Jenkin s Master Jenkins Slave ud Jenkins Slave ud Jenkins Slave ud Jenkins Slave PRIVATE

22 Preparing a mobile build slave Install Android SDK and NDK, install git (if using it), wget, etc. Modify ~/.bash_profile Create ANDROID_SDK and ANDROID_NDK add A_S/tools and A_S/platform_tools to path Install Xcode Launch to accept license Go in preferences, install command line tools and emulator(s) Type android on command line Add SDK versions + System images (ARM EABI, etc.)

23 Step 2 – iOS BUILD Install Jenkins Java CLI agent on Mac Launch: enjoy java -jar jenkins-cli.jar -s https://partnerdemo.ci.cloudbees.com -i ~/.ssh/id_rsa customer-managed-slave -fsroot ~/tests/jenkins/ROOT/ -labels android -labels xcode -executors 4 -name mobile-slave-sacha-laptop

24 Step 2 - BUILD Good Reads Continuous Deployment for Mobile Apps with Jenkins: iOS Builds deployment-for-mobile-apps.html deployment-for-mobile-apps.html Continuous Integration for Mobile Apps with Jenkins: Android Builds integration-for-mobile-apps.html integration-for-mobile-apps.html

25 Step 2 - BUILD Next: Details of an iOS build Replay: Details of an Android Build Replay:

26 Step 3 - TEST Lots of different testing is possible Launching an emulator is level-0 of testing SOASTA TouchTest: integration-for-mobile-apps.html integration-for-mobile-apps.html

27 SOASTA Wrapper TouchTest - Setup App SOASTA SaaS register iOS register

28 TouchTest - Record SOAST A Wrappe r App SOASTA SaaS deploy iOS Record gestures

29 TouchTest – Replay/test SOASTA SaaS iOS Upload App & Replay Scripted gestures Record Result Send back Result CloudBees Jenkins Initiate Tests

30 Build Matrix Testing mobile application requires testing on lots of different devices, form factors, etc. Create one build job per form factor/generation? No! Jenkins Build Matrix!

31 Jenkins Build Matrix

32 Build Matrix – Problem! Build matrix are very powerful! But testing can become costly! Fail-Fast Organize your testing as a pipeline Cheap first, fail-fast Expensive as late as possible

33 Jenkins Promoted Builds Build on several targets: iOS, Android, multiple versions, etc. If it fails stop If it succeeds, PROMOTE BUILD Build on several targets: iOS, Android, multiple versions, etc. If it fails stop If it succeeds, PROMOTE BUILD #fail Basic Tests Matrix Tests QA Approval Releas e Mgt #fail Git notif Perform basic testing Mono device Cheap testing Perform basic testing Mono device Cheap testing Deploy application onto Beta Testers devices Zubhium, TestFlight, Appaloosa Deploy application onto Beta Testers devices Zubhium, TestFlight, Appaloosa QA receives notification of promoted build Perform QA validation Code coverage, etc. If not OK stop If OK, MANUALLY APPROVE QA receives notification of promoted build Perform QA validation Code coverage, etc. If not OK stop If OK, MANUALLY APPROVE Real users testing Crash dumps User reports Kill switch Etc. Real users testing Crash dumps User reports Kill switch Etc. Zubhium Android Emulators

34 CuckooChess Earlier, simpler version of DroidFish – no NDK, so builds are quicker Code and Instructions Well show you how to: Include the Zubhium SDK Automate push to Zubhium Support crash reporting/feedback Add a deliberate bug! Quick Demo: Beta Testing with Zubhium © 2013 CloudBees, Inc. All Rights Reserved

35 import com.zubhium.ZubhiumSDK; public class CuckooChess extends Activity implements GUIInterface { private ZubhiumSDK zubhiumSDK = null; private final String zubhiumAppKey = public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); zubhiumSDK = ZubhiumSDK.getZubhiumSDKInstance(this, zubhiumAppKey); AND Adding Zubhium SDK is easy © 2013 CloudBees, Inc. All Rights Reserved

36 The Build Pipeline ©2012 CloudBees, Inc. All Rights Reserved

37 Push to Zubhium ©2012 CloudBees, Inc. All Rights Reserved

38 iOS Beta Testing – TestFlight and Appaloosa

39 Mobile + Server? Makes PaaS value even more obvious Use existing Java assets on the back-end Communicate through HTTP/etc. iOS CloudBees PaaS Java App DB On- Premise Java App DB HTTPSSSL/VPN/HTTPS/etc.

40 Private Datacenter App on PaaS To the Internet VPC App on PaaS To the Internet Legacy On-premises resources Data Copy ?

41 Private Datacenter App on PaaS To the Internet VPC App on PaaS To the Internet Legacy On-premises resources Data Copy 1 2 3

42 AWS! Amazon Web Services (AWS) provides plenty of high-quality services Can they be used by mobile phones applications? RDSDynamoDBSimpleDBElastiCache IAMData PipelineFlexible PaymentS3 GlacierSimple WorkflowSimple QueueSimple Notification Simple Etc.

43 AWS – Not easy Not advised to let Mobile app directly access AWS AWS account key would need to be embedded and distributed to all users (!) Users stepping on each others, ouch! Solution?

44 Token Vending Machine Mobile app registers on a server app and… Anonymous OR Identity-based TVM available Requests a token to the server app Limited in SCOPE (S3, Notification, , etc.) Limited in TIME Mobile app uses token to use AWS in a constrained fashion Easy!

45 Token Vending Machine CloudBees PaaS TVM App AWS S3 1. Request Token AWS IAM 1.1 Request Token Using private AWS Key 2. Uses AWS Service using Token

46 Want your own TVM? Easy! Try our TVM ClickStart Just put your AWS Key in the TVM and get going! clickstarts-and.html

47 Conclusion Next.gen software development is all about TIME- TO-MARKET and FAST ITERATION Mobile applications make it even harder! No second chance, wide range of devices You cannot win by building your own FACTORY Use a PaaS – Focus on added-value Try it now! Onward!


Download ppt "Continuous Deployment and Testing for Mobile Apps The Cloud Revolution Youve Never Heard Of Mark"

Similar presentations


Ads by Google