West Coast DevCon 2014: Build Automation - Epic’s Build Tools & Infrastructure
Build System Automation for Enterprise JavaScript Applications
Transcript of Build System Automation for Enterprise JavaScript Applications
![Page 1: Build System Automation for Enterprise JavaScript Applications](https://reader038.fdocuments.us/reader038/viewer/2022110109/58668f101a28ab45408b799b/html5/thumbnails/1.jpg)
Build System Automationfor Enterprise JavaScript Applications
George BochenekRandy Jones
![Page 2: Build System Automation for Enterprise JavaScript Applications](https://reader038.fdocuments.us/reader038/viewer/2022110109/58668f101a28ab45408b799b/html5/thumbnails/2.jpg)
Why Build?Building your application will increase performance
A Lot.
0
50
100
150
200
250
300
350
Before Build After Build
# of Requests Time to Load (10s of Milliseconds)
![Page 3: Build System Automation for Enterprise JavaScript Applications](https://reader038.fdocuments.us/reader038/viewer/2022110109/58668f101a28ab45408b799b/html5/thumbnails/3.jpg)
Set-up your project for success
Project Organization
http://www.ethnoshirts.com/images/1312%20-%20I%20Love%20Spaghetti.png#I%20love%20spaghetti
![Page 4: Build System Automation for Enterprise JavaScript Applications](https://reader038.fdocuments.us/reader038/viewer/2022110109/58668f101a28ab45408b799b/html5/thumbnails/4.jpg)
Look Inside A Project Folder
Project Specific folders e.g. src for a Java Web Projectssrc
web
js
myApp
share
index
Folder for the web contents
Folder for all code packages and resources
Project specific modules and widgets
Modules and widgets shared between projects
Main app page – uses hosted ArcGIS API for JavaScriptand dojo loader AMD API to load our modules
![Page 5: Build System Automation for Enterprise JavaScript Applications](https://reader038.fdocuments.us/reader038/viewer/2022110109/58668f101a28ab45408b799b/html5/thumbnails/5.jpg)
Project Build Resources
Project Specific folders e.g. src for a Java Web Projectssrc
web Folder for the web contents
Build Resourcesbuild
Libraries to support buildlib
Profile.js
Dojo Build Profile
build.xml
Ant Build File that perform quality checks and dojo
![Page 6: Build System Automation for Enterprise JavaScript Applications](https://reader038.fdocuments.us/reader038/viewer/2022110109/58668f101a28ab45408b799b/html5/thumbnails/6.jpg)
Using the dojo build process to optimize and streamline user experiences
Moving to Production
![Page 7: Build System Automation for Enterprise JavaScript Applications](https://reader038.fdocuments.us/reader038/viewer/2022110109/58668f101a28ab45408b799b/html5/thumbnails/7.jpg)
Build Automation Parts
• API Cache- Download and point to cached versions of dojo libraries and ESRI JavaScript API- https://github.com/Esri/enterprise-build-sample-js
• Site Manager- Ensure all dependencies are stored in the define statement- Build will work through each dependency recursively
• Build Profile- Locates all custom and library based source code- Best practice to copy libraries before build- Layers Object
- Stores localization and path to custom layer file- customBase: tells Dojo not to include all default classes- Boot: tells the build to include an AMD loader in your layer file (no need for other files)
![Page 8: Build System Automation for Enterprise JavaScript Applications](https://reader038.fdocuments.us/reader038/viewer/2022110109/58668f101a28ab45408b799b/html5/thumbnails/8.jpg)
Build ANT File
• Set Properties- Cache Location- Folder and Application Names- Files to save after building
• Run Build- Exec task points to the build profile
• Delete Extra Bloat- Finally, the ANT script deletes everything not specifically mentioned- This keeps the build lean for deployment
![Page 9: Build System Automation for Enterprise JavaScript Applications](https://reader038.fdocuments.us/reader038/viewer/2022110109/58668f101a28ab45408b799b/html5/thumbnails/9.jpg)
ContinuousIntegration
![Page 10: Build System Automation for Enterprise JavaScript Applications](https://reader038.fdocuments.us/reader038/viewer/2022110109/58668f101a28ab45408b799b/html5/thumbnails/10.jpg)
Continuous Integration
• What is it?- Verify that everything works together frequently (as often as every commit)
• Other Benefits- Very that things work in production type builds- Verify code quality- Deploy to test servers automatically
• Software Options- Jenkins/Hudson- Bamboo- Team Foundation Server- Many Others…
![Page 11: Build System Automation for Enterprise JavaScript Applications](https://reader038.fdocuments.us/reader038/viewer/2022110109/58668f101a28ab45408b799b/html5/thumbnails/11.jpg)
What can we do with CI Software?
• Run scripts/builds – ant, maven, shell• Verify code quality with JSLint, FindBugs, etc• Run unit tests• Deploy builds to application servers• Run checks on every commit• Run daily production test builds
![Page 12: Build System Automation for Enterprise JavaScript Applications](https://reader038.fdocuments.us/reader038/viewer/2022110109/58668f101a28ab45408b799b/html5/thumbnails/12.jpg)
Rate This Sessionwww.esri.com/RateMyDevSummitSession
Get The Codewww.github.com/Esri/enterprise-build-sample-js
Other SessionsFriday 10 am - JavaScript Applications for the Enterprise: From Empty Folders to Managed Deployments