Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Elixir Deployment
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
tetiana12345678
January 29, 2017
Programming
420
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Elixir Deployment
Talk given at Elixir London meetup 2017.
tetiana12345678
January 29, 2017
More Decks by tetiana12345678
See All by tetiana12345678
Types in Elixir
tetiana12345678
0
72
The Age of Elixir
tetiana12345678
1
480
Building "learn to touch type" glove with Elixir and Arduino
tetiana12345678
1
1.6k
Using effective learning technique to learn Elixir.
tetiana12345678
1
160
elixir flashcards
tetiana12345678
1
330
Other Decks in Programming
See All in Programming
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
940
Vite+ Unified Toolchain for the Web
naokihaba
0
340
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
360
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
320
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
130
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.3k
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.4k
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
210
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
13
6.3k
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
4.5k
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
350k
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
950
Featured
See All Featured
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
610
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
GitHub's CSS Performance
jonrohan
1033
470k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
My Coaching Mixtape
mlcsv
0
150
Optimising Largest Contentful Paint
csswizardry
37
3.7k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
220
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
620
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
250
Are puppies a ranking factor?
jonoalderson
1
3.6k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Transcript
DEPLOYING ELIXIR BY TETIANA DUSHENKIVSKA
None
HEROKU VS USING RELEASES
DEPLOYING USING RELEASES
PICK RELEASE MANAGER EXRM DISTILLERY REBAR3
None
WHERE SHOULD WE BUILD A RELEASE?
None
None
CREATING A RELEASE OF OTP APP WITH DISTILLERY
ADD DISTILLERY DEPS TO MIX.EXS {:distillery, "~> 1.0"}
FETCH DEPS $ mix deps.get
RELEASE IT! $ mix release ==> You are missing a
release config file. Run the release.init task first
DO AS DISTILLERY TOLD YOU $ mix release.init
GENERATED REL/CONFIG.EXS
None
REL/CONFIG.EXS #/rel/config file content ... include_ertc: false #needs to have
erlang installed. ... release :app_name do set version: current_version(:app_name) end
PRODUCE A RELEASE MIX_ENV=prod mix compile mix release --env=prod --verbose
option for more info
YOU CAN FIND YOUR RELEASES AT _BUILD/PROD/REL/APP_NAME/RELEASES/0.0.1/
AND TARBALL IS PRODUCED! .TAR.GZ
AND YOU HAVE BUILT YOUR RELEASE!
None
...BUT SOMETIMES THINGS GO WRONG
None
None
SOLUTION 1 SHORTEN LONG MODULE NAMES $ find . -type
f -print| awk -F/ ' length($NF) > 99 '
SOLUTION 2 PRODUCE TARBAL MANUALLY MIX_ENV=prod mix compile mix release
--env=prod --no-tar cd /my_app/_build/prod tar -cvzf my_app.tar.gz
GOT IT SORTED!
DEPLOYING
POSSIBILITY 1 MANUALLY COPY .TAR.GZ TO THE PROD SERVER #
copy release to prod server $ scp -i _build/prod/rel/my_app/releases/0.0.1\ /my_app.tar.gz user_name@server_name:/home/my_app/releases/0.0. my_app.tar.gz
UNTAR IT # ssh to the server ssh user_name@server_name #
untar your release on prod server tar -xzf ~/my_app.tar.gz
CHECK IT'S WORKING # start it on prod server my_app/bin/my_app
console # you should see the logs # start it as a daemon on prod server my_app/bin/my_app start my_app/bin/my_app ping # > pong
A BIT OF AUTOMATION
None
GET TO KNOW YOUR SERVER
.TAR.GZ VS .DEB?
.DEB CONTAIN DEBIAN-BINARY CONTROL.TAR.GZ DATA.TAR.GZ
DEBIAN-BINARY 2.0/n
CONTROL.TAR.GZ ARCHIVED CONTROL FILE Package: my.app Version: 1.0.0 Architecture: amd64
Maintainer: Inflowmatix Priority: optional Description: Packaged on debian server
DATA.TAR.GZ THIS IS WHERE OUR APP BINARIES GO (FROM _BUILD
DIR)
LET'S SEE THE EXAMPLE
None
CIRCLECI(2.0) BUILD RELEASE(NO TAR) cd my_app if [ "${CIRCLE_BRANCH}" ==
"master" ]; then MIX_ENV=prod mix compile mix release --env=prod --no-tar --verbose ...
PREPARE DATA.TAR.GZ ... cd /my_app chmod 755 _build/prod/rel/my_app/bin/my_app ... mkdir
-p /my_app/package/ cd /my_app/_build/prod/ tar --xform="s%^%/home/my_app/%"\ -cvzf /my_app/package/data.tar.gz rel/
PREPARE DEBIAN-BINARY ... echo "2.0" >> package/debian-binary
PREPARE CONTROL.TAR.GZ ... mkdir -p package/control cd package/control printf "Package:
..." >> control; tar -zcf /my_app/package/control.tar.gz .
CREATE .DEB PACKAGE ... cd /my_app/ version=$(git describe | sed
's/v//'); mkdir releases ar -rc releases/my_app_$version.deb\ package/debian-binary package/control.tar.gz\ package/data.tar.gz rm -rf package/ fi
STORE .DEB IN ARTIFACTS(CIRCLECI) - type: artifacts-store path: /my_app/releases destination:
releases
DOWNLOAD RELEASE SSH TO THE SERVER $dpkg my_app_0.0.1.deb $/home/my_app/bin/my_app start
SUMMARY LOT'S OF OPTIONS 3 PIECES NEEDED TO PRODUCE .DEB
PACKAGE COULD BE FRUSTRATING, BUT DON'T GIVE UP! CHECK WHERE YOU ARE BUILDING A RELEASE