-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3fb9891
commit 87542fe
Showing
7 changed files
with
186 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
pipeline { | ||
agent any | ||
stages { | ||
stage('Install Dependencies') { | ||
steps { | ||
sh 'npm install' | ||
} | ||
} | ||
stage('Build') { | ||
steps { | ||
sh 'npm run build' | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: backend-deployment | ||
labels: | ||
app: backend | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: backend | ||
template: | ||
metadata: | ||
labels: | ||
app: backend | ||
spec: | ||
containers: | ||
- name: backend | ||
image: lms-backend:latest # Build and push this to a container registry | ||
ports: | ||
- containerPort: 3000 | ||
env: | ||
- name: NODE_ENV | ||
value: "production" | ||
volumeMounts: | ||
- name: backend-code | ||
mountPath: /app | ||
volumes: | ||
- name: backend-code | ||
hostPath: | ||
path: /home/user/project/backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: backend-service | ||
spec: | ||
selector: | ||
app: backend | ||
ports: | ||
- protocol: TCP | ||
port: 3000 | ||
targetPort: 3000 | ||
type: ClusterIP # Internal service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: lms-app-config | ||
data: | ||
NODE_ENV: "production" | ||
REACT_APP_BACKEND_URL: "http://backend-service:3000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: frontend-deployment | ||
labels: | ||
app: frontend | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: frontend | ||
template: | ||
metadata: | ||
labels: | ||
app: frontend | ||
spec: | ||
containers: | ||
- name: frontend | ||
image: lms-frontend:latest # Build and push this to a container registry | ||
ports: | ||
- containerPort: 3001 | ||
env: | ||
- name: ANGULAR_APP_BACKEND_URL | ||
value: "http://backend-service:3000" # This service will route to the backend service | ||
volumeMounts: | ||
- name: frontend-code | ||
mountPath: /app | ||
volumes: | ||
- name: frontend-code | ||
hostPath: | ||
path: /home/user/project/frontend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: frontend-service | ||
spec: | ||
selector: | ||
app: frontend | ||
ports: | ||
- protocol: TCP | ||
port: 3001 | ||
targetPort: 3001 | ||
type: NodePort # Expose frontend for external access |