Archive for the ‘Ant’ Category

DataPower Buddy Release 3.4

Posted on 05/30/2018 , Alexander Ananiev,

We're pleased to announce the availability of DataPower Buddy 3.4.

This release provides support for DataPower firmware upgrades, extensive configuration reporting and diffing, DataPower operational analytics and many other features.

Please see release notes for more information.

Download PBuddy 3.4 from this page and follow our Quick Start Guide.

DataPower Buddy Release 3.3

Posted on 06/08/2016 , Alexander Ananiev,

We're pleased to announce the availability of DataPower Buddy 3.3.

New Tasks/Commands and Notable New Feature

  • Support for encrypted properties and configuration settings. This can be used for encrypting DataPower account passwords. It can also be used for encrypting any sensitive data inside DataPower configuration/export files or inside any files that are copied to DataPower using DPBuddy's copy command.
  • PasswordAlias task/command to create DataPower password aliases. The password can be stored encrypted.
  • New format for configuration settings and properties/variables based on the open-source HOCON (Human-Optimized Config Object Notation) library. HOCON is a less restrictive JSON superset geared towards defining configuration settings. HOCON allows for comments, it does not require string quotes, it supports variable substitution and includes. For more details please refer to HOCON documentation. HOCON provides many benefits over the property/prefix-based format introduced in earlier DPBuddy releases. The properties format, however, is still fully supported, migration to HOCON is completely optional.
  • Support for DataPower firmware 7.5
  • Secure restore task/command. The command performs restoration of a secure backup and optionally waits for the completion of the secure restore process. This command can be used for automated sync of multiple appliances in production or for managing disaster recovery appliances.
  • Restore task/command. This command restores multiple domains (or all of the domains in an appliance) form the backup taken by the backup command. This command can also be used for appliance syncing and for DR.
  • RestartDP task/command. This command restarts the appliance and optionally waits for the completion of the restart process.
  • License command that prints DPBuddy's license information.

Configuration Transformation-Related Changes

  • Support for repeaters (loops). Repeaters allow for generating XML fragments in a loop based on an array or an object defined in a HOCON configuration file. For example, you may need to change the definition of a Load Balancer Group depending on the target environment (each environment can have a different number of LBG members). You can define your LBG members in the configuration file and then apply "update" action with "repeat" attribute.
  • "if" expressions are now supported at the "transform" container level (previously "if" was only supported at the action level).
  • "verbose" setting is now supported at the "transform" container and at the individual transformation action levels.
  • Improved logging of transformed element names.
  • Support for local Ant properties in Groovy expressions.
  • "antProject" is now part of the scope in all Groovy expressions.
  • Passwords are now automatically masked in all transformation logs (including verbose mode).

Changes to Existing Tasks/Commands

  • Import, copy and restore commands now stream files to DataPower, which speeds up file transfer and allows for supporting large files. Previously, DPBuddy loaded files in memory prior to import/copy.
  • Export task/command now supports sorting of the exported XML configuration file. DPBuddy will sort all DataPower configuration objects alphabetically according to their names and types. This feature can be used to make tracking of DataPower configuration changes easier since DataPower sometimes re-orders objects in the exported configuration.
  • Import task/command can now re-run import automatically in case of import errors. This feature should be enabled when importing the sorted configuration file created by the export command. DataPower requires configuration objects to be defined prior to being referenced at import. With the sorted export file, this is no longer the case, hence the import may need to be run twice.
  • Export command now automatically removes "export-manifest" from the exported xml files (can be controlled by the "defaultTransorm" option).
  • Import now supports "failOnError" option/attribute.
  • More efficient mkdir task/command -- a directory tree is now created in a single request.
  • assertState now prints error code/error description for objects in the "down" state.
  • Improved CLI help.
  • For DPBuddy CLI, config files can now reside in "/etc" directory.

To upgrade to this release, you can simply download and un-archive the distribution and point your DPBUDDY_HOME environment variable to the new location. If you're using DPBuddy from Apache Ant, you will also need to add <pathelement location="${dpbuddy.home}/conf"/> to the DPBuddy library's "taskdef" in your Ant files, otherwise, you will see verbose logging output in the console.

You can download DPBuddy 3.3 from this page.

DPBuddy Release 3.2.4 (Improved Auditing)

Posted on 10/12/2015 , Alexander Ananiev,

