Create EB configuration files

Jenkins is mostly used with Git based projects. So we will need the EB environment to be able to use Git. Create a folder called .ebextensions and create in that folder a file called jenkins.config . Put the following in the file:

packages:

yum:

git: []

Watch the indent! It should be 2 spaces. The format of the file is YAML. The .ebextensions folder is a way to configure your EB environment. The jenkins.config file contains a configuration option for the instance in the EB environment. In our case we need yum to install the latest git for us. More on the use of .ebextensions can be found here:

The Java Platform EB environment runs with a proxy. The default is Apache, but there are more to choose from. We will stick with the default. Apache will listen on port 80 and route all traffic to the instance using port 5000.

Jenkins runs default on port 8080, so we will need to change it to port 5000. The easiest way to accomplish that is to start Jenkins like this:

java -jar jenkins.jar --httpPort=5000

There are a lot of useful commandline parameters to configure Jenkins. You can find them here:

Now we need a Procfile to tell the EB environment to start the jenkins.jar with commandline parameters. Create a Procfile with the following contents:

web: java -jar jenkins.jar --httpPort=5000