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 ci cd #276

Merged
merged 6 commits into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 - 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
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
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 () => {
console.log("Starting up .......");
const PORT = 3000;
const SERVICE_NAME = "AUTH";

Expand Down