Continuous Integration and Delivery manage development build deploy / release test
About the new CI Tool Chain One of the biggest changes on the next releases of XDK, will be the adoption of the New CI Toolchain, based on Node.js / Gulp / Bower. Though it s gonna be a slow implementation process, it will be available for usage in Professional Service projects from XDK version 2.6 and it will be compatible with XDK 2.2+ projects, through a migration tool provided in the client side build tools. The whole process will be ready for XDK 3.0 release, as it will involve the way on how the XDK team develop and release the package, a process that also could change the development, and release cycles. Key Concepts The main purpose of the new CI, is to provide an easy, faster, and flexible way for developers to implement and use XDK in PS Projects. The new CI is an attempt to improve the current Java/Gradle scripts, making the process faster and more compatible with our Javascript source code. XDK 2.6 XDK 3.0 XDK 3.x Using Node.js instead Java it attempts to provide developers a lower learning curve and encourage the usage of the build tools in projects and also making the process several times faster and easy to implement. It will allows developers the possibility to easily build their own custom build scripts, as the new tools are flexible and they come with more features than the Gradle implementation. the new CI, will discontinue the use of Nexus server for XDK distributions, though, we might still maintain it during the next releases, but at the end we will only use it to support the Android XDK libraries. We have splitted XDK in multiple independent modules based on an NPM strategy using Bower, that can be easily accessed through bitbucket and the inherit git access control through SSH keys, making it much easy to access xdk sources than the Nexus server, that requires VPN access. Gradle New CI Beta release New CI Toolchain Implementation Both Toolchain support Java/Gradle and Nodejs/Gulp Independant module release cycle, through server side migration script to convert XDK source into npm/bower modules Gradle CI Discontinued *Only maintained for Android XDK support. discontinued Nexus Server usage *Only maintained for XDK Android libraries Independant module development* and release cycle adopted in XDK Team internally And we have changed the amd modules paths to make XDK modules more understandable and easy to use, removing unnecessary filesystem paths and adopting names like xdk-base. Also, we have provided tools to use the default build scripts with custom xdk configuration files to release specific builds based on multiple config files. So you can develop you app using all the device abstractions, but you can use this option just to build an optimized version of your app, that only uses the playstation device package.
PS Team CI XDK current CI Toolchain get artifacts from Nexus XDK Dev Team SYSOPS / QA Team manage development build deploy / release test SCRUM Manually get artifacts from Nexus Manual Testing + Artifacts Automated Build / Test Tools used/ get artifacts from Nexus Rhino PhantomJs Qunit JsHint JsDoc...
PS Team CI XDK current CI Toolchain Issues XDK Dev Team SYSOPS / QA Team manage development build deploy / release test Build Tool + Artifacts Slow Learning Curve Reliability Artifact Management Access control and third parties integration Give more flexibility to developers on XDK / modules version management
Repository, BitBucket or Nexus Access Control / bitbucket / ssh keys v/s VPN access without authentication. Allow third party integration v/s NO Git protocol Inherit version control system Automatic changes detections etc... Easy and flexible version management / tags / branches v/s multiple version of artifacts No need to modify current development workflow No extra infrastructure needed
Delivery, Maven Artifacts v/s Node Package Modules NPM has native integration with bitbucket & git, npm install git@bitbucket.org:accedo/accedo-xdk-ui-grid. git#2.4.6 NPM has multi level dependency management. NPM supports SemVer for version management: a 3-component system in the format of x.y.z where: x stands for a major version. y stands for a minor version. z stands for a patch. Artifacts
Build Tool, Node.js v/s Java Gulp and Grunt are Javascript, node.js based, same language as XDK. Node.js Learning curve is shorter for XDK Javascript developers. Java needs extra tools like Rhino to interpret Javascript, node.js will do it natively. Grunt and Gulp are faster than Java / Gradle.
Build Tool, Gulp v/s Grunt Major difference: Grunt is based on configuration / Gulp is code based. Almost No learning curve for Gulp, Based on requirejs. Gulp is significative faster than Grunt http://tech.tmw.co.uk/2014/01/speedtesting-gulpand-grunt/ Gulp is flexible and add some logic in the build process, next release of Gulp will support promises.
?what s Gulp uses a stream file reader, that makes gulp super powerful and fast. It doesn t need to save temporary files in file system to process. Everything is handled in memory. inside? Grunt doesn t use streams; instead, it takes files, runs a single task on them and saves them to new files, repeating the entire process for every task. This results in a lot of hits to the file system, making it slower than Gulp.
PS Team CI XDK current CI Toolchain get artifacts from Nexus XDK Dev Team SYSOPS / QA Team manage development build deploy / release test Manually get artifacts from Nexus Manual Testing + Artifacts Automated Build / Test Tools used/ get artifacts from Nexus Rhino PhantomJs Qunit JsHint JsDoc...
PS Team CI JsHint JsDoc R.js XDK new CI Tools Proposal XDK Dev Team QA / SYSOPS Team manage development build deploy / release test
Package Management Frontend Package Management for node.js and npm Node.js comes with NPM as the default node Package Manager. It works excellent in the server side with node.js, but npm is not a good solution for Frontend Modules. Why? Please read: http: //blog.npmjs.org/post/101775448305/npm-and-front-end-packaging Jspm is a Front End Package Management for npm modules, It extends npm, adding a top layer cli to npm. Other solutions do the same, like Bower and Browserify to achieve this. Bower needs some infrastructure to set up a private registry, but as well as jspm we can define our own custom registry pointing directly to our bitbucket. Browserify is also a candidate, but it s only for commonjs modules, and other solutions available are: http://www.slant.co/topics/1488/compare/~npm-browserify_vs_bower_vs_duo
Package Management Bower Frontend Package Management Uses flat version management to download / NOT version-suffixed modules and folders, only one version of a module at a time. (eg: dep/module). Allow multiple modules format, like AMD, ES6, CommonJS, Bower can be used to include any kind of file formats into your projects, even a rainbow as they say. Using a flat version management, it shares versions between dependencies, upgrading or downgrading dependency resolutions within their supported ranges to minimize forks during install.
Modules Layout xdk core xdk-ax xdk-base Install a module xdk misc modules xdk-history xdk-middleware-hbbtv xdk-mouse xdk ui modules xdk-ui-animatedlabel xdk-ui-asymgrid xdk-ui-basic xdk-ui-grid xdk-ui-input $> bower install modulename#x.y.z xdk apps modules xdk-skeleton xdk-app-projectskeleton xdk-dva xdk-tvchannel xdk-ui-demo xdk-ci-boilerplate xdk apps builds xdk-dva xdk-ui-demo xdk-ci-boilerplate xdk device abstractions xdk-ext-device-amazon xdk-ext-device-android xdk-ext-device-boxee xdk-ext-device-hisense xdk-ext-device-huawei xdk-ext-device-humax xdk-ext-device-lg xdk-ext-device-opera xdk-ext-device-orange xdk-ext-device-panasonic xdk-ext-device-philips xdk-ext-device-playstation xdk-ext-device-ps3 xdk-ext-device-samsung xdk-ext-device-sharp xdk-ext-device-sony xdk-ext-device-tcl xdk-ext-device-tizen xdk-ext-device-toshiba xdk-ext-device-wd xdk-ext-device-webos xdk-ext-device-wiiu http://registry-xdk.appglobe.accedo.tv
XDK new CI Tools elopment server build repository client build XDK Source Gulp is easy to read, easy to learn, and it s fast and flexible. Bitbucket stores modules as NPM modules. Simple client build for user less dependencies less configuration flexible environment Execute the build script from Jenkins. get and update the XDK source, from a specific provided tag version. (latest tag will be used by default) Create, modify and update modules in bitbucket as npm modules. Install the modules Updates the file structure for web project. minify, uglify, concatenate project Scaffolding tools in the future
XDK new CI Server Side Build Script development server build updated Source Pre Build* process Modules update Modules updated production XDK source Run an isolated development environment build process. *Perform unit testing. *Check build integrity. *etc.. *optional replace paths & convert XDK into bower modules update XDK modules & update bower registry http://registry-xdk.appglobe.accedo.tv Build Process www * JsDoc * Apps builds dva, ui-demo, benchmarking builds * Expose release notes * Expose JsDocs * Publish Apps demos * Publish builds http://www-xdk.appglobe.accedo.tv/ http://dva-xdk.appglobe.accedo.tv/
SOURCES: Server Build Script https://bitbucket.org/accedo/xdk-server-build Client Build Script Example https://bitbucket.org/accedo/xdk-ci-boilerplate Modules Repository http://registry-xdk.appglobe.accedo.tv/ https://bitbucket.org/accedo/xdk-{modulename}
Server Side Build https://accedobroadband.jira.com/browse/xdk-2569
Server Side Build
Server Side Build
Client Side Build npm install bower -g # (or sudo) if not installed previously git clone git@bitbucket.org:accedo/xdk-ci-boilerplate.git cd xdk-ci-boilerplate npm install # (or sudo) - installs dev dependencies for build scripts, required by bower post install scripts bower install #Build your app, execute gulp build for instructions gulp build More info at: https://accedobroadband.jira.com/wiki/display/xdkdev/new+ci+toolchain
XDK 2.4.6 Gradle PoC XDK 2.6 Beta XDK 3.0 XDK 4.0 Release Gradle/Nexus Discontinued *Only maintained for XDK Android libraries New CI Beta release Active development Implementation in selected PS Projects. New CI Toolchain Implementation Both Toolchain support Gradle CI Discontinued Independant module release cycle
Resources: https://www.npmjs.com/ https://nodejs.org/ http://gulpjs.com/ http://gruntjs.com/ http://brunch.io/ http://blog.toggl.com/2014/03/grunt-vs-gulp-vs-brunch/ http://blog.npmjs.org/post/101775448305/npm-and-front-end-packaging http://requirejs.org/docs/node.html http://jspm.io https://github.com/jspm/jspm-cli https://www.npmjs.com/package/jspm-git https://github.com/jspm/jspm-cli/wiki/getting-started https://github.com/jspm/registry/wiki/configuring-packages-for-jspm https://github.com/jspm/jspm-cli/wiki/production-workflows