Successfully reported this slideshow.
Your SlideShare is downloading. ×

Javascript Continues Integration in Jenkins with AngularJS

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Upcoming SlideShare
Asynchronous I/O in PHP
Asynchronous I/O in PHP
Loading in …3
×

Check these out next

1 of 16 Ad

More Related Content

Slideshows for you (20)

Similar to Javascript Continues Integration in Jenkins with AngularJS (20)

Advertisement

More from Ladislav Prskavec (20)

Recently uploaded (20)

Advertisement

Javascript Continues Integration in Jenkins with AngularJS

  1. 1. Con$nuous  Co?   V  Javascriptu? Ladislav  Prskavec
  2. 2. ToDo App
  3. 3. module = angular.module('todoApp', []) # Controller TodoCtl module.controller 'TodoCtrl', ($scope, $http) -> $scope.todos = []; # Proxy to MongoHQ $scope.url = "proxy.php" # Get all todos from mongodb AngularJS $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
  4. 4. Mongo DB
  5. 5. <?php require_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
  6. 6. PhantomJS headless browser
  7. 7. Continues Integration
  8. 8. Compile, Lint
  9. 9. Code Coverage
  10. 10. Documentation
  11. 11. JenkinsCI
  12. 12. Jasmine JSCoverage JSDoc
  13. 13. Ladislav  Prskavec h9p://blog.prskavec.net @abtris https://github.com/abtris/angular-todo-mongohq
  14. 14. Flickr credits • 123646856 • 5462861556 • 212999782 • 5474897335 • 3212942388 • 6315847523 • 4090782772 • 6711727919 • 4489747597 • 4572739839

×