lein-control 0.2.1 is out

Tue 01 November 2011
  • ANN tags:
  • clojure
  • project published: true comments: true

I have updated the leiningen plugin for clojure-control 0.2.1. There is no new feature for it as a plugin. But some new features from upstream are supported and should be highlighted:

SSH command DSL

This feature is committed by me and first announced in clojure-control 0.2.1. With this DSL, you can write your SSH command with some predefined macros which is more readable and enjoyable.

For example, an ssh task can be defined as:
[cc lang="clojure"]
(deftask :restart-server "restart your jetty server"
[]
(ssh (cd "/opt/jetty/bin"
(run "./jetty.sh restart"))))
[/cc]

which equals to :
[cc lang="clojure"]
(deftask :restart-server "restart your jetty server"
[]
(ssh "cd /opt/jetty/bin; ./jetty/sh restart"))
[/cc]

For full document of this DSL, please check the README.

Improved syntax for defcluster

ssh/scp/rsync options in defcluster could be written as a vector:
[cc lang="clojure"]
(defcluster :mycluster
:ssh-options "-p 44"
:scp-options "-v"
:rsync-options ["-arz" "--delete"]
:clients [
{ :host "c.domain.com" :user "clogin" :ssh-options "-v -p 43"}
]
:user "login"
:addresses ["a.domain.com" "b.domain.com"])[/cc]
(code quote from official announcement)

Parallel support

Tasks could be executed in parallel if you add option :parallel true on defcluster.

Finally, to use this plugin, add dev-dependency to your project.clj:
[cc lang="clojure"]
:dev-dependencies [[lein-control "0.2.1"]]
[/cc]
More detailed instructions could be found here.

BTW, this is the last release of lein-control as a standalone artifact. I will be working on merging lein-control into clojure-control. Soon you will have a few flexible ways to use clojure-control.