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

V1 #285

Merged
merged 68 commits into from
Oct 29, 2023
Merged

V1 #285

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
f837454
Merge pull request #242 from alwinsimon/v1-payments
alwinsimon Oct 28, 2023
4b75fc8
Merge pull request #243 from alwinsimon/v1
alwinsimon Oct 28, 2023
ba8b682
Added script for CI Testing.
alwinsimon Oct 28, 2023
bb10a4b
Merge pull request #244 from alwinsimon/v1-tickets
alwinsimon Oct 28, 2023
01326ea
Merge pull request #245 from alwinsimon/v1
alwinsimon Oct 28, 2023
c460d43
For Testing Auth CI Test.
alwinsimon Oct 28, 2023
0ccaf12
Testing Success.
alwinsimon Oct 28, 2023
72e7a61
Updated Title.
alwinsimon Oct 28, 2023
1a33335
Configured CI Tests Workflow for Orders service.
alwinsimon Oct 28, 2023
ac886f3
Modified Job name.
alwinsimon Oct 28, 2023
30ea838
Configured CI Tests Workflow for Payments service.
alwinsimon Oct 28, 2023
321c341
File name fixed.
alwinsimon Oct 28, 2023
fb1a83f
Configured CI Tests Workflow for Tickets Service.
alwinsimon Oct 28, 2023
8d32333
Added configuration to run tests path specific.
alwinsimon Oct 28, 2023
b967dbc
Merge pull request #247 from alwinsimon/V1-CI-CD
alwinsimon Oct 28, 2023
7bb6322
Made a change to check Test Status.
alwinsimon Oct 28, 2023
e2d822f
Updated test condition.
alwinsimon Oct 28, 2023
cf1daac
Test Performing as Expected - Reverting change.
alwinsimon Oct 28, 2023
52461a4
Merge pull request #248 from alwinsimon/V1-CI-CD
alwinsimon Oct 28, 2023
6562521
Added CD config file for Auth Service.
alwinsimon Oct 28, 2023
520c6cb
Merge pull request #250 from alwinsimon/V1-CI-CD
alwinsimon Oct 28, 2023
52431dc
Merge pull request #251 from alwinsimon/v1
alwinsimon Oct 28, 2023
58f6e74
Made a change to test Auth CD Workflow.
alwinsimon Oct 28, 2023
026280a
Merge pull request #252 from alwinsimon/V1-CI-CD
alwinsimon Oct 28, 2023
4bdf8c8
Minor fix in docker repository name.
alwinsimon Oct 28, 2023
ab650ad
Reverted change made for testing.
alwinsimon Oct 28, 2023
001a335
Merge pull request #253 from alwinsimon/V1-CI-CD
alwinsimon Oct 28, 2023
22460c2
Merge branch 'production' into v1
alwinsimon Oct 28, 2023
d4971ef
Merge pull request #254 from alwinsimon/v1
alwinsimon Oct 28, 2023
41e9e38
Updated image name in docker push.
alwinsimon Oct 28, 2023
45ae95e
Merge pull request #255 from alwinsimon/V1-CI-CD
alwinsimon Oct 28, 2023
779a0dc
Merge pull request #256 from alwinsimon/v1
alwinsimon Oct 28, 2023
3721ae9
Making a change to trigger CD workflow.
alwinsimon Oct 28, 2023
a3b676b
Merge pull request #257 from alwinsimon/V1-CI-CD
alwinsimon Oct 28, 2023
078c2f4
Merge pull request #258 from alwinsimon/v1
alwinsimon Oct 28, 2023
8999048
Reverted Change.
alwinsimon Oct 28, 2023
0971887
Merge pull request #259 from alwinsimon/V1-CI-CD
alwinsimon Oct 28, 2023
1c7b5ff
Merge pull request #260 from alwinsimon/v1
alwinsimon Oct 28, 2023
feea0c7
Merge pull request #261 from alwinsimon/production
alwinsimon Oct 28, 2023
f8bdf61
Added K8s config for CD Auth Deployment restart.
alwinsimon Oct 29, 2023
c2906aa
Added Deploy Manifest Config to apply all config inside infra/k8 dire…
alwinsimon Oct 29, 2023
f278aed
Merge pull request #263 from alwinsimon/V1-CI-CD
alwinsimon Oct 29, 2023
631012f
Merge pull request #264 from alwinsimon/v1
alwinsimon Oct 29, 2023
c81d215
Restructured Infra Directory to make use of different Ingress config …
alwinsimon Oct 29, 2023
bd2c928
Configured Skaffold to apply development ingress config file.
alwinsimon Oct 29, 2023
89ba315
Merge pull request #265 from alwinsimon/v1-infra
alwinsimon Oct 29, 2023
2377983
Merge pull request #266 from alwinsimon/v1
alwinsimon Oct 29, 2023
c533c0b
Modified to apply production configuration file for ingress.
alwinsimon Oct 29, 2023
dbb18a3
Merge pull request #267 from alwinsimon/V1-CI-CD
alwinsimon Oct 29, 2023
7ce2d19
Added comments for better understanding.
alwinsimon Oct 29, 2023
f3e9666
Merge pull request #268 from alwinsimon/V1-CI-CD
alwinsimon Oct 29, 2023
706ef6f
Replaced Hardcoded cluster name in the config with cluster Id pulled …
alwinsimon Oct 29, 2023
f7970f3
Merge pull request #271 from alwinsimon/V1-CI-CD
alwinsimon Oct 29, 2023
afd5ed3
Added a comment for testing CD trigger.
alwinsimon Oct 29, 2023
8dc3855
Merge pull request #274 from alwinsimon/v1-CI-CD
alwinsimon Oct 29, 2023
d4ef9e7
Reverted change made for testing.
alwinsimon Oct 29, 2023
d27899f
Configured CD for Client Service.
alwinsimon Oct 29, 2023
2ee4c81
Configured CD for Expiration Service.
alwinsimon Oct 29, 2023
26bd96c
Configured CD for Orders Service.
alwinsimon Oct 29, 2023
81b38bd
Configured CD for Payments Service.
alwinsimon Oct 29, 2023
4aee11b
Configured CD for Tickets Service.
alwinsimon Oct 29, 2023
a80c994
Merge pull request #276 from alwinsimon/v1-CI-CD
alwinsimon Oct 29, 2023
6c4316b
Made small changes to TEST CI-CD.
alwinsimon Oct 29, 2023
e9493f2
Merge pull request #278 from alwinsimon/v1-CI-CD
alwinsimon Oct 29, 2023
b73b089
Reverting changes made for testing.
alwinsimon Oct 29, 2023
674a106
Merge pull request #280 from alwinsimon/v1-CI-CD
alwinsimon Oct 29, 2023
b05e0f1
Updated the client with new baseUrl for making request from inside a …
alwinsimon Oct 29, 2023
6598fe8
Merge pull request #281 from alwinsimon/v1-client
alwinsimon Oct 29, 2023
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
31 changes: 31 additions & 0 deletions .github/workflows/CD - Deploy - Auth Service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ========================================= CD - Deploy - Auth Service =========================================

