Local Mock Setup Guide in AS
Local Mock Setup Guide
Follow the steps below to set up your local mock environment efficiently.
β 1. Prerequisites
- Install Java 17 and Maven.
- Set environment variables for both
javaandmvn. - Install Docker Rancher (Rancher Desktop).
π§ 2. Rancher Desktop Configuration
Open Rancher Desktop and make the following adjustments:
-
Navigate to:
Preferences β Kubernetesβ UncheckEnable Kubernetes. -
Go to:
Preferences β Container Engineβ Selectdockerd (moby). -
Download the image:
rancher/socat-dockerfrom Docker Hub. -
Run the following command in your CLI:
docker container run -dt --name expose-docker-on-2375 \ --network=host -v /var/run/docker.sock:/var/run/docker.sock \ --restart=always rancher/socat-docker
β
Verify that the rancher/socat-docker container is running in Rancher Desktop.
π 3. Project Cloning and Building
-
Create a new folder and save the attached PowerShell script (
git-clone-and-build.ps1) inside it. -
Open PowerShell from that folder.
-
Run the script:
.\git-clone-and-build.ps1This will clone and build all required projects except as-processes. The process may take a couple of hours.
π³ 4. Running Docker Services
After the build completes, navigate to the as-mock-server\etc\docker\ directory:
Run External Services:
cd as-mock-server\etc\docker\
docker-compose -f docker-compose-local.yml up
β Confirm services are running in Rancher Desktop.
Run Internal Services:
cd as-mock-server\etc\docker\
docker-compose -f docker-compose-local-services.yml up
β Again, verify that all services are up and running.
π‘ Alternative: Using JetBrains IntelliJ IDEA
You can run the Docker services directly via IntelliJ IDEA:
-
Open the project:
as-mock-server. -
Navigate to:
etc/docker/docker-compose-local.ymlβ Run external services.etc/docker/docker-compose-local-services.ymlβ Run internal services.
-
Monitor the IDE logs with the keyword:
Started ApplicationThis confirms each service is up and running.
π Note: Some services may take time due to dependencies.
π οΈ Additional Notes
- For
as-process, use themainbranch, not specific branch to avoid Java 17-specific errors. - If a specific service fails, navigate into that serviceβs folder and build it manually.
- To simplify frequent builds, configure PowerShell functions like
build,buildFrontEnd, etc.
Microsoft.PowerShell_profile.ps1
β‘οΈ Save the profile script at:
C:\Users\<your-username>\OneDrive - Wiley\Documents\WindowsPowerShell\
π Use the following command in PowerShell to find the correct path on your system:
$PROFILE
UPDATE: Use as-fd-app branch β stable/as-freeze branch and build. and use as-fd-frontend β master_backup and build with buildFrontend
NOTE: When you finish your work, remember to down Docker each time to maintain local mock consistency and ensure everything works correctly.
Happy Coding! π‘