Build Tools Quick Start Guide
The following steps provide a quick introduction to the Self-Managed Commerce build tools.
What You Will Do
In this quick start guide, you will do the following:
- Configure a Linux host so it is suitable and ready to run the Self-Managed Commerce build tools.
- Clone the Self-Managed Commerce code repository to the Linux host.
- Configure a Maven
~/.m2/settings.xml
file on the Linux host. - Build the Self-Managed Commerce source code and create the deployment package.
- Build the Self-Managed Commerce base and third-party container images.
- Build the Self-Managed Commerce application container images.
- Start the Self-Managed Commerce application services.
- Observe the results.
- Stop the Self-Managed Commerce application services.
Prerequisite: Linux Host
Set up a Linux host with the below characteristics.
- Using the Amazon Linux 2023 operating system.
- With a minimum of 4 CPUs, 16GB RAM, 50GB disk space, and access to the Internet.
- With a user that has the ability to run commands using
sudo
. - With packages
git
andopenssh
installed. On Amazon Linux 2023, run the commandsudo dnf install openssh git
.
note
Only Amazon Linux 2023 can be automatically configured by the provided tools.
tip
When you complete this quick start guide, the Self-Managed Commerce application services will be running on the Linux host. If you want to access the application URLs, ensure that the Linux host is on a network that you can reach from your web browser.
Prerequisite: Self-Managed Commerce Code
- Verify that you have access to your Self-Managed Commerce code repository, which is typically named
ep-commerce
. For information, see Hosting the Self-Managed Commerce Source Code. - Using the Git command, clone the Self-Managed Commerce code repository to the Linux host.
- Confirm that you are using a branch that includes the Self Managed Cemmerce build tools folder
<ep-commerce>/devops/build_tools
.
note
This document uses the placeholder <ep-commerce>
to represent the path to the Self-Managed Commerce code repository.
Configure the host
The configure_build_host.sh
command will install the necessary packages and perform the necessary configuration so the host is ready to run the Self-Managed Commerce build tools. The configure_build_host.sh
command is intended for use with Amazon Linux 2023.
- Get a Bash prompt on the Linux host as a user with sudo powers.
- Change directory to
<ep-commerce>/devops/build_tools_extras
. - Run the command:
sudo ./configure_build_host.sh
.
For more information, see Configure a Build Host.
Refresh user permissions
Log out and log back in to refresh your user's permissions. This is required for using Docker in later steps.
settings.xml
Configure the Maven The below steps provide an automated way to create the Maven ~/.m2/settings.xml
file on the Linux host. You can also configure it manually.
tip
If you already have a suitable settings.xml
file then you can copy that to the host at ~/.m2/settings.xml
instead of following the below steps.
Steps:
- Obtain your username and password for
repository.elasticpath.com
. If you do not have access, contact your project lead or contact Elastic Path ataccess@elasticpath.com
. - Get a Bash prompt on the Linux host.
- Change directory to
<ep-commerce>/devops/build_tools_extras
. - Run the command:
ansible-playbook -e maven_deployer_user_name='<username>' -e maven_deployer_password='<password>' configure_maven_settings.yml
.- Replace
<username>
and<password>
with your username and password forrepository.elasticpath.com
.
- Replace
For more information about this playbook, see Configure Maven Settings.xml.
Build the Source Code and Create the Deployment Package
- Get a Bash prompt on the Linux host.
- Change directory to
<ep-commerce>/devops/build_tools
. - Run command:
./build_deployment_package.sh
.
For more detail about the command, see Build Deployment Package.
Build the Base and Third-Party Images
- Get a Bash prompt on the Linux host.
- Change directory to
<ep-commerce>/devops/build_tools
. - Run the command:
ansible-playbook build_base_images.yml
.
For more information, see Build Base and Third-Party Images.
Build the Self-Managed Commerce Application Images
- Get a Bash prompt on the Linux host.
- Change directory to
<ep-commerce>/devops/build_tools
. - Run the command:
ansible-playbook build_commerce_images.yml
.
For more information, see Build Application Images.
Start a Containerized Commerce Environment
Complete the below steps to start the containerized services.
- Get a Bash prompt on the Linux host.
- Change directory to
<ep-commerce>/devops/docker_compose
. - Run the following commands:
# Set necessary environment variables
# Note that the image_facts.env file was created by earlier steps.
source /opt/env/image_facts.env
# Start the ActiveMQ service
docker-compose -p ep-commerce -f activemq/docker-compose.yml up -d
# Start the MySQL database service
docker-compose -p ep-commerce -f mysql/docker-compose.yml up -d
# Create and populate the Self-Managed Commerce database
docker-compose -p ep-commerce -f data-pop-tool/docker-compose.yml up
# Start the Self-Managed Commerce services
docker-compose -p ep-commerce -f commerce/docker-compose.yml up -d
For more information, see Running Applications with Docker Compose.
Observe the Results
Inspect the results by running the below Docker commands.
- Run
docker image ls
to vew the container images. - Run
docker ps
to view the running containers.
Browse to the Applications
You can navigate to and access the Self-Managed Commerce applications running on your Linux host.
- Identify your Linux host’s IP address.
- Use your web browser to open Cortex Studio. The URL will be like
http://<your_hosts_ip>:8080/studio/
. For information about Cortex Studio, see Learning to use Cortex Studio. - Use your web browser to open Commerce Manager. The URL will be like
http://<your_hosts_ip>:8081/cm/
and the default login credentials are documented in Starting Commerce Manager. For information about Commerce Manager, see Introduction to Self-Managed Commerce Administration.
Stop the Services
Complete the below steps to stop the services.
- Get a Bash prompt on the Linux host.
- Change directory to
<ep-commerce>/devops/docker_compose
. - Run the following commands:
docker-compose -p ep-commerce -f commerce/docker-compose.yml stop
docker-compose -p ep-commerce -f activemq/docker-compose.yml stop
docker-compose -p ep-commerce -f mysql/docker-compose.yml stop
Quick Start Completed
After completing the above steps you have achieved the following:
- You built the Self-Managed Commerce code.
- You built the Self-Managed Commerce container images.
- You created a Self-Managed Commerce database in a MySQL 8.0 container image.
- You started the Self-Managed Commerce application services on your Linux host.
- You accessed the Self-Managed Commerce application services via your web browser.
- You stopped the Self-Managed Commerce application and related services.