Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caseflow ci cd #35

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
315ea47
Update Dockerfile
sakthi-aot Mar 19, 2024
3694051
Update Dockerfile
sakthi-aot Mar 19, 2024
d181a64
Update Dockerfile
sakthi-aot Mar 19, 2024
28a3e98
updated
sakthi-aot Mar 19, 2024
5ebb3d0
updated
sakthi-aot Mar 19, 2024
ae04a9e
updated
sakthi-aot Mar 19, 2024
3cb6695
Update Dockerfile
sakthi-aot Mar 19, 2024
fcd62db
Update Dockerfile
sakthi-aot Mar 19, 2024
6b91e03
Update nginx.conf
sakthi-aot Mar 19, 2024
6a6dbe0
Update Dockerfile
sakthi-aot Mar 19, 2024
b0d0a72
Update Dockerfile
sakthi-aot Mar 20, 2024
6b26b18
updated
sakthi-aot Mar 20, 2024
8848da0
updated
sakthi-aot Mar 20, 2024
310e0d5
updated
sakthi-aot Mar 20, 2024
1df5a47
updated
sakthi-aot Mar 20, 2024
a52f608
updated
sakthi-aot Mar 20, 2024
5bcdd4d
updated
sakthi-aot Mar 20, 2024
c444128
updated
sakthi-aot Mar 20, 2024
ff5cc14
udated
sakthi-aot Mar 20, 2024
fc4fcef
updated
sakthi-aot Mar 20, 2024
4541489
updated
sakthi-aot Mar 20, 2024
078bb71
updated
sakthi-aot Mar 20, 2024
f963302
update
sakthi-aot Mar 20, 2024
154f7c8
Added config file
nagarajaPC-AOT Mar 21, 2024
3a28887
Merge branch 'caseflow-ci-cd' of https://github.com/AOT-Technologies/…
nagarajaPC-AOT Mar 21, 2024
19e38b7
update config.js
sakthi-aot Mar 21, 2024
964c940
update
sakthi-aot Mar 21, 2024
dc47209
config env changes
nagarajaPC-AOT Mar 21, 2024
6385ae8
added script type in index file
nagarajaPC-AOT Mar 21, 2024
357f394
script file path name change in index.html file
nagarajaPC-AOT Mar 21, 2024
7fd3ab0
update kc url
sakthi-aot Mar 22, 2024
34cfd73
test
sakthi-aot Mar 22, 2024
75f4f8d
test
sakthi-aot Mar 22, 2024
7e3af08
update
sakthi-aot Mar 22, 2024
dc9e97f
update
sakthi-aot Mar 22, 2024
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
10 changes: 5 additions & 5 deletions .github/workflows/caseflow_web_os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: "./app/caseflow_web/package-lock.json"
- run: npm install --force
working-directory: ./app/caseflow_web
- run: CI=false npm run build
working-directory: ./app/caseflow_web
# - run: npm install --force
# working-directory: ./app/caseflow_web
# - run: CI=false npm run build
# working-directory: ./app/caseflow_web


- name: Set ENV variables
Expand Down Expand Up @@ -94,4 +94,4 @@ jobs:
- name: Tag+Deploy for ${{ inputs.environment }}
shell: bash
run: |
oc tag ${{ env.APP_NAME }}:latest ${{ env.APP_NAME }}:${{ inputs.environment }}
oc tag ${{ env.APP_NAME }}-build:latest ${{ env.APP_NAME }}:${{ inputs.environment }}
2 changes: 2 additions & 0 deletions app/caseflow_core/microservices/dms/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { NestFactory } from '@nestjs/core';
import { config } from 'dotenv';
import { Transport } from '@nestjs/microservices';

//_____________________Custom Imports_____________________//

import { AppModule } from './app.module';

