Building a DevOps pipeline for Serverless by using Mocha, GitHub and Travis
-
Upload
exove -
Category
Technology
-
view
99 -
download
3
Transcript of Building a DevOps pipeline for Serverless by using Mocha, GitHub and Travis
Building a DevOps pipeline for Serverless by using
Mocha, GitHub and TravisSami Pippuri
CTOJames Nguyen
Software Developer
Maas Global
MaaS Global is building the future of mobility
System Goals
Goals
• Scalable, cloud-based• Mobile-first customer experience • Utilizing readymade cloud APIs• Infrastructure-as-code• Establish industry standard APIs where they
don’t exist yet• Open for ecosystem partners• Create enthusiasm in the wider ecosystem –
enable e.g. Universities and smaller developer houses around the world
Non-Goals
• Closed architecture or lock-ins (except AWS)
• Exclusive deals• Server infrastructure• Intermediate, all-
encompassing frameworks
• Something for everybody
Loosely coupled Microservice API integrations – flexible inclusion into MaaS framework
Routing
Traffic OperatorTraffic Operator
Traffic OperatorTransport Operator
Weather
Subscription Payment
Identity
Business Rules
Customer Support
Whim backend
APIGW
Whim Apps
Tech Stacks
MaaS Core
Lambda (Node.js 4.x, ES6)
Serverless
AWS Components*
REST
API
s
Apps Backend Integrations
MaaS Schemas MaaS-API SBUS
* APIGW, S3, DynamoDB, RDS (psql), Route53, IoT, Cognito, CloudFront, CloudWatch, SNS, Kinesis, ML, SWF, IAM, ACM…
SWF background processing
SNS
REST
Infrastructure – Serverless, cloud-native
Whim Apps
API Gatewayapi.maas.globalMaaS Core
MaaS TSP
Trip Machine
Identity
Kinesis events
Data Storage
RDS Postgres
What is Serverless?- Is:
- Open source.
- Not really server-less.
- A framework centralized in managing AWS Lambda, API Gateway and CloudFormation.
- Robust, auto-scaling, fast and reliable.
- Extensible in itself with a nice plugin system as well as having big supports from the community
- Is not:
- A server.
- Helping you writing the code.
- Yet possible to be run on-premise
Check out at https://serverless.com/
Project Deployment
Serverless
autoinstall meta
mocha
Webpack
Base toolstack
Travis CI
PROD (Alpha)
Unit & integration
testing
Deploy to stages
(4 of them)
PROD
DEVTEST
ContinuousDeployment (!)
Test harness
Dep sripts
Local test harness
Detailed workflow
Feature development *
Code review **
Open pull request **
Merge onto master **
Release alpha **
Release production **
Feature testing *
Field test ***
Smoke tests ***
DevDeveloper’s fork
TestMaster branch
AlphaAlpha branch
ProdProd branch
Tagging candidates
Documenting releases
Change log
Bug fixes *
*Manual testing ** Automated test with Travis *** Application test
Auto deployment in action!
Some Resources• MaaS Transport Service Provider API: http://www.maas-api.org • Serverless Mocha test plugin: https://github.com/SC5/serverless-mocha-plugin• Meta Sync plugin: https://github.com/serverless/serverless-meta-sync (superceded in sls 1.3)• Webpack plugin (fork) for faster cold starts: https://github.com/laurisvan/serverless-webpack-plugin• Request-promise-lite, smaller version of request-promise to keep Lambda size down:
https://github.com/laurisvan/request-promise-lite
• Serverless v1.x boilerplate https://github.com/SC5/sc5-serverless-v1-boilerplate• Knex / Objection.js for an easy ORM on Nodejs: http://vincit.github.io/objection.js/
SeeWhim Live
whimapp.comSAMI PIPPURI
CTO, MaaS Global [email protected]
+358 50 487 6829
JAMES NGUYENDeveloper, MaaS Global [email protected]