2017-01-26 5 views
0

私はApacheのウェブサイトのディレクトリをパッカーを使って迷路のボックスにコピーするのにポストシェルスクリプトを使用しようとしていますが、どのディレクトリにapache用のすべてのファイルが入っているディレクトリを置くべきかわかりません。私は、このエラーに実行し続ける:私のApacheフォルダは、迷惑メールボックスにどのディレクトリを転送する必要がありますか?

#!/bin/bash 
set -e 
set -v 


# http://superuser.com/questions/196848/how-do-i-create-an-administrator-user-on-ubuntu 
# http://unix.stackexchange.com/questions/1416/redirecting-stdout-to-a-file-you-dont-have-write-permission-on 
# This line assumes the user you created in the preseed directory is vagrant 
echo "vagrant ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/init-users 
sudo cat /etc/sudoers.d/init-users 


# Installing vagrant keys 
wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' 
sudo mkdir -p /home/vagrant/.ssh 
sudo chown -R vagrant:vagrant /home/vagrant/.ssh 
cat ./vagrant.pub >> /home/vagrant/.ssh/authorized_keys 

apt-get update 
apt-get install -y apache2 
apt-get install -y php 
if ! [ -L /var/www ]; then 
    rm -rf /var/www 
    ln -fs /vagrant /var/www 
fi 
cp -r bootstrap-website/ ~/var/www/html/ 

任意の助けをいただければ幸いです。ここ

ubuntu-vanilla-16011-server: cp -r bootstrap-website/ ~/var/www/html/ 
ubuntu-vanilla-16011-server: cp: cannot stat 'bootstrap-website/': No such file or directory 
==> ubuntu-vanilla-16011-server: Unregistering and deleting virtual machine... 
==> ubuntu-vanilla-16011-server: Deleting output directory... 

Build 'ubuntu-vanilla-16011-server' errored: Script exited with non-zero exit status: 1 
==> Some builds didn't complete successfully and had errors: 
--> ubuntu-vanilla-16011-server: Script exited with non-zero exit status: 1 
==> Builds finished but no artifacts were created. 

は私のポストスクリプトをインストールしています。 ありがとう

答えて

0

ホストマシン上のファイルは自動的にゲストに転送されません。 bootstrap-websiteをアップロードするには、file provisionerを使用する必要があります。

+0

ありがとうございます。私がボックスにアップロードしたいディレクトリは、jsonファイルと同じディレクトリにあるべきですか? –

+0

はい、そうすべきです。 –

関連する問題