Where Packer Fits in CI/CD
Softwares Required
- Chocolatey: Refer Here
- Git:
choco install git -y
- Visual Studio Code
choco install vscode -y
Create a tomcat Server AMI in AWS
- Create an EC2 machine with Ubuntu AMI
- Login into machine and execute the following commands
sudo apt-get update
sudo apt-cache search jdk
sudo apt-get install openjdk-8-jdk -y
sudo apt-cache search tomcat
sudo apt-get install tomcat8 -y
sudo service tomcat8 status
- Create an AMI of the EC2 Machine
- Image References
- Important info for creating ami in AWS
- EC2 machines Image (Source AMI => Ubuntu)
- EC2 machines size (t2.micro)
- Region (Oregon)
- Commands to be executed in ubuntu
Install Packer
- Chocolatey in windows
choco install packer -y
# Close and reopen powershell
packer --version
packer --help
- Refer Here for direct downloads.
Packer Json
- Packer Json has sections
- Builder: Where to create Image
- Provisioner: Commands to be executed to install software.
- Post-Processor: any post build activities
Builders
- Builder is a virtualization env where packer can build an Image. Refer Here
Provisioners
- Used for installing software / packages etc. Refer Here for full list of Provisioners