Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
totem3 committed Nov 6, 2018
1 parent 9be728b commit 8c9c753
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 59 deletions.
20 changes: 9 additions & 11 deletions Berksfile.lock
Original file line number Diff line number Diff line change
@@ -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)
20 changes: 13 additions & 7 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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.
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion files/default/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
1 change: 0 additions & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
version '0.1.0'

depends 'apt'
depends 'timezone-ii'
4 changes: 2 additions & 2 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
15 changes: 9 additions & 6 deletions recipes/ruby.rb
Original file line number Diff line number Diff line change
@@ -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
55 changes: 24 additions & 31 deletions recipes/vim.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8c9c753

Please sign in to comment.