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.
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.
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.
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.
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.
09 April 2016
Older posts are available in the archive.