javascript continues integration in jenkins with angularjs
DESCRIPTION
TRANSCRIPT
![Page 1: Javascript Continues Integration in Jenkins with AngularJS](https://reader033.vdocuments.net/reader033/viewer/2022042613/546b9780af795953298b4c15/html5/thumbnails/1.jpg)
Con$nuous Co? V Javascriptu?
Ladislav Prskavec
![Page 2: Javascript Continues Integration in Jenkins with AngularJS](https://reader033.vdocuments.net/reader033/viewer/2022042613/546b9780af795953298b4c15/html5/thumbnails/2.jpg)
ToDo App
![Page 3: Javascript Continues Integration in Jenkins with AngularJS](https://reader033.vdocuments.net/reader033/viewer/2022042613/546b9780af795953298b4c15/html5/thumbnails/3.jpg)
module = angular.module('todoApp', [])# Controller TodoCtlmodule.controller 'TodoCtrl', ($scope, $http) -> $scope.todos = []; # Proxy to MongoHQ $scope.url = "proxy.php" # Get all todos from mongodb $scope.getAll = -> $http.get($scope.url).success($scope.getCallback) return $scope.getCallback = (data, status, headers, config) -> $scope.todos = data return # Add new todo $scope.addTodo = -> id = new Date().getTime() $scope.data = '{"document" : {"_id": "' + id + '" , ... todo = {text:$scope.todoText, done:false} $scope.todos.push(todo) $http.post($scope.url, $scope.data).success($scope.sucessCall) return
AngularJS
![Page 4: Javascript Continues Integration in Jenkins with AngularJS](https://reader033.vdocuments.net/reader033/viewer/2022042613/546b9780af795953298b4c15/html5/thumbnails/4.jpg)
Mongo DB
![Page 5: Javascript Continues Integration in Jenkins with AngularJS](https://reader033.vdocuments.net/reader033/viewer/2022042613/546b9780af795953298b4c15/html5/thumbnails/5.jpg)
<?phprequire_once __DIR__ .'/config.php';
header('Content-type: application/json');$url = "https://api.mongohq.com/databases/mongo/collections/todo/documents?_apikey=" . MONGOHQ_API_KEY;
$postData = file_get_contents("php://input");if (!empty($postData)) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST ,1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json')); curl_setopt($ch, CURLOPT_POSTFIELDS , $postData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1); curl_setopt($ch, CURLOPT_HEADER , 1); echo curl_exec($ch);} else { echo file_get_contents($url);} Integration MongoHQ
![Page 6: Javascript Continues Integration in Jenkins with AngularJS](https://reader033.vdocuments.net/reader033/viewer/2022042613/546b9780af795953298b4c15/html5/thumbnails/6.jpg)
PhantomJSheadless browser
![Page 7: Javascript Continues Integration in Jenkins with AngularJS](https://reader033.vdocuments.net/reader033/viewer/2022042613/546b9780af795953298b4c15/html5/thumbnails/7.jpg)
Continues Integration
![Page 8: Javascript Continues Integration in Jenkins with AngularJS](https://reader033.vdocuments.net/reader033/viewer/2022042613/546b9780af795953298b4c15/html5/thumbnails/8.jpg)
![Page 9: Javascript Continues Integration in Jenkins with AngularJS](https://reader033.vdocuments.net/reader033/viewer/2022042613/546b9780af795953298b4c15/html5/thumbnails/9.jpg)
Compile, Lint
![Page 10: Javascript Continues Integration in Jenkins with AngularJS](https://reader033.vdocuments.net/reader033/viewer/2022042613/546b9780af795953298b4c15/html5/thumbnails/10.jpg)
![Page 11: Javascript Continues Integration in Jenkins with AngularJS](https://reader033.vdocuments.net/reader033/viewer/2022042613/546b9780af795953298b4c15/html5/thumbnails/11.jpg)
Code Coverage
![Page 12: Javascript Continues Integration in Jenkins with AngularJS](https://reader033.vdocuments.net/reader033/viewer/2022042613/546b9780af795953298b4c15/html5/thumbnails/12.jpg)
Documentation
![Page 13: Javascript Continues Integration in Jenkins with AngularJS](https://reader033.vdocuments.net/reader033/viewer/2022042613/546b9780af795953298b4c15/html5/thumbnails/13.jpg)
JenkinsCI
![Page 14: Javascript Continues Integration in Jenkins with AngularJS](https://reader033.vdocuments.net/reader033/viewer/2022042613/546b9780af795953298b4c15/html5/thumbnails/14.jpg)
JasmineJSCoverageJSDoc
![Page 15: Javascript Continues Integration in Jenkins with AngularJS](https://reader033.vdocuments.net/reader033/viewer/2022042613/546b9780af795953298b4c15/html5/thumbnails/15.jpg)
Ladislav Prskavec
h9p://blog.prskavec.net@abtris
https://github.com/abtris/angular-todo-mongohq
![Page 16: Javascript Continues Integration in Jenkins with AngularJS](https://reader033.vdocuments.net/reader033/viewer/2022042613/546b9780af795953298b4c15/html5/thumbnails/16.jpg)
Flickr credits• 123646856
• 212999782
• 3212942388
• 4090782772
• 4489747597
• 4572739839
• 5462861556
• 5474897335
• 6315847523
• 6711727919