SlideShare a Scribd company logo
Deploying Elixir/Phoenix
w/ Distillery
Elixir Club Ternopil, 2017
Yaroslav Martsynyuk @ Wise Engineering
What is Distillery and What it Does?
- Elixir Release Manager
- Builds Release Tarball
- Describes the Set of Applications It Needs to Run
- Builds Upgrades
1 defp deps do
2 [{:distillery, "~> 1.2.2"}]
3 end
Add Distillery As Dependency
$> mix release.init
1 use Mix.Releases.Config,
2 default_release: :foo,
3 default_environment: Mix.env,
4
5 environment :prod do
6 set include_erts: true
7 set cookie: :prod
8 end
9
10 release :foo do
11 set version: current_version(:foo)
12 end
$> MIX_ENV=prod mix deps.get --only prod
$> MIX_ENV=prod mix compile
$> MIX_ENV=prod mix release [--upgrade] --env=prod
VERSION - 1 => VERSION => VERSION + 1
Create Release/Upgrade
1 #! /usr/bin/env
2
3 if["$(ssh user@host /tmp/bin/demo ping)" = "pong" ]; then
4 bash ./upgrade.sh
5 else
6 cd ~/demo
7 export V=$(grep 'version' mix.exs | cut -d'"' -f2)
8 mix release.init
9 MIX_ENV=prod mix deps.get --only prod
10 MIX_ENV=prod mix compile
11 MIX_ENV=prod mix release --env=prod
12 scp ./releases/${V}/demo.tar.gz user@host:/tmp
13 ssh user@host tar -xf demo.tar.gz -C /tmp
14 ssh user@host /tmp/bin/demo start
15 fi
1 #! /usr/bin/env
2
3 cd ~/demo
4 export V=$(grep 'version' mix.exs | cut -d'"' -f2)
5 MIX_ENV=prod mix deps.get --only prod
6 MIX_ENV=prod compile
7 MIX_ENV=prod mix release --env=prod --upgrade
8 scp ./releases/${V}/demo.tar.gz user@host:/tmp/releases/${V}
9 ssh user@host /tmp/bin/demo upgrade ${VERSION}
45.55.215.61 CI Node
45.55.191.102 Production Node
http://45.55.191.102:4000
Demo Time
. . .
?

More Related Content

PDF
Yurii Bodarev - OTP, Phoenix & Ecto: Three Pillars of Elixir
PDF
GenStage and Flow - Jose Valim
PPTX
10 tips for making Bash a sane programming language
PDF
Erlang and Elixir
PDF
Elixir Into Production
PDF
Django productivity tips and tricks
PDF
Using HttpKernelInterface for Painless Integration
PDF
Hacking ansible
Yurii Bodarev - OTP, Phoenix & Ecto: Three Pillars of Elixir
GenStage and Flow - Jose Valim
10 tips for making Bash a sane programming language
Erlang and Elixir
Elixir Into Production
Django productivity tips and tricks
Using HttpKernelInterface for Painless Integration
Hacking ansible

What's hot (20)

TXT
Install notes
PDF
Ansible, Simplicity, and the Zen of Python
PDF
Elixir on Containers
PDF
Augeas
PDF
Symfony 2.0 on PHP 5.3
PDF
YAPC::Brasil 2009, POE
PDF
aiohttp intro
PDF
Ansible tips & tricks
PDF
Databases and MySQL
PDF
New ES6 Hotness
PDF
Introduction to Erlang/(Elixir) at a Webilea Hands-On Session
PDF
Flask - Backend com Python - Semcomp 18
KEY
Mojo as a_client
PDF
Perl web frameworks
PDF
Ansible leveraging 2.0
PPTX
Webrtc mojo
PDF
Getting out of Callback Hell in PHP
PPTX
4. copy2 in Laravel
PPTX
3. Copy1 in Laravel
PDF
Java Streams Interview short reminder with examples
Install notes
Ansible, Simplicity, and the Zen of Python
Elixir on Containers
Augeas
Symfony 2.0 on PHP 5.3
YAPC::Brasil 2009, POE
aiohttp intro
Ansible tips & tricks
Databases and MySQL
New ES6 Hotness
Introduction to Erlang/(Elixir) at a Webilea Hands-On Session
Flask - Backend com Python - Semcomp 18
Mojo as a_client
Perl web frameworks
Ansible leveraging 2.0
Webrtc mojo
Getting out of Callback Hell in PHP
4. copy2 in Laravel
3. Copy1 in Laravel
Java Streams Interview short reminder with examples
Ad

