Skip to content

Instantly share code, notes, and snippets.

@fuka
Created November 3, 2019 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fuka/cfd64772740280e703a7547a044477f1 to your computer and use it in GitHub Desktop.
Save fuka/cfd64772740280e703a7547a044477f1 to your computer and use it in GitHub Desktop.
asciidoctor-pdf-linewrap-ja の開発環境構築用
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# box
config.vm.box = "centos/7"
# 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: 8081, host: 8081
# 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"
# synced folder
config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
# provisioning
config.vm.provision :shell, inline: <<-SHELL
# enable password authentication
sed -i -e "s/PasswordAuthentication no/PasswordAuthentication yes/g" /etc/ssh/sshd_config
service sshd reload
# software
yum update -y
yum install -y git
yum install -y gcc gcc-c++ openssl-devel readline-devel
SHELL
# install rbenv
config.vm.provision "shell", privileged: false, inline: <<-SHELL
if ! [ -d .rbenv ]
then
git clone https://github.com/sstephenson/rbenv.git .rbenv
git clone https://github.com/sstephenson/ruby-build.git .rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> .bashrc
echo 'eval "$(rbenv init -)"' >> .bashrc
fi
SHELL
# install ruby by rbenv
config.vm.provision "shell", privileged: false, inline: <<-SHELL
if [ -e .rbenv/bin/rbenv ]
then
export PATH="/home/vagrant/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
rbenv install -s 2.4.0
rbenv rehash
rbenv global 2.4.0
fi
SHELL
config.vm.provision "shell", privileged: false, inline: <<-SHELL
# source
cd /vagrant
rm -rf asciidoctor-pdf-linewrap-ja
git clone https://github.com/fuka/asciidoctor-pdf-linewrap-ja.git
gem install bundler
gem install rake
gem install --pre asciidoctor-pdf
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment