Automating authentication and authorization on Jenkins

Not so long I need to automate the authentication and authorization processes for Jenkins server. The Jenkins server was installed using the Jenkins Chef cookbook.

For authentication process, I am using the follow plugins Active Directory for authentication and  Matrix Authorization Strategy for authorization.

The interesting thing about this kind of automation on Jenkins is, you will need to write some groovy script.

Below you will find the groovy script used to add permissions for a user or a group under the active directory.

Using this code and using the chef Jenkins Script resource it was possible to do that!

If you have any question about it please let me know.

Tmux and Fish Shell in Mac OS X

Tmux and Fish Shell are a great tools to improve command-line performance.

In Tmux website you will find:

Tmux is a “terminal multiplexer”, it enables a number of terminals (or windows)
to be accessed and controlled from a single terminal. tmux is intended to be a
simple, modern, BSD-licensed alternative to programs such as GNU screen.

To install tmux in Mac OS X you need to install first libevent. To install libevent follow the steps below:

Download the latest version on in my case the latest version is libevent-2.0.22-stable.tar.gz

To install Tmux you can follow the steps:

Download the latest version on in my case the latest version is tmux-1.9a.tar.gz 

To tmux run each time that you open the terminal you can add the line below in the ~/.bash_profile

After added this line in the .bash_profile reload it and your terminal will looks like:

Screen Shot 2015-05-03 at 22.59.55

The tmux command line is ctrl+b, you can find more commands on the page

To split vertical the terminal you can run the command:

And the result will be.

Screen Shot 2015-05-03 at 23.08.47

To change from one panel to another panel the command will be

In Fish shell website you will find:

Fish is a friendly interactive shell. Fish is a user friendly commandline shell intended mostly for interactive use. A shell is a program used to execute other programs.

To install fish shell you can download the pkg file on the link

To run fish in your command line

After run fish the terminal will be.

Screen Shot 2015-05-03 at 23.20.43

You can find more information about fish shell on the link

Setting environment variables in Mac OsX

To add an evironment variable in the Mac OS X for a specific user you should create a file called .bash_profile as the command below:

And inside of the file .bash_profile you can add the variable that you want. Below my example is related to boot2docker.