name: CD - Deploy - Auth Service

on:
push:
branches:
- production
paths:
- "auth/**"

jobs:
Auth-Service-CD-Pipeline:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
# Build Image and push to Docker registry
- run: cd auth && docker build -t alwinsimon/bookmyseat-auth .
- run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- run: docker push alwinsimon/bookmyseat-auth

# Restart Deployment in K8s cluster deployed in Digital Ocean
- uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- run: doctl kubernetes cluster kubeconfig save ${{ secrets.DIGITALOCEAN_CLUSTER_ID }}
- run: kubectl rollout restart deployment auth-depl
31 changes: 31 additions & 0 deletions .github/workflows/CD - Deploy - Client Service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ========================================= CD - Deploy - Client Service =========================================

name: CD - Deploy - Client Service

on:
push:
branches:
- production
paths:
- "client/**"

jobs:
Client-Service-CD-Pipeline:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
# Build Image and push to Docker registry
- run: cd client && docker build -t alwinsimon/bookmyseat-client .
- run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- run: docker push alwinsimon/bookmyseat-client

# Restart Deployment in K8s cluster deployed in Digital Ocean
- uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- run: doctl kubernetes cluster kubeconfig save ${{ secrets.DIGITALOCEAN_CLUSTER_ID }}
- run: kubectl rollout restart deployment client-depl
31 changes: 31 additions & 0 deletions .github/workflows/CD - Deploy - Expiration Service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ========================================= CD - Deploy - Expiration Service =========================================

