Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
97ed08e
Creating geopode-adapter service
tanishi-egov Apr 24, 2025
1756afe
Creating geopode-adapter service - Hierarchy setup
tanishi-egov Apr 25, 2025
e466dc6
Boundary fetch
abishekTa-egov May 26, 2025
0349a20
Arcgis endpoint and mdms request
abishekTa-egov May 26, 2025
29dd8ee
Resolving comments
abishekTa-egov May 30, 2025
b537778
Resolving comments
abishekTa-egov Jun 3, 2025
a54b2a2
Resolving comments changes
abishekTa-egov Jun 4, 2025
2b78f85
Creating ChildBoundaryCreationUtil
abishekTa-egov Jun 4, 2025
67629de
Working ChildBoundaryCreationUtil with logs
abishekTa-egov Jun 5, 2025
a820400
Response of createRoot with logs
abishekTa-egov Jun 5, 2025
e615915
Removing logs
abishekTa-egov Jun 5, 2025
6ff6999
Making from local to unified-dev
abishekTa-egov Jun 6, 2025
b3e4a86
Build-config for geopode
abishekTa-egov Jun 9, 2025
fff7160
arcgis endpoint being made into two
abishekTa-egov Jun 10, 2025
f6bab09
Chnaging context path
abishekTa-egov Jun 10, 2025
280d263
Validation change
abishekTa-egov Jun 10, 2025
5680190
Logging number of children
abishekTa-egov Jun 11, 2025
e51c50e
Resolving comments
abishekTa-egov Jun 11, 2025
998eb68
Adding comments for method createChildrenAsync
abishekTa-egov Jun 11, 2025
c0a9f44
Adding comments for method createChildrenAsync
abishekTa-egov Jun 11, 2025
ca9a676
Logging statements
abishekTa-egov Jun 12, 2025
cdd6799
Duplicate countries not being allowed in same HierarchyType
abishekTa-egov Jun 13, 2025
9f57dcc
Adding @Autowired
abishekTa-egov Jun 13, 2025
a3b33df
Formatting and Adding Service constants for Arcgis Search
abishekTa-egov Jun 24, 2025
44a6264
Removing searchBoundaryHierarchyDefinition from GeopodeAdapterService
abishekTa-egov Jun 24, 2025
b8be666
Moving SearchBoundary to ArcgisUtil
abishekTa-egov Jun 26, 2025
4581683
Removing unnecessary properties in application.properties
abishekTa-egov Jun 26, 2025
f4269ed
BoundaryResponse and function to mdmsUtil
abishekTa-egov Jun 26, 2025
870d1e9
Moving functions to MdmsUtil for extractCountryNameFromMDms
abishekTa-egov Jun 26, 2025
efda0c7
Adding changes for Multi-Architecture Docker Images
RajeswariGangula-egov Jun 26, 2025
2d0915b
Merge pull request #1638 from RajeswariGangula-egov/MULTI-ARCH-GEOPODE
Priyanka-eGov Jun 26, 2025
0283163
Formatting changes
abishekTa-egov Jul 1, 2025
9c61dfd
Formatting, removing unneccesary api paths and adding error constants
abishekTa-egov Jul 1, 2025
d07eb57
Merge branch 'HCMPRE-2709-modified' of github.com:egovernments/health…
abishekTa-egov Jul 1, 2025
3df9d49
tenantId coming from user not ServiceConstants
abishekTa-egov Jul 1, 2025
5fe1cee
Adding List of List of dataStructure and adding Object for parentList…
abishekTa-egov Jul 9, 2025
8d1edb3
Removing generated date
abishekTa-egov Jul 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
223 changes: 223 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
name: Build Pipeline

on:
workflow_dispatch:
inputs:
service_folder:
description: 'Folder prefix for the service'
required: true
type: choice
options:
- core-services
- health-services
default: core-services
service:
description: 'Name of the service to build and deploy'
required: true
type: choice
options:
- "mdms-v2"
- "audit-service"
- "boundary-service"
- "build"
- "chatbot"
- "docs"
- "egov-accesscontrol"
- "egov-common-masters"
- "egov-data-uploader"
- "egov-document-uploader"
- "egov-enc-service"
- "egov-filestore"
- "egov-idgen"
- "egov-indexer"
- "egov-localization"
- "egov-location"
- "egov-mdms-service"
- "egov-notification-mail"
- "egov-notification-sms"
- "egov-otp"
- "egov-persister"
- "egov-pg-service"
- "egov-searcher"
- "egov-telemetry"
- "egov-url-shortening"
- "egov-user-event"
- "egov-user"
- "egov-workflow-v2"
- "gateway"
- "internal-gateway-scg"
- "internal-gateway"
- "libraries"
- "national-dashboard-ingest"
- "national-dashboard-kafka-pipeline"
- "nlp-engine"
- "pdf-service"
- "report"
- "service-request"
- "tenant"
- "user-otp"
- "xstate-chatbot"
- "zuul"
- "geopode-adapter"
default: "audit-service"

env:
DOCKER_USERNAME: ${{ vars.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_ACCESS_TOKEN }}

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
service: [ "${{ github.event.inputs.service }}" ]