async function bootstrap() {
config();
const app = await NestFactory.create(AppModule);

app.connectMicroservice({
Expand Down
7 changes: 7 additions & 0 deletions app/caseflow_core/microservices/gateway/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { config } from 'dotenv';

async function bootstrap() {
config();
const app = await NestFactory.create(AppModule);
app.enableCors({
origin: true,
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS',
credentials: true,
});
await app.listen(7000);
}
bootstrap();
7 changes: 7 additions & 0 deletions app/caseflow_core/microservices/lob/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import { ValidationPipe } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { config } from 'dotenv';

async function bootstrap() {
config();
const app = await NestFactory.create(AppModule);
app.useGlobalPipes(new ValidationPipe());
app.enableCors({
origin: true,
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS',
credentials: true,
});
await app.listen(8000);
}
bootstrap();
45 changes: 20 additions & 25 deletions app/caseflow_web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
# base image
FROM node:14.17.0-alpine as build-stage
# Use a smaller base image for the build stage
FROM node:14.17.0 AS build-stage

# set working directory
WORKDIR /case-flow-web/app
# Set working directory
WORKDIR /app

# add `/app/node_modules/.bin` to $PATH
ENV PATH /case-flow-web/app/node_modules/.bin:$PATH

RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh

# install and cache app dependencies

COPY package-lock.json /case-flow-web/app/package-lock.json
COPY package.json /case-flow-web/app/package.json
# Copy package.json and package-lock.json separately to leverage Docker caching
COPY package.json package-lock.json ./

# Install dependencies
RUN npm install --silent
RUN npm install [email protected] -g --silent

# create and set user permissions to app folder
RUN mkdir -p node_modules/.cache && chmod -R 777 node_modules/.cache

# add app files
COPY . ./case-flow-web
# Add app files
COPY . .

# Build the app
RUN npm run build

FROM nginx:1.17 as production-stage
RUN mkdir /app
COPY --from=build-stage /case-flow-web/app/build /usr/share/nginx/html
COPY ./nginx.conf /etc/nginx/nginx.conf
# Use a smaller base image for the production stage
FROM nginx:1.21 AS production-stage

# Copy built files from the build stage to Nginx's HTML directory
COPY --from=build-stage /app/build /usr/share/nginx/html

# Copy custom NGINX configuration
COPY nginx.conf /etc/nginx/nginx.conf

CMD ["nginx", "-g", "daemon off;"]
# Command to run Nginx in the foreground
CMD ["nginx", "-g", "daemon off;"]
49 changes: 25 additions & 24 deletions app/caseflow_web/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
worker_processes auto;

# Log to stdout
error_log /dev/stdout info;
pid /tmp/nginx.pid;

events {
worker_connections 1024;
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;

keepalive_timeout 65;
#gzip on;
#include /etc/nginx/conf.d/*.conf;
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
client_body_temp_path /tmp/client_temp;
proxy_temp_path /tmp/proxy_temp_path;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 8080;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}
}
}

1 change: 1 addition & 0 deletions app/caseflow_web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.16.0",
"sass": "^1.55.0"
}
}
49 changes: 49 additions & 0 deletions app/caseflow_web/public/config/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
window["_env_"] = {
// To define project level configuration possible values development, test, production
NODE_ENV: "development",
// Environment Variables for forms-flow-web

//Keycloak-client-name for web
REACT_APP_KEYCLOAK_WEB_CLIENTID:'case-flow-web',
// Keycloak-client-name for web
REACT_APP_KEYCLOAK_URL_REALM:'forms-flow-ai',

// Keycloak base URL
REACT_APP_KEYCLOAK_URL:'https://forms-flow-idm-a358eb-dev.apps.silver.devops.gov.bc.ca',


// caseflow web Api End point
REACT_APP_CASEFLOW_API_URL:'https://caseflow-microservices-server-dev.apps.silver.devops.gov.bc.ca',

// caseflow Api GraphQL End point
REACT_APP_CASEFLOW_GRAPHQL_API_URL:'https://caseflow-microservices-gateway-dev.apps.silver.devops.gov.bc.ca',


// default DMS
REACT_APP_CASEFLOW_DMS:3,

// application name
APPLICATION_NAME:'caseflow.ai',

// LOB Graphql Base Url
REACT_APP_CASEFLOW_LOB_GRAPHQL_API_URL:'https://caseflow-microservices-lob-dev.apps.silver.devops.gov.bc.ca',
// Take Number For Pagination
REACT_APP_PAGINATION_TAKE:10,


// Formsflow BPM base url
REACT_APP_FORMSFLOW_URL:'https://forms-flow-bpm-a358eb-dev.apps.silver.devops.gov.bc.ca',


// Formsflow Application base url
REACT_APP_FORMSFLOW_APP_URL:'https://forms-flow-forms-a358eb-dev.apps.silver.devops.gov.bc.ca',

// DMS FILE UPLOAD DIRECT REST URL
REACT_APP_CASEFLOW_DMS_API_URL:'https://caseflow-microservices-dms-dev.apps.silver.devops.gov.bc.ca',

REACT_APP_FORMSFLOW_FORM_URL:'https://forms-flow-api-a358eb-dev.apps.silver.devops.gov.bc.ca',

REACT_APP_FORMSFLOW_WEB_URL:'https://forms-flow-web-a358eb-dev.apps.silver.devops.gov.bc.ca',

REACT_APP_GENERIC_NAME : 'Case'
};
3 changes: 3 additions & 0 deletions app/caseflow_web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">

<script type="text/javascript" src="%PUBLIC_URL%/config/config.js"></script>
<!-- <link rel='stylesheet' href='https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css'>
<link rel='stylesheet' href='https://cdn.form.io/formiojs/formio.full.min.css'>
<script src='https://cdn.form.io/formiojs/formio.full.min.js'></script> -->
Expand All @@ -34,6 +36,7 @@
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>

<div id="root"></div>
<!--
This HTML file is a template.
Expand Down
2 changes: 1 addition & 1 deletion app/caseflow_web/src/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const KEYCLOAK_URL =
(window._env_ && window._env_.REACT_APP_KEYCLOAK_URL) ||
process.env.REACT_APP_KEYCLOAK_URL;

export const KEYCLOAK_AUTH_URL = `${KEYCLOAK_URL}/auth`;
export const KEYCLOAK_AUTH_URL = `${KEYCLOAK_URL}`;
export const CLIENT =
(window._env_ && window._env_.REACT_APP_CLIENT_ROLE) ||
process.env.REACT_APP_CLIENT_ROLE ||
Expand Down
Loading