Created
September 7, 2015 11:01
-
-
Save KitaitiMakoto/f69aa4cdc41915187696 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DigitalOcean CentOS 7 | |
DROONGA_GID = 1000 | |
execute "curl https://raw.githubusercontent.com/droonga/droonga-engine/master/install.sh | bash" do | |
not_if "type droonga-engine" | |
end | |
execute "curl https://raw.githubusercontent.com/droonga/droonga-http-server/master/install.sh | bash" do | |
not_if "type droonga-http-server" | |
end | |
execute "rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm" do | |
not_if "yum repolist | grep -q 'nginx repo'" | |
end | |
execute "rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm" do | |
not_if "yum list installed | grep -q groonga-release" | |
end | |
%w[ | |
dstat | |
vim-enhanced | |
lsof | |
tmux | |
nginx | |
groonga-tokenizer-mecab | |
].each do |pkg| | |
package pkg do | |
options "--enablerepo=groonga" | |
end | |
end | |
gem_package "bundler" | |
execute "npm -g install bower" do | |
not_if "type bower" | |
end | |
user "epub-searcher" do | |
gid DROONGA_GID | |
end | |
directory "/var/www/epub-searcher" do | |
owner "epub-searcher" | |
group "droonga" | |
mode "0755" | |
end | |
directory "/var/run/epub-searcher" do | |
owner "epub-searcher" | |
group "droonga" | |
mode "0755" | |
end | |
template "/etc/nginx/conf.d/epub-searcher.conf" do | |
source :auto | |
owner "root" | |
group "root" | |
mode "0644" | |
notifies :reload, "service[nginx]" | |
end | |
%w[ | |
nginx | |
droonga-engine | |
].each do |svc| | |
service svc do | |
action [:start, :enable] | |
end | |
end | |
service "droonga-http-server" do | |
action :start | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment