Local Mock Setup Guide in AS

Instructions

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 java and mvn.
  • Install Docker Rancher (Rancher Desktop).

πŸ”§ 2. Rancher Desktop Configuration

Open Rancher Desktop and make the following adjustments:

  1. Navigate to:

    Preferences β†’ Kubernetes β†’ Uncheck Enable Kubernetes.

  2. Go to:

    Preferences β†’ Container Engine β†’ Select dockerd (moby).

  3. Download the image:

    rancher/socat-docker from Docker Hub.

  4. 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

  1. Create a new folder and save the attached PowerShell script (git-clone-and-build.ps1) inside it.

  2. Open PowerShell from that folder.

  3. Run the script:

    .\git-clone-and-build.ps1
    

    This will clone and build all required projects except as-processes. The process may take a couple of hours.

Clone Repository Script

Smart Parallel Initial Build


🐳 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:

  1. Open the project: as-mock-server.

  2. Navigate to:

    • etc/docker/docker-compose-local.yml β†’ Run external services.
    • etc/docker/docker-compose-local-services.yml β†’ Run internal services.
  3. Monitor the IDE logs with the keyword:

    Started Application

    This confirms each service is up and running.

πŸ•’ Note: Some services may take time due to dependencies.


πŸ› οΈ Additional Notes

  • For as-process, use the main branch, 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! πŸ’‘

Β© 2026 Viraj Konthasinghe. All rights reserved.
Developed by:  Ceylon Code Labs