Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.hostname = "ub1604jbake"
config.vm.provider :virtualbox do |vbox|
vbox.name = "ub1604jbake"
vbox.cpus = 2
vbox.memory = 2048
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.103", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.103", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
# update packages
apt-get update
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
locale-gen ja_JP.UTF-8
localectl set-locale LANG=ja_JP.UTF-8
# install java
apt-get -y install openjdk-8-jdk
# install jbake
apt-get -y install unzip
wget -O jbake.zip http://hash.to/5tc
unzip jbake.zip
mv jbake-2.5.1 /opt/jbake
chmod +x /opt/jbake/bin/jbake
ln -s /opt/jbake/bin/jbake /usr/local/bin
# create sample project
mkdir project
cd project
jbake -i
mkdir -p /home/vagrant/project/content/blog/2017
cat << EOF > /home/vagrant/project/content/blog/2017/test.md
title=テスト記事
date=2017-11-23
type=post
tags=test,jbake
status=published
~~~~~~
* example1
テストです。
EOF
jbake -b
chown -R vagrant:vagrant /home/vagrant/project
echo 'execute command below and and access http://192.168.55.103:8820/';
echo 'cd project'
echo 'jbake -s'
SHELL
end
〇JBakeで生成したテストサイトの画面
○関連情報
・JBakeに関する他の記事はこちらを参照してください。
0 件のコメント:
コメントを投稿