Viewers also liked (9)

PDF
Alex Troush - IEx Cheat Sheet
PDF
Anton Mishchuk - Multi-language FBP with Flowex
PDF
Yurii Bodarev - Ecto DSL
PDF
Experimental.flow
PDF
Composable Queries with Ecto
PDF
Maksym Pugach - Elixir Release and Deploy Utilities
PPTX
Elixirs
PDF
Origins of Elixir programming language
PPT
PowerPoint Tutorial
Alex Troush - IEx Cheat Sheet
Anton Mishchuk - Multi-language FBP with Flowex
Yurii Bodarev - Ecto DSL
Experimental.flow
Composable Queries with Ecto
Maksym Pugach - Elixir Release and Deploy Utilities
Elixirs
Origins of Elixir programming language
PowerPoint Tutorial
Ad

Similar to Yaroslav Martsynyuk - Deploying Elixir/Phoenix with Distillery (20)

PDF
Deploying Elixir/Phoenix with Distillery - Yaroslav Martsynuyk
PDF
Releasing Elixir/Phoenix Applications
DOC
ODP
Buildout: How to maintain big app stacks without losing your mind
PDF
mapserver_install_linux
PDF
mapserver_install_linux
PDF
mapserver_install_linux
PDF
mapserver_install_linux
PDF
[Cook book] ansible 4_dell emc networking
PDF
Deployment Tactics
PDF
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
PDF
DeVry GSP 115 All Assignments latest
PDF
An Overview of the IHK/McKernel Multi-kernel Operating System
PDF
Phing
PPT
How to host an app for $20 in 20min using buildout and hostout
PDF
Advanced GAR
PDF
Alfresco study37 alfresco_ng2_components
PDF
How to ride a whale
PDF
Composer for busy developers - DPC13
ODP
RPM: Speed up your deploy
Deploying Elixir/Phoenix with Distillery - Yaroslav Martsynuyk
Releasing Elixir/Phoenix Applications
Buildout: How to maintain big app stacks without losing your mind
mapserver_install_linux
mapserver_install_linux
mapserver_install_linux
mapserver_install_linux
[Cook book] ansible 4_dell emc networking
Deployment Tactics
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
DeVry GSP 115 All Assignments latest
An Overview of the IHK/McKernel Multi-kernel Operating System
Phing
How to host an app for $20 in 20min using buildout and hostout
Advanced GAR
Alfresco study37 alfresco_ng2_components
How to ride a whale
Composer for busy developers - DPC13
RPM: Speed up your deploy

More from Elixir Club (20)