outputs:
docker_image: ${{ steps.save_docker_image.outputs.docker_image }}
db_image: ${{ steps.save_db_image.outputs.db_image }}

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Install yq
run: |
VERSION="4.30.8"
URL="https://github.com/mikefarah/yq/releases/download/v${VERSION}/yq_linux_amd64"
sudo curl -sSL "$URL" -o /usr/local/bin/yq
sudo chmod +x /usr/local/bin/yq

- name: Determine Dockerfile path from build-config.yml
id: pick_dockerfile
run: |
SERVICE="${{ matrix.service }}"
DEFAULT_DOCKERFILE="build/maven/Dockerfile"

# Debug: list all image-name / dockerfile pairs
echo "All build entries from build-config.yml:"
yq eval '.config[].build[] | "✱ image-name: \(.["image-name"]) → dockerfile: \(.dockerfile // "N/A")"' build/build-config.yml || true

# Try matching with the SERVICE variable directly (no strenv)
DF=$(yq eval ".config[].build[] | select(.\"image-name\" == \"${SERVICE}\") | .dockerfile // \"\"" build/build-config.yml)

if [ -z "$DF" ] || [ "$DF" = "null" ]; then
echo "No dockerfile entry found for \"$SERVICE\" in build-config.yml; using default"
DF="$DEFAULT_DOCKERFILE"
else
echo "Found dockerfile \"$DF\" for service \"$SERVICE\"."
fi

echo "dockerfile_path=$DF" >> "$GITHUB_OUTPUT"
echo "DOCKERFILE_PATH=$DF" >> "$GITHUB_ENV"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker Layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ matrix.service }}-${{ github.ref_name }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}

- name: Generate the Next Tag
id: tag
run: |
set -euxo pipefail

BRANCH="${GITHUB_REF##*/}"
COMMIT_HASH=$(git rev-parse --short HEAD)
SERVICE_NAME="${{ matrix.service }}"

TOKEN=$(curl -s -X POST "https://hub.docker.com/v2/users/login/" \
-H "Content-Type: application/json" \
-d "{\"username\": \"$DOCKER_USERNAME\", \"password\": \"$DOCKER_PASSWORD\"}" \
| jq -r .token)

if [ -z "$TOKEN" ]; then
echo "Failed to authenticate with Docker Hub." >&2
exit 1
fi

REPO_CHECK=$(curl -s -o /dev/null -w '%{http_code}' \
-H "Authorization: JWT $TOKEN" \
"https://hub.docker.com/v2/repositories/$DOCKER_USERNAME/$SERVICE_NAME/")

if [ "$REPO_CHECK" -ne 200 ]; then
NEXT_TAG="${BRANCH}-${COMMIT_HASH}"
else
EXISTING_TAGS=$(curl -s -H "Authorization: JWT $TOKEN" \
"https://hub.docker.com/v2/repositories/$DOCKER_USERNAME/$SERVICE_NAME/tags?page_size=100" \
| jq -r '.results[].name')
LATEST_TAG=$(echo "$EXISTING_TAGS" | grep "^${BRANCH}-${COMMIT_HASH}" || true | sort -V | tail -n 1)
NEXT_TAG="${LATEST_TAG:-${BRANCH}-${COMMIT_HASH}}"
fi

echo "tag=$NEXT_TAG" >> "$GITHUB_OUTPUT"
echo "NEXT_TAG=$NEXT_TAG" >> "$GITHUB_ENV"

- name: Build and Push Application Docker Image
id: build_push_docker
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: .
file: ${{ env.DOCKERFILE_PATH }}
push: true
tags: |
egovio/${{ matrix.service }}:${{ steps.tag.outputs.tag }}
build-args: |
WORK_DIR=${{ github.event.inputs.service_folder }}/${{ matrix.service }}

- name: Check if DB folder exists
id: check-db-folder
run: |
FOLDER_PATH="${{ github.event.inputs.service_folder }}/${{ matrix.service }}/src/main/resources/db"
if [ -d "$FOLDER_PATH" ]; then
echo "folder_exists=true" >> "$GITHUB_OUTPUT"
else
echo "folder_exists=false" >> "$GITHUB_OUTPUT"
fi

- name: Build and Push Database Docker Image
if: ${{ steps.check-db-folder.outputs.folder_exists == 'true' }}
id: build_push_db_docker
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: ${{ github.event.inputs.service_folder }}/${{ matrix.service }}/src/main/resources/db
file: ${{ github.event.inputs.service_folder }}/${{ matrix.service }}/src/main/resources/db/Dockerfile
push: true
tags: |
egovio/${{ matrix.service }}-db:${{ steps.tag.outputs.tag }}

- name: Save Application Docker Image
id: save_docker_image
run: |
IMG="egovio/${{ matrix.service }}:${{ steps.tag.outputs.tag }}"
echo "$IMG"
echo "docker_image=$IMG" >> "$GITHUB_OUTPUT"

# Append to GitHub Actions summary
echo "### Application Docker Image" >> "$GITHUB_STEP_SUMMARY"
echo "$IMG" >> "$GITHUB_STEP_SUMMARY"

