From 5eaf0d9143c39023ed8f941442c308c6cef09cda Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 18 Feb 2024 11:17:11 +0900 Subject: [PATCH] Install `mise`. --- cookbooks/kazu634/default.rb | 2 ++ .../files/etc/apt/sources.list.d/mise.list | 1 + cookbooks/kazu634/mise.rb | 27 +++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 cookbooks/kazu634/files/etc/apt/sources.list.d/mise.list create mode 100644 cookbooks/kazu634/mise.rb diff --git a/cookbooks/kazu634/default.rb b/cookbooks/kazu634/default.rb index 13ebf98..4021165 100644 --- a/cookbooks/kazu634/default.rb +++ b/cookbooks/kazu634/default.rb @@ -5,3 +5,5 @@ include_recipe './ssh.rb' include_recipe './vim.rb' include_recipe './mc.rb' + +include_recipe './mise.rb' diff --git a/cookbooks/kazu634/files/etc/apt/sources.list.d/mise.list b/cookbooks/kazu634/files/etc/apt/sources.list.d/mise.list new file mode 100644 index 0000000..1d0b734 --- /dev/null +++ b/cookbooks/kazu634/files/etc/apt/sources.list.d/mise.list @@ -0,0 +1 @@ +deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=amd64] https://mise.jdx.dev/deb stable main diff --git a/cookbooks/kazu634/mise.rb b/cookbooks/kazu634/mise.rb new file mode 100644 index 0000000..469ab03 --- /dev/null +++ b/cookbooks/kazu634/mise.rb @@ -0,0 +1,27 @@ +directory '/etc/apt/keyrings/' do + owner 'root' + group 'root' + mode '0755' +end + +execute 'wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | tee /etc/apt/keyrings/mise-archive-keyring.gpg' do + not_if 'test -f /etc/apt/keyrings/mise-archive-keyring.gpg' +end + +remote_file '/etc/apt/sources.list.d/mise.list' do + owner 'root' + group 'root' + mode '0644' +end + +execute 'apt update' do + not_if 'which mise' +end + +package 'mise' + + +# For Ruby installation: +%w( git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev ).each do |p| + package p +end