name: CD - Deploy - Expiration Service

on:
push:
branches:
- production
paths:
- "expiration/**"

jobs:
Expiration-Service-CD-Pipeline:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
# Build Image and push to Docker registry
- run: cd expiration && docker build -t alwinsimon/bookmyseat-expiration .
- run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- run: docker push alwinsimon/bookmyseat-expiration

# Restart Deployment in K8s cluster deployed in Digital Ocean
- uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- run: doctl kubernetes cluster kubeconfig save ${{ secrets.DIGITALOCEAN_CLUSTER_ID }}
- run: kubectl rollout restart deployment expiration-depl
22 changes: 22 additions & 0 deletions .github/workflows/CD - Deploy - Manifests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# ========================================= CD - Deploy - Manifests =========================================

name: CD - Deploy - Manifests

on:
push:
branches:
- production
paths:
- "infra/**"

jobs:
Deploy-Manifests-CD-Pipeline:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- run: doctl kubernetes cluster kubeconfig save ${{ secrets.DIGITALOCEAN_CLUSTER_ID }}
- run: kubectl apply -f infra/k8s && kubectl apply -f infra/k8s-prod
31 changes: 31 additions & 0 deletions .github/workflows/CD - Deploy - Orders Service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ========================================= CD - Deploy - Orders Service =========================================

name: CD - Deploy - Orders Service

on:
push:
branches:
- production
paths:
- "orders/**"

jobs:
Orders-Service-CD-Pipeline:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
# Build Image and push to Docker registry
- run: cd orders && docker build -t alwinsimon/bookmyseat-orders .
- run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- run: docker push alwinsimon/bookmyseat-orders

# Restart Deployment in K8s cluster deployed in Digital Ocean
- uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- run: doctl kubernetes cluster kubeconfig save ${{ secrets.DIGITALOCEAN_CLUSTER_ID }}
- run: kubectl rollout restart deployment orders-depl
31 changes: 31 additions & 0 deletions .github/workflows/CD - Deploy - Payments Service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ========================================= CD - Deploy - Payments Service =========================================

name: CD - Deploy - Payments Service

on:
push:
branches:
- production
paths:
- "payments/**"

jobs:
Payments-Service-CD-Pipeline:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
# Build Image and push to Docker registry
- run: cd payments && docker build -t alwinsimon/bookmyseat-payments .
- run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- run: docker push alwinsimon/bookmyseat-payments

# Restart Deployment in K8s cluster deployed in Digital Ocean
- uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- run: doctl kubernetes cluster kubeconfig save ${{ secrets.DIGITALOCEAN_CLUSTER_ID }}
- run: kubectl rollout restart deployment payments-depl
31 changes: 31 additions & 0 deletions .github/workflows/CD - Deploy - Tickets Service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ========================================= CD - Deploy - Tickets Service =========================================

name: CD - Deploy - Tickets Service

on:
push:
branches:
- production
paths:
- "tickets/**"

