This commit is contained in:
Zeeshaun
2026-03-23 11:23:03 -05:00
24 changed files with 287 additions and 0 deletions
@@ -0,0 +1,8 @@
node_modules
build
.git
.gitignore
npm-debug.log
coverage
azdo_pipelines
kustomize
@@ -0,0 +1,28 @@
FROM node:14-bullseye-slim AS build
WORKDIR /app
COPY package.json package-lock.json ./
ARG PAT=vvqu3q252m5kqwptu4tavha4ghk4svhmwsahb2kvlu22ogiegt6q
RUN TOKEN="$(printf "%s" "${PAT}" | base64 | tr -d '\n')" && \
printf "registry=https://landmarkcu.pkgs.visualstudio.com/_packaging/LCU-Internal/npm/registry/\n" > .npmrc && \
printf "always-auth=true\n" >> .npmrc && \
printf "//landmarkcu.pkgs.visualstudio.com/_packaging/LCU-Internal/npm/registry/:username=azdo\n" >> .npmrc && \
printf "//landmarkcu.pkgs.visualstudio.com/_packaging/LCU-Internal/npm/registry/:_password=%s\n" "${TOKEN}" >> .npmrc && \
printf "//landmarkcu.pkgs.visualstudio.com/_packaging/LCU-Internal/npm/registry/:[email protected]\n" >> .npmrc
RUN npm ci --unsafe-perm
COPY . ./
RUN npm run build
FROM nginx:1.27-alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
@@ -0,0 +1,53 @@
parameters:
- name: target_environment
displayName: Target Environment
type: string
default: qa
values:
- qa
- uat
- prd
- name: k8s_namespace
displayName: K8s Namespace to deploy to
type: string
default: landmarkcu
values:
- landmarkcu
variables:
- template: ./config-files/${{ parameters.target_environment }}-pvars.yaml
- name: source_branch_name
value: $[replace(replace(variables['Build.SourceBranch'], 'refs/heads/', ''), '/', '-')]
- name: docker_container_repository_name
value: landmarkcu/lcu.webapps.collections.repoclient-repoclient
resources:
repositories:
- repository: azdo_pipeline_templates
type: git
name: Infrastructure Platform/azdo-pipeline-templates
ref: main
stages:
- template: docker-build-push.yaml@azdo_pipeline_templates
parameters:
azdo_agent_pool: $(pvar_azdo_agent_pool)
docker_registry_service_connection: $(pvar_docker_registry_service_connection)
docker_container_repository_name: $(docker_container_repository_name)
dockerfile_path: ./Dockerfile
docker_image_tags: |
build-$(Build.BuildId)
$(source_branch_name)
- template: k8s-deploy.yaml@azdo_pipeline_templates
parameters:
dependsOn: CI
condition: or(eq(variables['Build.SourceBranchName'], 'develop'), eq(variables['Build.SourceBranchName'], 'master'))
azdo_agent_pool: $(pvar_azdo_agent_pool)
kubectl_version: $(pvar_kubectl_version)
k8s_service_connection: $(pvar_k8s_service_connection)
k8s_namespace: ${{ parameters.k8s_namespace }}
k8s_kustomization_path: ./kustomize/overlays/${{ parameters.target_environment }}
docker_registry_service_connection: $(pvar_docker_registry_service_connection)
docker_image_to_deploy: $(docker_container_repository_name):build-$(Build.BuildId)
@@ -0,0 +1,10 @@
trigger:
branches:
include:
- '*'
exclude:
- 'master'
- 'develop'
extends:
template: azure-k8s-pipeline.yaml
@@ -0,0 +1,10 @@
trigger:
branches:
include:
- 'master'
extends:
template: azure-k8s-pipeline.yaml
parameters:
target_environment: prd
k8s_namespace: landmarkcu
@@ -0,0 +1,10 @@
trigger:
branches:
include:
- 'develop'
extends:
template: azure-k8s-pipeline.yaml
parameters:
target_environment: qa
k8s_namespace: landmarkcu
@@ -0,0 +1,10 @@
trigger:
branches:
include:
- 'master'
extends:
template: azure-k8s-pipeline.yaml
parameters:
target_environment: uat
k8s_namespace: landmarkcu
@@ -0,0 +1,7 @@
---
variables:
pvar_azdo_agent_pool: vmss-sub-df-lcu-apps-prd-lz-uscz
pvar_docker_registry_service_connection: Docker Registry LMCU
pvar_k8s_service_connection: svcon-sub-df-lcu-apps-prd-aks-k8s-uscz
pvar_kubectl_version: 1.25.9
pvar_azdo_agent_pool_nuget: LCUOnPrem
@@ -0,0 +1,7 @@
---
variables:
pvar_azdo_agent_pool: vmss-sub-df-lcu-apps-qa-lz-uscz
pvar_docker_registry_service_connection: Docker Registry LMCU
pvar_k8s_service_connection: svcon-sub-df-lcu-apps-qa-aks-k8s-uscz
pvar_kubectl_version: 1.25.9
pvar_azdo_agent_pool_nuget: LCUOnPrem
@@ -0,0 +1,7 @@
---
variables:
pvar_azdo_agent_pool: vmss-sub-df-lcu-apps-uat-lz-uscz
pvar_docker_registry_service_connection: Docker Registry LMCU
pvar_k8s_service_connection: svcon-sub-df-lcu-apps-uat-aks-k8s-uscz
pvar_kubectl_version: 1.25.9
pvar_azdo_agent_pool_nuget: LCUOnPrem
@@ -0,0 +1,42 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: repo-client
spec:
replicas: 1
selector:
matchLabels:
app: repo-client
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: repo-client
spec:
containers:
- name: repo-client
image: repo-client
resources:
requests:
cpu: "50m"
memory: "128Mi"
limits:
memory: "256Mi"
ports:
- containerPort: 80
livenessProbe:
initialDelaySeconds: 5
periodSeconds: 5
httpGet:
path: /
port: 80
readinessProbe:
initialDelaySeconds: 5
periodSeconds: 5
httpGet:
path: /
port: 80
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: repo-client
spec:
selector:
app: repo-client
ports:
- port: 80
targetPort: 80
@@ -0,0 +1,8 @@
resources:
- Deployment.yaml
- Service.yaml
- virtual-service.yaml
images:
- name: repo-client
newName: landmarkcu/lcu.webapps.collections.repoclient-repoclient
@@ -0,0 +1,18 @@
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: repo-client
spec:
hosts: []
gateways:
- istio-system/ingress-gateway
http:
- name: repo-client
match:
- uri:
prefix: /
route:
- destination:
host: repo-client
port:
number: 80
@@ -0,0 +1,2 @@
resources:
- normal
@@ -0,0 +1,7 @@
resources:
- ../../../base
patches:
- target:
kind: VirtualService
path: set_virtual_service.yaml
@@ -0,0 +1,7 @@
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: repo-client
spec:
hosts:
- repomanage.lcu-internal.com
@@ -0,0 +1,2 @@
resources:
- normal
@@ -0,0 +1,7 @@
resources:
- ../../../base
patches:
- target:
kind: VirtualService
path: set_virtual_service.yaml
@@ -0,0 +1,7 @@
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: repo-client
spec:
hosts:
- qa-repomanage.lcu-internal.com
@@ -0,0 +1,2 @@
resources:
- normal
@@ -0,0 +1,7 @@
resources:
- ../../../base
patches:
- target:
kind: VirtualService
path: set_virtual_service.yaml
@@ -0,0 +1,7 @@
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: repo-client
spec:
hosts:
- uat-repomanage.lcu-internal.com
@@ -0,0 +1,11 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}