Gradle tasks and dependency configurations
This section details the Gradle tasks available for building, testing, and deploying your ALFA project, as well as the dependency configurations used to manage external libraries. Understanding these tasks and configurations is crucial for efficiently managing your ALFA project's lifecycle.
Tasks
You can execute the following Gradle tasks from your IDE, the command line, or a build automation tool like Jenkins or Azure DevOps.
| Task | Description |
|---|---|
buildAuthzDomain | Compiles the authorization domain into a single YAML file (build/alfa/ads/domain.yaml) suitable for uploading to ADM or providing to ADS. |
compileAlfa | Compiles all ALFA policies to XACML and writes the output to build/alfa/domain/xacmlSpecifications. |
compileAlfaToPackage | Compiles all ALFA policies to XACML and bundles them into a policy package (build/alfa/domain/package/policy_package.zip), which you can upload to Axiomatics Services Manager (ASM). |
stageDeployment | Prepares the ADS deployment within the build/install/deployment directory. This deployment package includes the ADS binaries, domain.yaml, deployment.yaml, the software license, and custom attribute connectors. This directory serves as the build context root directory for creating a container image using tools such as Docker, Buildah, Podman, Kaniko, or Buildkit. |
runAds | Runs the latest ADS locally using the authorization domain from src/ and the deployment descriptor from deployment.yaml. NOTE: You need a valid software license in license/ to run ADS.Press Ctrl+C to stop the service.IMPORTANT: Structure the deployment.yaml file according to the DomainOpens in a new tab section of the latest Access Decision Service documentation. |
test | Runs all unit, integration, and system tests and generates test reports in build/reports/tests/. The reports indicate which tests passed or failed and provide output and stack traces. |
Build a container image with ADS
Axiomatics Policy DevOps (APD) does not include a task for building a container image with latest ADS binaries. Instead, use the stageDeployment task to prepare the build context in the build/install/deployment directory.
Once prepared, call your preferred image build tool to create the image. The /Dockerfile will be automatically copied into this build context directory. Tailor it to your needs if needed.
Dependency configurations
Gradle's dependency configurations manage the classpath for different tasks. The following configurations help manage dependencies for your ALFA project:
| Configuration | Description |
|---|---|
pip | Add any extra attribute connector dependencies. This configuration already includes Axiomatics' Table, SQL, LDAP, HTTP, and Parser attribute connectors. |
testImplementation | Add any additional dependencies required for executing tests. |
adsCompile | Add any extra dependencies needed for compilation. |
policy | Include any external ALFA policies. |
To add a dependency, use the following syntax in your build.gradle file:
dependencies {
pip '<group>:<name>:<version>'
}