jobs:
Tickets-Service-CD-Pipeline:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
# Build Image and push to Docker registry
- run: cd tickets && docker build -t alwinsimon/bookmyseat-tickets .
- run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- run: docker push alwinsimon/bookmyseat-tickets

# Restart Deployment in K8s cluster deployed in Digital Ocean
- uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- run: doctl kubernetes cluster kubeconfig save ${{ secrets.DIGITALOCEAN_CLUSTER_ID }}
- run: kubectl rollout restart deployment tickets-depl
9 changes: 6 additions & 3 deletions .github/workflows/CI - Tests - Auth Service.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# ========================================= Main Branch ::: CI - Tests - Auth Service =========================================
# ========================================= CI - Tests - Auth Service =========================================

name: CI - Tests - Auth Service

on: pull_request
on:
pull_request:
paths:
- "auth/**"

jobs:
Production-Branch-Pre-Integration-Tests:
Auth-Service-Pre-Integration-Tests:
runs-on: ubuntu-latest

steps:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/CI - Tests - Orders Service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ========================================= CI - Tests - Orders Service =========================================

name: CI - Tests - Orders Service

on:
pull_request:
paths:
- "orders/**"

jobs:
Orders-Service-Pre-Integration-Tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- run: cd orders && npm install && npm run test:ci
16 changes: 16 additions & 0 deletions .github/workflows/CI - Tests - Payments Service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ========================================= CI - Tests - Payments Service =========================================

name: CI - Tests - Payments Service

on:
pull_request:
paths:
- "payments/**"

jobs:
Payments-Service-Pre-Integration-Tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- run: cd payments && npm install && npm run test:ci
16 changes: 16 additions & 0 deletions .github/workflows/CI - Tests - Tickets Service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ========================================= CI - Tests - Tickets Service =========================================

name: CI - Tests - Tickets Service

on:
pull_request:
paths:
- "tickets/**"

jobs:
Tickets-Service-Pre-Integration-Tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- run: cd tickets && npm install && npm run test:ci
1 change: 0 additions & 1 deletion auth/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import mongoose from "mongoose";
import { app } from "./app";

const startServer = async () => {

const PORT = 3000;
const SERVICE_NAME = "AUTH";

Expand Down
2 changes: 1 addition & 1 deletion client/api/build-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default ({ req }) => {

return axios.create({
baseURL:
"http://ingress-nginx-controller.ingress-nginx.svc.cluster.local",
"http://bms.alwinsimon.com/",
headers: req.headers,
});
} else {
Expand Down
2 changes: 1 addition & 1 deletion client/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const IndexPage = ({ currentUser, tickets }) => {
<>
<h1>Landing Page</h1>
<br />
<h5>Signed Out</h5>
<h5>Signed Out.</h5>
</>
);
}
Expand Down
File renamed without changes.
47 changes: 47 additions & 0 deletions infra/k8s-prod/ingress-srv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-service
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
rules:
- host: bookmyseat.dev
http:
paths:
- path: /api/users/?(.*)
pathType: Prefix
backend:
service:
name: auth-srv
port:
number: 3000
- path: /api/tickets/?(.*)
pathType: Prefix
backend:
service:
name: tickets-srv
port:
number: 3000
- path: /api/orders/?(.*)
pathType: Prefix
backend:
service:
name: orders-srv
port:
number: 3000
- path: /api/payments/?(.*)
pathType: Prefix
backend:
service:
name: payments-srv
port:
number: 3000
- path: /?(.*)
pathType: Prefix
backend:
service:
name: client-srv
port:
number: 3000
1 change: 1 addition & 0 deletions skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ deploy:
kubectl:
manifests:
- ./infra/k8s/*
- ./infra/k8s-dev/*
build:
local:
push: true
Expand Down
3 changes: 2 additions & 1 deletion tickets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"start": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts",
"test": "jest --watchAll --no-cache"
"test": "jest --watchAll --no-cache",
"test:ci": "jest"
},
"jest": {
"preset": "ts-jest",
Expand Down