The Vagrant and Puppet setup in this project installs and configures a virtual box environment for a Jenkins workshop. For instance, the environment can be used for a workshop about Continuous Delivery with Pipelines as Code.
The virtual box is provisioned with
- Jenkins
- Various Java JDKs
- Maven
- git
- Artifactory
It is possible to redistribute the box after it has been provisioned, and possibly configured manually. Both Jenkins and Artifactory require manual configuration. See below for instructions on how to do this.
Note that this project has only been tested on Windows, but is expected to work elsewhere too.
- Download and install Git. Important: see below for installation instructions on Windows.
- Download and install Vagrant.
- Download and install VirtualBox.
- Clone this repo.
- Have a look at the Vagrantfile for up-to-date instructions and configuration.
- Open a command line and navigate to the folder containing this repo.
- Run
vagrant up
(this might take while). - Run
vagrant ssh
to connect to the virtual box. This requires an SSH client. The (optional) Unix tools of the Windows Git client include an SSH client. - Exit from this Linux terminal session.
- Stop the virtual box using 'vagrant halt'.
If you are taking part in the corresponding workshop, please do not configure Jenkins and Artifactory. They will be set up and configured as part of the workshop.
The installation can be tested by opening http://192.168.33.10:8080 in a web browser to access Jenkins, and http://192.168.33.10:8081/artifactory/ to access Artifactory. The IP address corresponds to the one configured in the Vagrantfile. If the web pages are not available, a restart of the virtual box might solve the problem.
It is important to configure git under installation as shown below.
After provisioning and possible further manual configuration, the box can be redistributed to interested parties.
The following steps are needed to create a box image (size ca 3GB).
- Run
vagrant halt
- Run
vagrant package --output cd-jenkins-workshop.box
- Copy cd-jenkins-workshop.box to a file share, or memory sticks.
The following steps are needed to import the box image.
-
Download and install Vagrant.
-
Download and install VirtualBox.
-
Obtain the packaged box from someone, and store it on your PC as e.g. c:\box\cd-jenkins-workshop.box
-
Create a directory, e.g. c:\workshop.
-
Create the directory src\ in the above created directory, e.g. c:\workshop\src
-
Open a command line window, and navigate to c:\workshop
-
Run
vagrant init
-
Edit the Vagrant file, adjust config.vm.box_url and config.vm.network if necessary:
Vagrant.configure("2") do |config| config.vm.box = "cd-jenkins-workshop" # Adjust to correct path if necessary: config.vm.box_url = "file://c:/box/cd-jenkins-workshop.box" config.vm.provider "virtualbox" do |v| v.memory = 4096 end config.vm.hostname = "jenkins-workshop" config.vm.network "private_network", ip: "192.168.33.10" config.vm.synced_folder "src/", "/work/src" end
-
Run
vagrant up
to start the box. -
The installation can be tested by opening http://192.168.33.10:8080 in a web browser to access Jenkins, and http://192.168.33.10:8081/artifactory/ to access Artifactory. The IP address corresponds to the one configured in the Vagrantfile. If the web pages are not available, a restart of the virtual box might solve the problem. Please do not change configuration of Jenkins or Artifactory.