Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx
Transcript of Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx
![Page 1: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/1.jpg)
Dev Stack – Building Connected Salesforce Apps using Portable Local Repos
Tanner EllenLead Developer
@tannerellenDayBack.com
![Page 2: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/2.jpg)
Background● Front-end developer at dayback.com● Canvas app using Angular JS● https://github.com/seedcode/canvas-starter-kit
○ Jason Young will be speaking about this at Dreamforce
![Page 3: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/3.jpg)
![Page 4: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/4.jpg)
The Original Setup● Stand alone web server with SSL certificate
○ Limited code sharing○ Creates versioning headaches○ Hard to test code changes as you develop○ Who maintains the servers?○ Matching production and SSL isn’t easy
![Page 5: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/5.jpg)
The Challenge● Wanted a way to develop locally
○ Test changes quickly○ In multiple branches○ Share between developers○ Easily move to different computers○ Allow developers to use preferred editors
![Page 6: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/6.jpg)
The Solution● Vagrant is key● Beauty is in the details, and there are a lot of
them● https://github.com/seedcode/vagrant-base-config
![Page 7: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/7.jpg)
Demo Time● “Vagrant Up”● Changes to code show up immediately● Test locally with custom host name● Test in Salesforce with custom domain name● ngrok when port forwarding isn’t practical
![Page 8: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/8.jpg)
Getting Started● Copy Vagrant-Base-Config contents to project
folder● Modify config in Vagrantfile
○ Change ports, IP address, hostname, and name
○ Collisions will auto-correct but I like to define them
● In Terminal navigate to the vagrant folder○ vagrant up
![Page 9: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/9.jpg)
What can we do at this point?● Code and test locally with custom host name● Build and deploy with grunt or gulp● Unit testing or other software dev processes● Config is in source control, consistency for all
devs
![Page 10: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/10.jpg)
What about Salesforce?● Salesforce needs access from over the WAN
○ Use a FQDN (Fully qualified domain name)○ I like CloudFlare for managing DNS
● Port forwarding is easy to set up and free○ Need router access○ Dynamic IP’s can make this difficult to use
![Page 11: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/11.jpg)
ngrok To The Rescue!● Creates a secure tunnel to your computer
○ Don’t need router access like port forwarding○ Map to custom domain with paid plan○ Can use anywhere, even tethered with phone○ Other useful features, captured requests,
replay● Let’s create an http tunnel
![Page 12: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/12.jpg)
Salesforce Craves HTTPS!● Production canvas apps require HTTPS● OAuth won’t work over HTTP● Your browser will nag you if not HTTPS● Salesforce Docs tell us to use HTTPS
![Page 13: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/13.jpg)
OK, Let’s Do It With Let’s Encrypt!● vagrant ssh
○ cd /vagrant○ npm install (if not done already)○ grunt ssl:<email>:<domain>
● Now let’s open an https tunnel with ngrok
![Page 14: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/14.jpg)
A Bit About Let’s Encrypt● Certificates are valid for 90 days● Renewals can be automated with a CRON job● Limits 20 certificate requests per domain per
week● 100% free● Can also be used in production
![Page 15: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/15.jpg)
What Can We Do Now?● All the things!
○ Salesforce can access your computer over HTTPS
○ Allows you to code locally and test in a dev org○ Code never leaves version control○ Development team has consistency○ Dev matches production○ Code from anywhere in the world
![Page 16: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/16.jpg)
Helpful Links● VirtualBox: https://www.virtualbox.org● Vagrant: https://www.vagrantup.com● Vagrant Plugins: http://bit.ly/1lIDarz● CloudFlare: https://www.cloudflare.com● ngrok: https://ngrok.com/● PageKite (ngrok alternative):
https://pagekite.net/ ● Let’s Encrypt: https://letsencrypt.org
![Page 17: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/17.jpg)
Q&A
![Page 18: Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx](https://reader035.fdocuments.in/reader035/viewer/2022070516/586fa2471a28abcc238b6e49/html5/thumbnails/18.jpg)
Thank you!