diff --git a/Berksfile.lock b/Berksfile.lock index ff74b0b..b555f6b 100644 --- a/Berksfile.lock +++ b/Berksfile.lock @@ -1,11 +1,9 @@ -DEPENDENCIES - workspace - path: . - metadata: true - -GRAPH - apt (2.9.2) - timezone-ii (0.2.0) - workspace (0.1.0) - apt (>= 0.0.0) - timezone-ii (>= 0.0.0) +DEPENDENCIES + workspace + path: . + metadata: true + +GRAPH + apt (2.9.2) + workspace (0.1.0) + apt (>= 0.0.0) diff --git a/Vagrantfile b/Vagrantfile index 98d64fc..9ea28e2 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -12,7 +12,7 @@ Vagrant.configure(2) do |config| # Every Vagrant development environment requires a box. You can search for # boxes at https://atlas.hashicorp.com/search. - config.vm.box = "ubuntu/trusty64" + config.vm.box = "ubuntu/bionic64" config.vm.hostname = "workspace" @@ -24,12 +24,17 @@ Vagrant.configure(2) do |config| # Create a forwarded port mapping which allows access to a specific port # within the machine from a port on the host machine. In the example below, # accessing "localhost:8080" will access port 80 on the guest machine. - # config.vm.network "forwarded_port", guest: 80, host: 8080 + config.vm.network "forwarded_port", guest: 3000, host: 3000 + config.vm.network "forwarded_port", guest: 3306, host: 3306 + config.vm.network "forwarded_port", guest: 11211, host: 11211 + config.vm.network "forwarded_port", guest: 6379, host: 6379 # Create a private network, which allows host-only access to the machine # using a specific IP. - # config.vm.network "private_network", ip: "192.168.33.10" - + #config.vm.network "private_network", ip: "169.254.0.1" + Vagrant.configure("2") do |config| + config.vm.network "private_network", ip: "192.168.33.10" + end # Create a public network, which generally matched to bridged network. # Bridged networks make the machine appear as another physical device on # your network. @@ -39,18 +44,19 @@ Vagrant.configure(2) do |config| # the path on the host to the actual folder. The second argument is # the path on the guest to mount the folder. And the optional third # argument is a set of non-required options. - # config.vm.synced_folder "../data", "/vagrant_data" + config.vm.synced_folder "../data", "/mnt" # Provider-specific configuration so you can fine-tune various # backing providers for Vagrant. These expose provider-specific options. # Example for VirtualBox: # - # config.vm.provider "virtualbox" do |vb| + config.vm.provider "virtualbox" do |vb| # # Display the VirtualBox GUI when booting the machine # vb.gui = true # # # Customize the amount of memory on the VM: - # vb.memory = "1024" + # vb.cpus = 6 + # vb.memory = "8192" # end # # View the documentation for the provider you are using for more diff --git a/files/default/.zshrc b/files/default/.zshrc index 720c562..a39e98c 100644 --- a/files/default/.zshrc +++ b/files/default/.zshrc @@ -11,4 +11,8 @@ setopt hist_reduce_blanks setopt inc_append_history setopt hist_no_store -. ~/.zshrc.d/* + +export PATH="$HOME/.rbenv/bin:$PATH" +eval "$(rbenv init - zsh)" + +# . ~/.zshrc.d/* diff --git a/metadata.rb b/metadata.rb index 7587dc5..9f44043 100644 --- a/metadata.rb +++ b/metadata.rb @@ -7,4 +7,3 @@ version '0.1.0' depends 'apt' -depends 'timezone-ii' diff --git a/recipes/default.rb b/recipes/default.rb index 63f78b0..2f2b13a 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -5,8 +5,8 @@ # Copyright (c) 2015 The Authors, All Rights Reserved. package %w{git} -node.normal['tz'] = 'Asia/Tokyo' -include_recipe 'timezone-ii' +# node.normal['tz'] = 'Asia/Tokyo' +# include_recipe 'timezone-ii' include_recipe 'workspace::ruby' include_recipe 'workspace::zsh' diff --git a/recipes/ruby.rb b/recipes/ruby.rb index 44e68c4..9b95f1a 100644 --- a/recipes/ruby.rb +++ b/recipes/ruby.rb @@ -1,9 +1,12 @@ -apt_repository 'ruby2.2'do - uri 'http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu' - distribution node['lsb']['codename'] - components ['main'] +git "rbenv" do + repository "https://github.com/sstephenson/rbenv.git" + destination "/home/vagrant/.rbenv" + action :sync end -package 'ruby2.2' do - options '--force-yes' + +git "ruby-build" do + repository https://github.com/sstephenson/ruby-build.git + destination "/home/vagrant/.rbenv/plugins/ruby-build" + action :sync end diff --git a/recipes/vim.rb b/recipes/vim.rb index 5130202..bf6d639 100644 --- a/recipes/vim.rb +++ b/recipes/vim.rb @@ -1,38 +1,31 @@ -package 'vim-gtk' +package 'git' -directory "/home/#{work_user}/.vim" do - owner work_user - group work_user -end - -directory "/home/#{work_user}/.vim/bundle" do - owner work_user - group work_user -end - -git "/home/#{work_user}/.vim/bundle/neobundle.vim" do - repository 'https://github.com/Shougo/neobundle.vim' +git "#{Chef::Config[:file_cache_path]}/vim" do + repository 'https://github.com/vim/vim' revision 'master' - user work_user - group work_user + action :sync end -directory "/home/#{work_user}/.vimrc.d" do - owner work_user - group work_user -end - - -cookbook_file "/home/#{work_user}/.vimrc" do - owner work_user - group work_user +execute 'install build depends' do + user 'root' + command 'apt-get build-dep -y --allow-unauthenticated vim' end -"/home/#{work_user}/.vimrc.d".tap do |vimdir| - %w{.vimrc.basic .vimrc.bundle .vimrc.complete}.each do |file| - cookbook_file "#{vimdir}/#{file}" do - owner work_user - group work_user - end - end +package %w{ + lua5.3 + python3 + python3-dev + python3-pip +} +configure_opts = %w{ +--with-features=huge +--enable-luainterp +--enable-python3interp +--enable-ruby-interp +--enable-fail-if-missing +}.join(" ") +execute 'build vim' do + user 'root' + command "./configure #{configure_opts} && make && sudo make install" + cwd "#{Chef::Config[:file_cache_path]}/vim" end