If you’ve ever had to set up testing environments using virtual machines and Jenkins software, you know how time consuming and frustrating it can be. Having to spin up multiple VM’s for different OS’s, downloading the latest Jenkins software, updating Java to the latest and greatest, and so on. Such a pain. Setting up a testing environment doesn’t have to be so difficult. Using Yipee.io has made setting up testing environments much easier. I no longer need to spin up VM’s and the latest Jenkins is always available.

Lets get started.

(Note: You will need to have Docker Community Edition and Yipee.io.)

Once logged in to Yipee.io, create a new app.

In the modeler, search Docker Hub for the Jenkins container, set configurations and save.

(Note: Yipee.io has an editor that shows your applications containers graphically. You can search Docker Hub for containers via the search box at the top of the canvas. You can drag and drop containers onto the canvas from the results box. You may then change individual containers configurations using the side pane by selecting the container on the canvas. We will be configuring the ports that Jenkins runs on.)

In the search box on the top of the canvas, type in Jenkins. Drag and drop the container that says Docker Hub on the top right of the container onto the canvas.

Click on the Jenkins container in the canvas, add a port field by clicking the + icon and set the ports field in the pane on the right to 48000 and 8080.

The next thing you’ll want to do is create a volume and connect it to your container so that your Jenkins configuration data will survive when deleting the container and re-creating it. Create the volume using the Volumes tab – click the + button and label it “jenkins_home”in the Name field.

Next we’ll connect the volume to the Jenkins container. Click somewhere on the Jenkins container and a small circle will appear under the container. Click on that circle and drag over to your Volume to create the connection.

Finally, click back on the Application tab and expand the Jenkins service, find the Volumes section and configure the mount point for the volume to be /var/jenkins_home (where Jenkins stores configuration).

Click Save at the top of the right pane.

Now let’s download a Compose file and run the app that you just created.

At the top of the configuration pane, click download and then choose Download Compose File.

Once the download is complete, it’s time to run our app. Open a terminal and navigate to the directory where the download file was stored. In the correct directory type “docker-compose –f MyApp-Compose.yml up”. In the console a password will print out the first-time Jenkins is used. Go to a web browser and type in “localhost:48000” and paste the password that was printed out for Jenkins in the text box.

Follow the on-screen prompts by Jenkins. Voila Jenkins is ready for new tests to be written. Any tests or changes made in Jenkins are saved and you can shut down and restart the container at any time; very handy for just spinning up a Jenkins test machine in 5 minutes. You can also add databases, operating systems, and other containers to use with your Jenkins container just as easily. Look for my next blog on adding and configuring multiple containers with Yipee.io and a future blog on customizing your Jenkins image to automatically install software and plugins needed in your build environment.

Interested in learning more about Yipee.io? Sign up for free to see how Yipee.io can help your team streamline their development process.