...
Excerpt |
---|
Cargo provides Ant tasks to perform all the operations available from the Java API. The minimum required version is ANT 1.7.0supported version is Ant 1.9.15. |
Note |
---|
title | Security issues with older versions of Apache Ant |
---|
|
As documented in CVE-2020-1945, Apache Ant versions 1.1 to 1.9.14 and 1.10.0 to 1.10.7 use the default temporary directory identified by the Java system property java.io.tmpdir for several tasks and may thus leak sensitive information. Moreover, the fixcrlf and replaceregexp tasks copy files from the temporary directory back into the build tree allowing an attacker to inject modified source files into the Codehaus Cargo container configuration generation process, a security issue still existing in Apache Ant 1.9.15 and 1.10.8. Last but not least, Apache Ant versions up to 1.9.15 / 1.10.10 suffer from an issue where a specially crafted ZIP or TAR file can make the associated libraries allocate very large amounts of memory (and cause a JVM crash, as explained in CVE-2021-36373 and CVE-2021-36374). We hence strongly recommend only using Apache Ant version 1.9.16 and above (if you need to stick to the Apache Ant 1.9.x branch), or Apache Ant version 1.10.11 and above in general. |
Info |
---|
|
The usage of Cargo for executing functional tests on a container does not mandate these ANT Ant tasks. You could directly use the Cargo Java API from your Java unit test classes (JUnit, TestNG, etc), as described on the Functional testing page. |
...
Some additional dependencies might also be required for the ANT Ant task. Please see the Installation page for details.
The Cargo
...
Ant tasks in detail
Here are the different task actions available to call on this plugin:
Action | Description |
---|
start
| Start a container. That task will: - If the task configuration requires so, installs the container.
- If the task the task configuration defines a container with a standalone local configuration, it will create the configuration.
- If the task the task configuration contains one or more deployables, it will deploy these to the container automatically.
- And, of course, start the container.
Note: A container that's started with the start task will automatically shut down as soon as the parent ANT Ant instance quits (i.e., you see a BUILD SUCCESSFUL or BUILD FAILED message). If you want to start a container and perform manual testing, see our next task run . |
run
| Start a container and wait for the user to press CTRL + C to stop. That task will: - If the task the task configuration requires so, installs the container.
- If the task the task configuration defines a container with a standalone local configuration, it will create the configuration.
- If the task the task configuration contains one or more deployables, it will deploy these to the container automatically.
- And, of course, start the container and wait for the user to press
CTRL + C to stop.
|
stop
| Stop a container. |
restart | Stop and start again a container. If the container was not running before calling calling restart , it will simply be started. |
configure
| Create the configuration for a local container, without starting it. Note that the start and run actions will also install the container automatically. |
daemon-start | Start a container using the Cargo Daemon. |
daemon-stop | Stop a container using the Cargo Daemon. |
deploy
| Deploy a deployable to a running container. |
undeploy
| Undeploy a deployable from a running container. |
redeploy
| Undeploy and deploy again a deployable. If the deployable was not deployed before calling calling redeploy , it will simply be deployed. |
...
Info |
---|
title | Wait after the container has started |
---|
|
Many wonder the difference between the start and run actions: - If you want to just start the container and then do other tasks (for example, execute tests), use the
start action. That action should therefore ONLY be used for integration testing. - If you want start the container and have ANT Ant "blocked" afterwards (i.e., until you press
CTRL + C to stop), use the run action. run is therefore the action to use for manual testing.
|
Include Page |
---|
| Ant Tasks Reference Guide |
---|
| Ant Tasks Reference Guide |
---|
|
Examples
...
Info |
---|
title | Loading configuration properties from a file |
---|
|
It is also possible to load the configuration properties from a file - simply use the the propertiesFile attribute of the the configuration XML element. |
...
For more details, please check the example in the Remote Container section for the ANT Ant tasks. The ANT Ant tasks support the deployer actions deploy
, undeploy
and redeploy
.