SlideShare a Scribd company logo
Elixir Deployment Tools
A A R O N R E N N E R
@ b a y f i e l d c o d e r
Use heroku?
HOW DO I RUN IN PRODUCTION?
Just run: MIX_ENV=prod mix phx.server
https://oscar.ofm.co.za/img/fr_201691716455.jpg
What’s in the Elixir ecosystem? OTP Releases?
DISTILLERY
• Compiles and packages your
application with the erlang vm so it
can be deployed to clean machine
https://openclipart.org/detail/26101/cardboard-box-package
SETTING UP
• Install in mix.exs
• mix deps.get
• mix release.init
• Follow Use Distillery with Phoenix Guide
MIX_ENV=prod mix release
• Creates a folder in _build/prod/rel/my_app
my_app master % ls
bin erts-9.0 lib releases var
./bin/<app_name>
Usage: my_app <task>
Service Control
=======================
start # start my_app as a daemon
start_boot <file> # start my_app as a daemon, but supply a
custom .boot file
foreground # start my_app in the foreground
console # start my_app with a console attached
console_clean # start a console with code paths set but
no apps loaded/started
...
./bin/<app_name>
Usage: my_app <task>
start # start my_app as a daemon
stop # stop the my_app daemon
remote_console # remote shell to my_app's console
ping # checks if my_app is running
upgrade <version> # upgrade my_app to <version>
HOW DO WE SHIP IT?
my_app master % ls
bin erts-9.0 lib releases var
EDELIVER
• Builds your application on a remote
build server and then deploys it to
staging/production servers
http://clipartix.com/wp-content/uploads/2016/04/Airplane-clipart-no-background-free-clipart-images.jpg
.deliver/config
#!/usr/bin/env bash
APP=”my_app”
BUILD_HOST="build-system.acme.org”
BUILD_USER="build
BUILD_AT="/tmp/my_app/builds
DELIVER_TO="/srv/my_app"
STAGING_HOSTS=”staging1.acme.org staging2.acme.org”
STAGING_USER=”staging”
PRODUCTION_HOSTS=”app1.acme.org app2.acme.org"
PRODUCTION_USER="production"
BUILD AND DEPLOY
• mix edeliver build release
• mix edeliver deploy release to [staging | production]
• mix edeliver start [staging | production]
• mix edeliver ping [staging | production]
ONE BUILD TO MULTIPLE ENVIRONMENTS
v0.0.1
http://i.istockimg.com/file_thumbview_approve/17278421/3/stock-illustration-17278421-glowing-green-box.jpg
staging1 prod3prod2prod1
WHERE CONFIG IS COMPILED
config/config.exs releases/<vsn>/sys.config
MANAGING CONFIG
releases/<version>/sys.config
[{sasl,[{errlog_type,error}]},
{logger,
[{console,
[{format,<<"$time $metadata[$level] $messagen">>},
{metadata,[request_id]}]},
{level,info}]},
{distillery_example,
[{'Elixir.DistilleryExampleWeb.Endpoint',
[{render_errors,
[{view,'Elixir.DistilleryExampleWeb.ErrorView'},
{accepts,[<<"html">>,<<"json">>]}]},
{pubsub,
[{name,'Elixir.DistilleryExample.PubSub'},
{adapter,'Elixir.Phoenix.PubSub.PG2'}]},
{load_from_system_env,true},
{url,[{host,<<"example.com">>},{port,{system,<<"PORT">>}}]},
{cache_static_manifest,<<"priv/static/cache_manifest.json">>},
{server,true},
{root,<<".">>},
{version,"0.0.1"},
{secret_key_base,
<<"qhKyagfd2eswVGdgQMIZzfbO4Hi6Vr8J0Y3GR67SHvG7EPNODK6z+d0haLkx7HYy">>}]}]}].
MANAGING CONFIG
releases/<version>/sys.config
[{sasl,[{errlog_type,error}]},
{logger,
[{console,
[{format,<<"$time $metadata[$level] $messagen">>},
{metadata,[request_id]}]},
{level,info}]},
{distillery_example,
[{'Elixir.DistilleryExampleWeb.Endpoint',
[{render_errors,
[{view,'Elixir.DistilleryExampleWeb.ErrorView'},
{accepts,[<<"html">>,<<"json">>]}]},
{pubsub,
[{name,'Elixir.DistilleryExample.PubSub'},
{adapter,'Elixir.Phoenix.PubSub.PG2'}]},
{load_from_system_env,true},
{url,[{host, <<"example.com">> },{port,{system,<<"PORT">>}}]},
{cache_static_manifest,<<"priv/static/cache_manifest.json">>},
{server,true},
{root,<<".">>},
{version,"0.0.1"},
{secret_key_base,
<<"qhKyagfd2eswVGdgQMIZzfbO4Hi6Vr8J0Y3GR67SHvG7EPNODK6z+d0haLkx7HYy">> }]}]}].
CONFORM
• Injects settings into the sys.config
when your application is starting up
http://www.clker.com/cliparts/W/F/s/r/d/6/gear-md.png
<deploy_dir>/<app_name>.conf
# Secret key base for sessions. Needs to be the same across app servers
my_app.secret_key_base = “super secret”
# Hostname to use when generating urls
my_app.url.host = “acme.com”
# More custom settings
# …
CONFORM
releases/<version>/sys.config
<app_name>.conf
var/sys.config
+
=
CONFORM INJECTS SETTINGS
var/sys.config
[{sasl,[{errlog_type,error}]},
{logger,
[{console,
[{format,<<"$time $metadata[$level] $messagen">>},
{metadata,[request_id]}]},
{level,info}]},
{distillery_example,
[{'Elixir.DistilleryExampleWeb.Endpoint',
[{render_errors,
[{view,'Elixir.DistilleryExampleWeb.ErrorView'},
• {accepts,[<<"html">>,<<"json">>]}]},
{pubsub,
[{name,'Elixir.DistilleryExample.PubSub'},
{adapter,'Elixir.Phoenix.PubSub.PG2'}]},
{load_from_system_env,true},
{url,[{host, <<”acme.com">> },{port,{system,<<"PORT">>}}]},
{cache_static_manifest,<<"priv/static/cache_manifest.json">>},
{server,true},
{root,<<".">>},
{version,"0.0.1"},
{secret_key_base,
<<”super secret">> }]}]}].
THINGS TO KEEP IN MIND
@api_key Application.get_env(:my_app, :api_key)
DON’T: compile settings into module attributes
DO: Create functions for easier access
def api_key do
Application.get_env(:my_app, :api_key)
end
TOOL CHAIN
BITWALKER/CONFORM
http://www.clker.com/cliparts/W/F/s/r/d/6/gear-md.png
Inject settings into
sys.config
EDELIVER/EDELIVER
Remote Builds and
Deployment
BITWALKER/DISTILLERY
Package
Application
THANK YOU!
WE’RE HIRING
A A R O N R E N N E R
@ b a y f i e l d c o d e r

More Related Content

What's hot (20)

PDF
iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...
Badoo
 
PDF
Automating Hybrid Applications with Appium
Sauce Labs
 
PDF
Automated-Testing-inside-containers
Manoj Kumar Kumar
 
PDF
Appium mobile web+dev conference
Isaac Murchie
 
PPTX
React native development with expo
SangSun Park
 
PDF
Improving Android app testing with Appium and Sauce Labs
Isaac Murchie
 
PDF
Cordova Tutorial
Jacky Chen
 
PDF
Testing on Mobile Devices with Location Services
Sauce Labs
 
PDF
React Native Expo
Ryosuke Hara
 
PDF
Selenium, Appium, and Robots!
hugs
 
PDF
Ionic2
Jiayun Zhou
 
PDF
Xcode Server & Xcode 7 Bots
Steven Forbes
 
PPTX
ADF 2.4.0 And Beyond
Eugenio Romano
 
PPTX
PhoneGap Day 2016 EU: Creating the Ideal Cordova Dev Environment
Ryan J. Salva
 
PPTX
Play with Alfresco ADF 2.0.0 Angular
Eugenio Romano
 
PPT
State ofappdevelopment
gillygize
 
PDF
Device software image verification
Sagar Gor
 
PDF
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
D
 
PDF
Installing iOS and Android Simulators on MacOSX
Ken Skistimas
 
PDF
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
D
 
iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...
Badoo
 
Automating Hybrid Applications with Appium
Sauce Labs
 
Automated-Testing-inside-containers
Manoj Kumar Kumar
 
Appium mobile web+dev conference
Isaac Murchie
 
React native development with expo
SangSun Park
 
Improving Android app testing with Appium and Sauce Labs
Isaac Murchie
 
Cordova Tutorial
Jacky Chen
 
Testing on Mobile Devices with Location Services
Sauce Labs
 
React Native Expo
Ryosuke Hara
 
Selenium, Appium, and Robots!
hugs
 
Ionic2
Jiayun Zhou
 
Xcode Server & Xcode 7 Bots
Steven Forbes
 
ADF 2.4.0 And Beyond
Eugenio Romano
 
PhoneGap Day 2016 EU: Creating the Ideal Cordova Dev Environment
Ryan J. Salva
 
Play with Alfresco ADF 2.0.0 Angular
Eugenio Romano
 
State ofappdevelopment
gillygize
 
Device software image verification
Sagar Gor
 
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
D
 
Installing iOS and Android Simulators on MacOSX
Ken Skistimas
 
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
D
 

Similar to Elixir Deployment Tools (20)

PDF
Hot deployments with distillery
Jeffrey Chan
 
PDF
How to automate elixir phoenix deployment with distillery and edeliver on ubu...
VasiliyPodnebesniy
 
PDF
Real World Elixir Deployment
Pete Gamache
 
PDF
Creating your Non-Stop Elixir Application
Manuel Rubio
 
PDF
Yaroslav Martsynyuk - Deploying Elixir/Phoenix with Distillery
Elixir Club
 
PDF
Deploying Elixir/Phoenix with Distillery - Yaroslav Martsynuyk
Elixir Club
 
PDF
Maksym Pugach - Elixir Release and Deploy Utilities
Elixir Club
 
PDF
Lab Zero Lunchdown: Deploying Elixir and Phoenix Applications
brien_wankel
 
PDF
Releasing Elixir/Phoenix Applications
Wise Engineering
 
PPTX
Phoenix 1.3 Umbrella App deployment via Distillery-Docker-Docker_Compose
Yeong Sheng Tan
 
PPTX
Docker & Elixir @kloeckner.i
Florian Kraft
 
PDF
Building Elixir App Release with Distillery and Docker
Mickey Chen
 
PPTX
Zachary Kessin - Deploying and Upgrading with Zero Downtime in Elixir - Codem...
Codemotion
 
PPTX
Elixir/Phoenix releases and research about common deployment strategies.
Michael Dimmitt
 
PPTX
Cloud native buildpacks_collabnix
Suman Chakraborty
 
PDF
Docker in Action
Alper Kanat
 
PPTX
From Dev To Prod: How theScore deploys Elixir applications
Joseph An
 
PPTX
Elixir in the Wild
Benjamin Cates
 
PPTX
Py Con 2017
Arnold Okoth
 
PDF
Messaging with the Docker
Henryk Konsek
 
Hot deployments with distillery
Jeffrey Chan
 
How to automate elixir phoenix deployment with distillery and edeliver on ubu...
VasiliyPodnebesniy
 
Real World Elixir Deployment
Pete Gamache
 
Creating your Non-Stop Elixir Application
Manuel Rubio
 
Yaroslav Martsynyuk - Deploying Elixir/Phoenix with Distillery
Elixir Club
 
Deploying Elixir/Phoenix with Distillery - Yaroslav Martsynuyk
Elixir Club
 
Maksym Pugach - Elixir Release and Deploy Utilities
Elixir Club
 
Lab Zero Lunchdown: Deploying Elixir and Phoenix Applications
brien_wankel
 
Releasing Elixir/Phoenix Applications
Wise Engineering
 
Phoenix 1.3 Umbrella App deployment via Distillery-Docker-Docker_Compose
Yeong Sheng Tan
 
Docker & Elixir @kloeckner.i
Florian Kraft
 
Building Elixir App Release with Distillery and Docker
Mickey Chen
 
Zachary Kessin - Deploying and Upgrading with Zero Downtime in Elixir - Codem...
Codemotion
 
Elixir/Phoenix releases and research about common deployment strategies.
Michael Dimmitt
 
Cloud native buildpacks_collabnix
Suman Chakraborty
 
Docker in Action
Alper Kanat
 
From Dev To Prod: How theScore deploys Elixir applications
Joseph An
 
Elixir in the Wild
Benjamin Cates
 
Py Con 2017
Arnold Okoth
 
Messaging with the Docker
Henryk Konsek
 
Ad

Recently uploaded (20)

PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Biography of Daniel Podor.pdf
Daniel Podor
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Ad

Elixir Deployment Tools