PDF
Kubernetes + Docker + Elixir - Alexei Sholik, Andrew Dryga | Elixir Club Ukraine
PDF
Integrating 3rd parties with Ecto - Eduardo Aguilera | Elixir Club Ukraine
PDF
— An async template - Oleksandr Khokhlov | Elixir Club Ukraine
PDF
BEAM architecture handbook - Andrea Leopardi | Elixir Club Ukraine
PDF
You ain't gonna need write a GenServer - Ulisses Almeida | Elixir Club Ukraine
PDF
— Knock, knock — An async templates — Who’s there? - Alexander Khokhlov | ...
PDF
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
PDF
Erlang cluster. How is it? Production experience. — Valerii Vasylkov | Elixi...
PDF
Promo Phx4RailsDevs - Volodya Sveredyuk
PDF
Web of today — Alexander Khokhlov
PDF
ElixirConf Eu 2018, what was it like? – Eugene Pirogov
PDF
Implementing GraphQL API in Elixir – Victor Deryagin
PDF
WebPerformance: Why and How? – Stefan Wintermeyer
PDF
GenServer in Action – Yurii Bodarev
PDF
Russian Doll Paradox: Elixir Web without Phoenix - Alex Rozumii
PDF
Practical Fault Tolerance in Elixir - Alexei Sholik
PDF
Phoenix and beyond: Things we do with Elixir - Alexander Khokhlov
PDF
Monads are just monoids in the category of endofunctors - Ike Kurghinyan
PDF
Craft effective API with GraphQL and Absinthe - Ihor Katkov
PDF
Elixir in a service of government - Alex Troush
Kubernetes + Docker + Elixir - Alexei Sholik, Andrew Dryga | Elixir Club Ukraine
Integrating 3rd parties with Ecto - Eduardo Aguilera | Elixir Club Ukraine
— An async template - Oleksandr Khokhlov | Elixir Club Ukraine
BEAM architecture handbook - Andrea Leopardi | Elixir Club Ukraine
You ain't gonna need write a GenServer - Ulisses Almeida | Elixir Club Ukraine
— Knock, knock — An async templates — Who’s there? - Alexander Khokhlov | ...
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Erlang cluster. How is it? Production experience. — Valerii Vasylkov | Elixi...
Promo Phx4RailsDevs - Volodya Sveredyuk
Web of today — Alexander Khokhlov
ElixirConf Eu 2018, what was it like? – Eugene Pirogov
Implementing GraphQL API in Elixir – Victor Deryagin
WebPerformance: Why and How? – Stefan Wintermeyer
GenServer in Action – Yurii Bodarev
Russian Doll Paradox: Elixir Web without Phoenix - Alex Rozumii
Practical Fault Tolerance in Elixir - Alexei Sholik
Phoenix and beyond: Things we do with Elixir - Alexander Khokhlov
Monads are just monoids in the category of endofunctors - Ike Kurghinyan
Craft effective API with GraphQL and Absinthe - Ihor Katkov
Elixir in a service of government - Alex Troush

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Electronic commerce courselecture one. Pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Big Data Technologies - Introduction.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Cloud computing and distributed systems.
MYSQL Presentation for SQL database connectivity
Diabetes mellitus diagnosis method based random forest with bat algorithm
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
NewMind AI Weekly Chronicles - August'25 Week I
Electronic commerce courselecture one. Pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation_ Review paper, used for researhc scholars
Network Security Unit 5.pdf for BCA BBA.
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
MIND Revenue Release Quarter 2 2025 Press Release
Mobile App Security Testing_ A Comprehensive Guide.pdf
Spectroscopy.pptx food analysis technology
Big Data Technologies - Introduction.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Spectral efficient network and resource selection model in 5G networks
Advanced methodologies resolving dimensionality complications for autism neur...
Programs and apps: productivity, graphics, security and other tools
Cloud computing and distributed systems.

Yaroslav Martsynyuk - Deploying Elixir/Phoenix with Distillery

  • 1. Deploying Elixir/Phoenix w/ Distillery Elixir Club Ternopil, 2017 Yaroslav Martsynyuk @ Wise Engineering
  • 2. What is Distillery and What it Does? - Elixir Release Manager - Builds Release Tarball - Describes the Set of Applications It Needs to Run - Builds Upgrades
  • 3. 1 defp deps do 2 [{:distillery, "~> 1.2.2"}] 3 end Add Distillery As Dependency
  • 4. $> mix release.init 1 use Mix.Releases.Config, 2 default_release: :foo, 3 default_environment: Mix.env, 4 5 environment :prod do 6 set include_erts: true 7 set cookie: :prod 8 end 9 10 release :foo do 11 set version: current_version(:foo) 12 end
  • 5. $> MIX_ENV=prod mix deps.get --only prod $> MIX_ENV=prod mix compile $> MIX_ENV=prod mix release [--upgrade] --env=prod VERSION - 1 => VERSION => VERSION + 1 Create Release/Upgrade
  • 6. 1 #! /usr/bin/env 2 3 if["$(ssh user@host /tmp/bin/demo ping)" = "pong" ]; then 4 bash ./upgrade.sh 5 else 6 cd ~/demo 7 export V=$(grep 'version' mix.exs | cut -d'"' -f2) 8 mix release.init 9 MIX_ENV=prod mix deps.get --only prod 10 MIX_ENV=prod mix compile 11 MIX_ENV=prod mix release --env=prod 12 scp ./releases/${V}/demo.tar.gz user@host:/tmp 13 ssh user@host tar -xf demo.tar.gz -C /tmp 14 ssh user@host /tmp/bin/demo start 15 fi
  • 7. 1 #! /usr/bin/env 2 3 cd ~/demo 4 export V=$(grep 'version' mix.exs | cut -d'"' -f2) 5 MIX_ENV=prod mix deps.get --only prod 6 MIX_ENV=prod compile 7 MIX_ENV=prod mix release --env=prod --upgrade 8 scp ./releases/${V}/demo.tar.gz user@host:/tmp/releases/${V} 9 ssh user@host /tmp/bin/demo upgrade ${VERSION}
  • 8. 45.55.215.61 CI Node 45.55.191.102 Production Node http://45.55.191.102:4000 Demo Time
  • 10. ?