We're pleased to announce that DataPower Buddy 3.2.4 is now available. The focus of this release is on improved audit and logging.

DPBuddy now generates an audit log file in JSON format, in addition to the XML format supported in earlier releases. This file can be easily tailed, analyzed with jq and/or uploaded to an enterprise SIEM tool. DPBuddy now uses logback framework for auditing and logging. This provides a lot of flexibility in configuring log file location, rollover policies, appenders and other parameters.

Other new features include:

  • DPBuddy now captures import failures in the audit log.
  • backup command now supports the new option/attribute, "failIfNoDomain". If set to "false", "backup" will not fail if the target domain does not exist.
  • Better error handling. A root cause of an error now reported automatically, without having to run the tool in verbose mode.
  • Bug fixes.

To upgrade to this release, you can simply download and un-archive the distribution and point your DPBUDDY_HOME environment variable to the new location. If you're using DPBuddy from Apache Ant, you will also need to add <pathelement location="${dpbuddy.home}/conf"/> to the DPBuddy library's "taskdef" in your Ant files, otherwise, you will see verbose logging output in the console.

You can download DPBuddy 3.2.4 from this page.

DataPower Buddy Release 3.2-Beta

Posted on 12/10/2014 , Alexander Ananiev,

We're pleased to announce that DPBuddy 3.2-beta is now available. The main feature of this release is the ability to execute any DPBuddy task or command against multiple devices and/or domains. Simply define the URLs of your devices using environment properties and supply a list of environment prefixes to a command or an Ant task:

dpbuddy import -file services.zip -env "dev,test"

DPBuddy will execute the command against all the devices in the list, and, in case of any errors, it would optionally rollback either just the failed domains or all the devices/domains in the list.

You can find more details in the DPBuddy documentation.

Other new features include:

The release also contains several important bug fixes.

The general availability of DPBuddy 3.2 is expected in January 2015. Meanwhile, please let us know if you're interested in becoming part of our beta program.

Using Eclipse for DataPower Development

Posted on 03/01/2014 , Alexander Ananiev,

If you're using Eclipse for developing IBM WebSphere DataPower artifacts (xslt, schemas, etc.) you can easily configure DPBuddy to automatically copy your artifacts to the appliance and do various other chores. All you need to do is to define an Ant file with DPBuddy tasks and configure the Ant file as a builder for your project.

You can find the detailed steps for configuring Eclipse and DPBuddy here.

What is the Best Tool to Replace Ant With?

Posted on 03/30/2013 , Alexander Ananiev,

At this day and age there is no reason to continue using Ant. Ant was a great tool for its time but this time has passed.

There are basically three build tools that can replace Ant: Maven, gradle and Buildr.

It is important to be able to continue using existing Ant scripts and custom tasks alongside the new tool. There is a multitude of useful open-source custom Ant tasks and with Ant being a de-facto standard for years, many development shops built vast libraries of Ant scripts and custom tasks.

Out of all three, Gradle has the best integration with Ant. It allows for using existing custom Ant tasks pretty much without any changes. It also allows for importing Ant scripts into Gradle build script. Gradle tasks can even depend on Ant targets (and vice versa). There is also easy access to Ant properties.

(more…)

Using Auto-complete in Eclipse Ant Editor for DPBuddy Tasks

Posted on 09/22/2012 , Alexander Ananiev,

Many developers utilize Eclipse for editing Ant files. Ant editor in Eclipse is fairly powerful, this article provides a good overview of its capabilities.

One of the most useful features is auto-complete for Ant tasks. Just press Ctrl-space and you'll see all attributes and nested elements supported by the task.

Auto-complete comes very handy when working with DPBuddy Ant tasks (and for developing WebSphere DataPower-related artifacts in general).

