diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..e37716ee4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,21 @@ +name: first_workflow +#on: workflow_dispatch +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] +jobs: + setup: + runs-on: ubuntu-slim + steps: + - name: clone-repo + run: | + echo "hello clone repos step" + echo "good afterroon running on single step of both echo commands" + + second-job: + runs-on: ubuntu-slim + steps: + - name: second-stage + run: echo "hello second-stage" diff --git a/Db b/Db new file mode 100644 index 000000000..720beb6c5 --- /dev/null +++ b/Db @@ -0,0 +1,17 @@ +const mongoose = require("mongoose"); + +module.exports = async () => { + try { + // Connection parameters + const connectionParams = { + useNewUrlParser: true, + useUnifiedTopology: true, + }; + + // Connect to MongoDB using the connection string from environment variables + await mongoose.connect(process.env.MONGO_CONN_STR, connectionParams); + console.log("Connected to database."); + } catch (error) { + console.error("Could not connect to database.", error); + } +}; diff --git a/Kubernetes-Manifests-file/Backend/deployment.yaml b/Kubernetes-Manifests-file/Backend/deployment.yaml index 5ced3cb5e..2c65dbab0 100644 --- a/Kubernetes-Manifests-file/Backend/deployment.yaml +++ b/Kubernetes-Manifests-file/Backend/deployment.yaml @@ -25,7 +25,7 @@ spec: - name: ecr-registry-secret containers: - name: api - image: 407622020962.dkr.ecr.us-east-1.amazonaws.com/backend:1 + image: 025066275420.dkr.ecr.ap-south-1.amazonaws.com/backend:4 imagePullPolicy: Always env: - name: MONGO_CONN_STR @@ -42,23 +42,3 @@ spec: key: password ports: - containerPort: 3500 - livenessProbe: - httpGet: - path: /healthz - port: 3500 - initialDelaySeconds: 2 - periodSeconds: 5 - readinessProbe: - httpGet: - path: /ready - port: 3500 - initialDelaySeconds: 5 - periodSeconds: 5 - successThreshold: 1 - startupProbe: - httpGet: - path: /started - port: 3500 - initialDelaySeconds: 0 - periodSeconds: 10 - failureThreshold: 30 diff --git a/Kubernetes-Manifests-file/Frontend/deployment.yaml b/Kubernetes-Manifests-file/Frontend/deployment.yaml index 24f73e8c8..a481b97bd 100644 --- a/Kubernetes-Manifests-file/Frontend/deployment.yaml +++ b/Kubernetes-Manifests-file/Frontend/deployment.yaml @@ -25,7 +25,7 @@ spec: - name: ecr-registry-secret containers: - name: frontend - image: 407622020962.dkr.ecr.us-east-1.amazonaws.com/frontend:3 + image: 025066275420.dkr.ecr.ap-south-1.amazonaws.com/frontend:46 imagePullPolicy: Always env: - name: REACT_APP_BACKEND_URL diff --git a/Kubernetes-Manifests-file/Frontend/service.yaml b/Kubernetes-Manifests-file/Frontend/service.yaml index de2f6df78..218c7cdd0 100644 --- a/Kubernetes-Manifests-file/Frontend/service.yaml +++ b/Kubernetes-Manifests-file/Frontend/service.yaml @@ -9,4 +9,4 @@ spec: protocol: TCP type: ClusterIP selector: - role: frontend \ No newline at end of file + role: frontend diff --git a/Kubernetes-Manifests-file/ingress.yaml b/Kubernetes-Manifests-file/ingress.yaml index 00526e0c3..1b119d11a 100644 --- a/Kubernetes-Manifests-file/ingress.yaml +++ b/Kubernetes-Manifests-file/ingress.yaml @@ -11,8 +11,7 @@ metadata: spec: ingressClassName: alb rules: - - host: amanpathakdevops.study - http: + - http: paths: - path: /api pathType: Prefix