Writing a Liferay Deployment Script Part 4

21 September 2016

In part 3 of this article we covered using waitFor, fail and exec to handle files. Today we are going to look into using Apache Ant filters to retrieve a password from an existing configuration file and then using the replace task to place the password in a new configuration file. There are a variety of filters available in Ant and I recommend you browse them to gain familiarity. We will be using the tokenfilter and striplinebreaks filter to retrieve our password. Below is an example build file.

Writing a Liferay Deployment Script Part 3

19 September 2016

In the previous two articles we listed our requirements and started exploring how Bash and Apache Ant could help us satisfy them. We ended the last part discussing using the Exec task to run the “tar” command from the operating system. This works well if the target file is present, but what happens if the file is not present? The Ant task will fail with a somewhat cryptic message. Fortunately Ant provides us with the tools to check for the files existence and to fail with a custom error message. Three tasks help us accomplish this goal: echo, waitfor and fail. We have already discussed the echo task. Waitfor and fail both rely on conditions The waitfor task, as its name implies, waits for a condition to be true. Today our condition will be whether or not a file exists. The fail task stops Ant from continuing and prints out a message. Example code below shows how they can be used together.

Writing a Liferay Deployment Script Part 2

16 September 2016

In the previous article we listed requirements that our deployment script needs to meet. The first of these is for it to be possible for the script to run from the command line. This is simple enough as Apache Ant is built for the command line. As I worked on the script it became clear that we would need to pass parameters to Ant to modify its behaviour based on environment. I didn’t want those deploying the application to have to figure out to use Ant. Like any good developer I cheated and decided to use both Bash and Ant.

Liferay: How to Find Current User Permission Algorithm Version

27 April 2016

Recently my workstation was scanned for vulnerabilities and the Nessus scanning software reported a medium vulnerability of “SSH Weak Algorithms Supported”. The Vulnerability report had few details. Luckily I was able to find the folowing resources.

Subversion: Useful Command Line Goodness

21 April 2016

Recently there has been the need for me to revert changes in Subversion and to remove all unversioned files. This requires a few different Linux commands along with some Subversion commands.

Liferay: Internet Explorer (IE) and JSON Mime Type

09 April 2016

After upgrading to Liferay 6.2 we noticed that some of our portlets quit working in IE while still working with Firefox. Specifically those portlets relying on AJAX calls. Turns out, by default, Liferay 6.2 gives a MIME type “text/javascript” to JSON results delivered to IE. Results delivered to Firefox have a MIME type of “application/json”.

Older posts are available in the archive.