Just type '<dp:' (assuming that this is the prefix you assigned to DPBuddy's antlib) and then Ctrl-space and you'll see the list of all DPBuddy's tasks. Pressing Ctrl-space anywhere after the name of the task shows the list of attributes or nested elements.

Using auto-complete to see list of attributes for dpimport

Unfortunately, auto-complete won't display help for custom tasks. Apparently description of Ant tasks is embedded inside Eclipse and does not seem to be extendable.

DataPower Buddy 2.2.2 Release

Posted on 05/30/2011 , Alexander Ananiev, 2 Comments ( Add )

DataPower Buddy 2.2.2 is available from this link. This release contains several bug fixes, mostly around "import" Ant task.

MyArch, Inc. offers paid support for dpbuddy, including implementing custom enhancements. If you're interested, please contact us as info at myarch.com.

PAnt 2.0.1 is Released

Posted on 03/27/2010 , Alexander Ananiev, 1 Comment ( Add )

PAnt 2.0.1 contains an important bug fix that was preventing using certain Ant tasks from python. Specifically, the bug affected all tasks that utilize addConfigured method to handle nested elements. This included the "manifest" task and several others.

You can download PAnt 2.0.1 from the PAnt project page

PAnt Documentation Has Been Updated

Posted on 11/30/2009 , Alexander Ananiev,

We've just updated PAnt documentation to reflect changes implemented in PAnt 2.0. There are two significat changes:

You can follow this guide to get started with PAnt.

Creating Ant Targets in Python with PAnt 2.0

Posted on 11/10/2009 , Alexander Ananiev,

We've just released a new version of PAnt, a tool for developing build scripts in python. The key new feature of PAnt 2.0 is the ability to create Ant targets directly from python. This allows for completely getting rid of Ant XML files and for developing build scripts entirely in Python.

Here is an example:
@target(unless="prop.name", depends=ptarget1)
def p_target2():
"""Python project ptarget2"""
ant.echo("echo ptarget2")

You can find more details about creating targets from PAnt here.

PAnt 1.5 is Released

Posted on 07/13/2009 , Alexander Ananiev,

This is a major update to our popular python Ant wrapper.

Notable changes in this release:

  • Support for positional (as opposed to named) arguments, e.g., “pant.echo(‘message’)”.
  • Support for lists to express repeating elements.
  • Support for “ant_” prefix to avoid conflicts with python keywords.

More information is available from PAnt project page

Please subscribe to our feed or follow us on twitter to continue receiving updates about PAnt – new version is coming shortly.

Dynamic Ant Tasks without Setters

Posted on 03/24/2009 , Alexander Ananiev,

Ant uses reflection to pass data from XML to the Java class that implement an Ant task. For every attribute in XML, you have to define a setter in the Java task’s class.

This works fine most of the time, however, in some cases there could be a need for a dynamic list of attributes. For example a task can pass attribute values to some external tool that has its own set of parameters that you don’t want to hardcode in Ant. Or you may simply like the flexibility of using dynamic attributes as opposed to predefined setters.

In order to implement dynamic attributes, first you need to override “maybeConfigure” method in your Ant task and have it do nothing:

public void maybeConfigure() throws BuildException {
}

Then in your “execute” method you can access the map of attributes (that represents all attributes set in XML) as follows:

RuntimeConfigurable configurator= getRuntimeConfigurableWrapper();
Map attributes=configurator.getAttributeMap();
String attr1=(String)attributes.get("attr1");

Note that in this case Ant does not do property substitution (for ${}), so you would need to explicitly invoke project.replaceProperties for each attribute value.

Using Jython 2.2.1 with WSAdmin Tool

Posted on 02/05/2009 , Alexander Ananiev, 3 Comments ( Add )

In one of the previous posts I complained that wsadmin tool (which is the main WebSphere Application Server administration tool) still relies on Jython 2.1, which is quite old.

The issue became critical when I realized that jython automatically re-compiles classes compiled with a different jython version. In my case, I was using Jython 2.2 for my Ant scripts and Jython 2.1 for wsadmin scripts. Some of the code was shared. This led to the situation of concurrent builds stepping on each other by dynamically re-compiling classes with different jython versions. The error looked something like that:


File "<string>", line 5, in ?
java.lang.ArrayIndexOutOfBoundsException: -4
at org.python.core.imp.createFromPyClass(Unknown Source)

Bugs like that are always fun to troubleshoot.

Going back to 2.1 was not an option for me since I use closures and “new classes” in quite a few places. So I tried putting jython 2.2.1 on wsadmin classpath and it worked without a hitch with thin wsadmin client. All my of wsadmin scripts work without a problem.

Here is a sample wsadmin.bat file that I use. This file utilizes thin client jars. Note how in line 85 my jython.jar (which is jython 2.2.1) is added to the classpath so it would override jython packages supplied with WAS.

One possible downside of this approach is running into issues with IBM support in case if you need to open a PMR related to wsadmin scripting.

Updated Jython Ant Task

Posted on 10/12/2008 , Alexander Ananiev, 1 Comment ( Add )