Maven Scripts
The Self-Managed Commerce build tools include Maven shell scripts that can perform Self-Managed Commerce builds and run Self-Managed Commerce tests.
Prerequisite: Configure the Build Environment
The scripts are designed to be run in an suitably configured environment. For more information, see Configure the Build Environment.
General Usage
For each of the Maven scripts, the basic usage is the same.
- Establish a shell session on the build host.
- Clone the Self-Managed Commerce source code project
ep-commerce
from your organization Git repository. - Checkout the
ep-commerce
branch that you want to build. - Change directory to
devops/build_tools
. - Invoke the script.
Build Deployment Package
The devops/build_tools/build_deployment_package.sh
shell script is used to build the Self-Managed Commerce source code and create the deployment package Zip file.
# Build the source tree and deployment package.
# The resulting artifacts will exist locally in the build environment.
cd devops/build_tools
./build_deployment_package.sh
Output
After the script completes, the deployment package Zip file can be found under extensions/packager/ext-deployment-package/target/
.
tip
For information about the relationship between the Self-Managed Commerce application images, the base images, and the deployment package, see Self-Managed Commerce Deployment Artifacts.
Script options
Additional options are available that allow you to control the behaviour of the script.
Deploying artifacts to a remote repository
By default, the build_deployment_package.sh
shell script create artifacts in the local Maven repository. If you are intending to deploy artifacts to a remote Maven repository, use the --deploy
option:
# Build the source tree and deployment package with the deploy option.
# The resulting artifacts are also deployed to the repository manager (eg: Sonatype Nexus)
cd devops/build_tools
./build_deployment_package.sh --deploy
note
Deploying artifacts to a remote Maven repository requires a suitably configured Maven settings.xml configuration file on the build host.
Run Extensions Tests
Use the included devops/build_tools/run_extensions_tests.sh
shell script to build the Self-Managed Commerce source code and run Commerce extensions tests in a single operation.
# Simple Usage
cd devops/build_tools
./run_extensions_tests.sh
Script options
Additional options are available that allow you to control the behaviour of the script.
Fail immediately upon first test failure
By default, the run_extensions_tests.sh
script will report failures at the end of the test process. If you would like the script to exit immediately when a test failure occurs, use the --fail-fast
option:
# The script will exit with an error after the first test failure
cd devops/build_tools
./run_extensions_tests.sh --fail-fast