- Fork the https://github.com/szatmari/devops-virtualization project
- Start a "DevOps - virtualization" in the BME cloud
- Setup project folder
mkdir myVagrantProject; cd myVagrantProject
- Init vagrant project
vagrant init hashicorp/precise32
- Limit CPUs to 1
config.vm.provider "virtualbox" do |vb|
vb.cpus = 1
end
- Start the project
vagrant up
vagrant ssh
ls /vagrant
- Check the Vagrant cloud service: https://app.vagrantup.com
- Check the running vms
vboxmanage list vms
- Map the port 8080 to the public interface in the BME Cloud Manager
- Visit the generated endpoint
- Create a new freestyle job
- Set your GitHub link to your project
- Configure SCM: git
- Add your repository URL
- Set the "Branches to build" property to "*/master"
- Add "Invoke gradle script" to the Build section
- Set the gradle task: "build"
- Add a Post Build action: Publish Junit test results
- Set the path of the "Test report XMLs" to "build/test-results/test/*.xml"
- Check the Vagrantfile in the project
- Add a new build task to do deployment: "Execute shell" and execute Vagrant Up!
vagrant up
- Try to enter to the VM console and start your application
sudo su jenkins -s /bin/bash
cd /var/lib/jenkins/jobs/%%myDevOpsJob%%/workspace
vagrant ssh
- Check the Packerfile and the content of the packer folder in the project
- Check the Ubuntu AMI locator for AWS: https://cloud-images.ubuntu.com/locator/ec2/
- Try the packer builder using an other Execute shell build step
packer build -var 'aws_access_key=XXXXXXXXXXX' -var 'aws_secret_key=XXXXXXXXXXXXX' Packerfile