we need to create one dir
mkdir cloud
wget url (sample website)
----------------------------------
unzip moon.zip
rm -rf moon.zip
cp -rvf moon/* .
rm -rf moon
VIM JJ.JSON
{
"builders": [
{
"type": "amazon-ebs",
"region": "us-east-1",
"access_key": "AKQ",
"secret_key": "Kfaurid",
"instance_type": "t2.micro",
"source_ami": "ami-02e136e904f3da870",
"ssh_username": "ec2-user",
"ami_name": "moon-amiiii"
}
],
"provisioners": [
{
"type": "file",
"source": "./code/", --- inside code we have website files
"destination": "/tmp"
},
{
"type": "shell",
"inline": [
"sleep 30",
"sudo yum update -y",
"sudo yum install httpd -y",
"sudo cp -rvf /tmp/* /var/www/html", -- once it copy code then remove tmp and paste it on /var/www
"sudo service httpd start",
"sudo chkconfig httpd on",
]
}
]
}
Comments
Post a Comment