- name: Save Database Docker Image
id: save_db_image
if: ${{ steps.check-db-folder.outputs.folder_exists == 'true' }}
run: |
IMG="egovio/${{ matrix.service }}-db:${{ steps.tag.outputs.tag }}"
echo "$IMG"
echo "db_image=$IMG" >> "$GITHUB_OUTPUT"

# Append to GitHub Actions summary
echo "### Database Docker Image" >> "$GITHUB_STEP_SUMMARY"
echo "$IMG" >> "$GITHUB_STEP_SUMMARY"
31 changes: 12 additions & 19 deletions build/17/maven/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@

FROM egovio/amazoncorretto:17-alpine3.19 AS build
# FROM egovio/alpine-maven-builder-jdk-8:1-master-NA-6036091e AS build
#FROM ghcr.io/egovernments/alpine-maven-builder-jdk-8:1-master-na-6036091e AS build
FROM maven:3.9.6-amazoncorretto-17 AS build
ARG WORK_DIR
WORKDIR /app

# Install Maven
RUN apk add --no-cache maven

# copy the project files
# Copy project files
COPY ${WORK_DIR}/pom.xml ./pom.xml
COPY build/maven/start.sh ./start.sh

# not useful for stateless builds
# RUN mvn -B dependency:go-offline

COPY ${WORK_DIR}/src ./src
RUN mvn -B -f /app/pom.xml package


# Create runtime image
#FROM egovio/8-openjdk-alpine
#FROM ghcr.io/egovernments/8-openjdk-alpine:latest
FROM egovio/amazoncorretto:17-alpine3.19
# Build the project
RUN mvn -B -f /app/pom.xml package

# Runtime image – using a multi-arch base image
FROM amazoncorretto:17-alpine

WORKDIR /opt/egov

# Copy artifacts from the build stage
COPY --from=build /app/target/*.jar /app/start.sh /opt/egov/

RUN chmod +x /opt/egov/start.sh
# Ensure the start script has correct line endings and is executable
RUN dos2unix /opt/egov/start.sh && chmod +x /opt/egov/start.sh

# Verify architecture inside the container
RUN uname -m

CMD ["/opt/egov/start.sh"]
5 changes: 5 additions & 0 deletions build/build-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ config:
dockerfile: "build/17/maven/Dockerfile"
- work-dir: "core-services/egov-idgen/src/main/resources/db"
image-name: "health-idgen-db"
- name: "builds/health-campaign-services/health-services/geopode-adapter"
build:
- work-dir: "health-services/geopode-adapter"
image-name: "geopode-adapter"
dockerfile: "build/17/maven/Dockerfile"
# frontend
- name: builds/health-campaign-services/frontend/workbench-ui
build:
Expand Down
35 changes: 16 additions & 19 deletions build/maven/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@

FROM egovio/alpine-maven-builder-jdk-8:1-master-NA-6036091e AS build
#FROM ghcr.io/egovernments/alpine-maven-builder-jdk-8:1-master-na-6036091e AS build
# ──────────────── BUILD STAGE ────────────────
FROM maven:3.9.6-amazoncorretto-8-debian AS build
ARG WORK_DIR
WORKDIR /app

# copy the project files
COPY ${WORK_DIR}/pom.xml ./pom.xml
COPY build/maven/start.sh ./start.sh

# not useful for stateless builds
# RUN mvn -B dependency:go-offline

COPY ${WORK_DIR}/src ./src
RUN mvn -B -f /app/pom.xml package

# Copy POM, entrypoint script, and source
COPY ${WORK_DIR}/pom.xml ./pom.xml
COPY build/maven-java8/start.sh ./start.sh
COPY ${WORK_DIR}/src ./src

# Create runtime image
FROM egovio/8-openjdk-alpine
#FROM ghcr.io/egovernments/8-openjdk-alpine:latest
# Build the app (skip tests for speed)
RUN mvn -B -f pom.xml package -DskipTests


# ─────────────── RUNTIME STAGE ───────────────
FROM openjdk:8-jdk-alpine AS runtime
WORKDIR /opt/egov

COPY --from=build /app/target/*.jar /app/start.sh /opt/egov/
# Pull in the fat JAR and our startup script
COPY --from=build /app/target/*.jar ./application.jar
COPY --from=build /app/start.sh ./start.sh

RUN chmod +x /opt/egov/start.sh
RUN chmod +x ./start.sh

CMD ["/opt/egov/start.sh"]
# Override any Alpine tini entrypoint and launch via shell
ENTRYPOINT ["sh", "./start.sh"]
17 changes: 17 additions & 0 deletions health-services/geopode-adapter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Swagger generated server

Spring Boot Server

## Overview
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project.
By using the [OpenAPI-Spec](https://github.com/swagger-api/swagger-core), you can easily generate a server stub.
This is an example of building a swagger-enabled server in Java using the SpringBoot framework.

The underlying library integrating swagger to SpringBoot is [springfox](https://github.com/springfox/springfox)

Start your server as a simple java application

You can view the api documentation in swagger-ui by pointing to
http://localhost:8080/

Change default port value in application.properties
Loading
Loading