Posts tagged with jenkins

Continuation Passing Style

Jun 15, 2014 in jenkins, functional programming | blog

Continuation Passing Style

In Continuation Passing Style (CPS), the program is comprised of several continuations. The methods in CPS programming do not return a value, rather, they pass control (including the current context) to the next continuation.

Each continuation receives a context, which stores the state of the current chain of continuations at a given time, and can alter this context and call the next continuation. There can exist different types of continuations too, for handling exceptions, suspending the program, or simply calling other continuations.

In some functional programming languages CPS is supported and can be used in conjunction with tail-call optimization to try to control the call stack size.

Use cases of CPS in Java

Apache Commons contains a component in its sandbox, Apache Commons JavaFlow, that hasn’t been updated in a while, but that supports continuations in Java. It requires the code to be instrumented, and provides ways to restore the execution of the code.

The Jenkins Workflow Plug-in was presented during the Jenkins User Conference 2014 in Boston. The plug-in has several Maven modules, among is the cps Maven module. This maven module provides CPS to the plugin. If you take a look at the team page of the JavaFlow project, you will find it interesting that Kohsuke Kawaguchi (Jenkins creator) is listed there too :-)

From what I could tell, the Jenkins Workflow Plug-in utilizes CPS to break down the workflow execution in several continuations, that are persisted to the disk and can be resumed in case the job execution is interrupted.

There are several differences between the cps module and Apache Commons Javaflow - such that in the latter the running code needs to be instrumented. I haven’t investigated all of them yet, but it sounds very interesting! I’m waiting for one of those rainy weekends so that I can spend many hours reading the code of the two and taking notes.

Final thoughts

CPS is a very interesting concept, and while probably the enterprise Java developer is not going to use it for his every day corporate web application (though some FP programmers might be using it), it is an interesting technique that can probably be applied in some specific scenarios - as it was in the Jenkins Workflow Plug-in.

There are optimizations available for CPS 12 too, so I believe the workflow-plugin has space for more innovation, and lots of fun for hackers.

Happy hacking!

Configurando o Jenkins para usar o Active Directory

Jan 29, 2014 in jenkins | tutorials

Depois de ver algumas mensagens na lista do Jenkins em Português decidir escrever este post para ajudar quem quiser configurar o Jenkins para usar o Microsoft Active Directory.

O Jenkins já possui autenticação e uma base de usuários própria. O que faremos é apenas utilizar o Active Directory (AD) como a base de usuários. Para isso basta instalar o Jenkins Active Directory plugin e reiniciar.

Plug-in do AD

Agora precisamos configurar o Jenkins para acessar o Active Directory. Vá até Gerenciar Jenkins / Configurar Segurança Global e em Controle de Acesso, selecione "Active Directory". Entre o domínio e os dados para se conectar no AD. Caso você não saiba os dados do seu AD, pergunte para alguém de infraestrutura ou tente se conectar ao AD com algum cliente de LDAP.

Configurando o Plug-in

Pronto! Agora basta você escolher o modelo de autorização. Na maioria das vezes utilizo a estratégia baseada em matriz por projeto. Se você utilizar a mesma, adicione o nome de usuário de rede e atribua as permissões corretas.

Espero que ajude, boa diversão!

Add tags to Jenkins builds or export specific builds

Sep 12, 2013 in ideas, jenkins | blog

This idea is from @abayer, from these following tweets:

Tweet 1


Tweet 2

We could simply add tags to builds, and then create some place that would list the builds (or other things) that are tagged appropriately. Or we could add a way to define which builds should be exported to some tool, and then via the plug-in API maybe, post to this external tool.

Jenkins Sao Paulo Meetup promoting material

Aug 27, 2013 in jenkins, events, illustrations | blog

Sao Paulo is going to host the Jenkins Meetup 2013. It is the second time the event occurs, and we bet this year’s event will be even more awesome!

You can help the event by promoting it within your organization, with your friends, family and co-workers. Feel free to use the following banners to help spreading the word about the event.

The event is free but if you are going to attend it, please answer the meetup RSVP. The Call for papers is open too, send your case, tutorial, lighting talk or other suggestions.

Furthermore, let us know if you are interested in sponsoring the event. We have compiled a sponsorship program (PDF).

CodeIgniter application

CodeIgniter application

CodeIgniter application

Add support to Promoted Builds on Build Pipeline Plug-in

Jul 24, 2013 in ideas, jenkins | blog


Jenkins Build Pipeline Plug-in, by Centrum Systems (Australia), is an excellent plug-in, used by many users (over 6000 downloads according to last report).

However, it does not work well with the Jenkins Promoted Builds Plug-in, another great plug-in (over 4100 downloads last month).

It means that users are not able to create pipelines based on promotion (promoted pipelines?). This contribution would be awesome, useful and help a lot of users (maybe over 10000? :-)