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
Criando pacotes Debian do Ruby
Search
Andriel Nuernberg
January 28, 2014
Technology
0
45
Criando pacotes Debian do Ruby
Como criar pacotes .deb do Ruby para Debian, usando FPM e Chef.
Andriel Nuernberg
January 28, 2014
Tweet
Share
More Decks by Andriel Nuernberg
See All by Andriel Nuernberg
Workshop de Git
andrielfn
0
60
Other Decks in Technology
See All in Technology
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
10
75k
データ分析エージェント Socrates の育て方
na0
6
2.3k
スクラムガイドに載っていないスクラムのはじめかた - チームでスクラムをはじめるときに知っておきたい勘所を集めてみました! - / How to start Scrum that is not written in the Scrum Guide 2nd
takaking22
1
170
下手な強制、ダメ!絶対! 「ガードレール」を「檻」にさせない"ガバナンス"の取り方とは?
tsukaman
2
460
人工衛星のファームウェアをRustで書く理由
koba789
15
8.3k
いま注目のAIエージェントを作ってみよう
supermarimobros
0
350
S3アクセス制御の設計ポイント
tommy0124
3
200
AIエージェントで90秒の広告動画を制作!台本・音声・映像・編集をつなぐAWS最新アーキテクチャの実践
nasuvitz
3
350
会社紹介資料 / Sansan Company Profile
sansan33
PRO
6
380k
Firestore → Spanner 移行 を成功させた段階的移行プロセス
athug
1
500
EncryptedSharedPreferences が deprecated になっちゃった!どうしよう! / Oh no! EncryptedSharedPreferences has been deprecated! What should I do?
yanzm
0
490
サラリーマンの小遣いで作るtoCサービス - Cloudflare Workersでスケールする開発戦略
shinaps
2
470
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
How GitHub (no longer) Works
holman
315
140k
Speed Design
sergeychernyshev
32
1.1k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
810
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
188
55k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Become a Pro
speakerdeck
PRO
29
5.5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Transcript
Criando pacotes Debian do Ruby
Contexto
None
None
$ apt-get install ruby ... $ ruby -v ruby 1.9.3p194
(2012-04-20 revision 35410) [x86_64-linux]
None
$ apt-get install build-essentials $ time rbenv install 2.1.0 ...
real 7m28.059s user 6m39.681s sys0m31.018s D igitalO cean
.deb
dpkg-source debuild fpm
None
basename=$(basename $1) # Package configs architecture="x64" name="ruby" version="2.1.0" decription="Ruby $version
stable package" # Package dependencies dependencies=( "libstdc++6 (>= 4.4.3)" "libc6 (>= 2.6)" "libffi5 (>= 3.0.4)" "libgdbm3 (>= 1.8.3)" "libncurses5 (>= 5.7)" "libreadline6 (>= 6.1)" "libssl1.0.0 (>= 1.0.0)" "zlib1g (>= 1:1.2.2)" "libyaml-0-2 (>= 0.1.3)" )
output=$(mktemp -d -t $basename.XXXX) trap "rm -rf $output" ERR EXIT
if [ -z "$1" ] ; then echo "./rubydeb.sh <RUBY_SOURCE_PATH>" fi cd $1 ./configure --prefix=/usr && make && make install DESTDIR=$output fpm \ -s dir \ -t deb \ -n "$name" \ -v "$version" \ --description "$description" \ -C "$output" \ -p "ruby-$version-$architecture.deb" \ $(printf " -d '%s'" "${dependencies[@]}") \ usr/bin usr/lib usr/share/man usr/include
$ ./rubydeb.sh ruby-2.1.0/ checking build system type... x86_64-unknown-linux-gnu checking host
system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for gcc... gcc checking whether the C compiler works... yes ...
Amazon S3
C hef // nodes/my-production-node.json { "environment": "production", "ruby": { "version":
"2.0.0-p353", "arch": "x64" }, "run_list": [ "recipe[ruby]" ] }
// cookbooks/ruby/recipes/default.rb package_name = "ruby-#{node[:ruby][:version]}-#{node[:ruby][:arch]}.deb" remote_file "/tmp/#{package_name}" do source "https://s3.amazonaws.com/andrielfn/packages/ruby/#{package_name}"
mode 0644 end dpkg_package "ruby" do source "/tmp/#{package_name}" action :install end C hef
C hef Recipe: ruby::default * package[libyaml-0-2] action install (up to
date) * remote_file[/tmp/ruby-2.0.0-p353-x64.deb] action create - create new file /tmp/ruby-2.0.0-p353-x64.deb - update content in file /tmp/ruby-2.0.0-p353-x64.deb from none to 7bbeb8 (file sizes exceed 10000000 bytes, diff output suppressed) - change mode from '' to '0644' * dpkg_package[ruby] action install - install version 2.0.0-p353 of package ruby Chef Client finished, 2 resources updated
C hef // nodes/my-production-node.json { "environment": "production", "ruby": { "version":
"2.1.0", "arch": "x64" }, "run_list": [ "recipe[ruby]" ] }
C hef Recipe: ruby::default * package[libyaml-0-2] action install (up to
date) * remote_file[/tmp/ruby-2.1.0-x64.deb] action create (up to date) * dpkg_package[ruby] action install - install version 2.1.0 of package ruby Chef Client finished, 1 resources updated
• Não precisa compilar nos ambientes de prod, stage, qa,
etc; • Atualização de versão é rápida; • Você controla como o Ruby deve ser compilado; Amazon S3
Obrigado!