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

Mnagaraju5628 patch 1 #16

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
814ba6c
Create node.js.yml
mnagaraju5628 Dec 22, 2023
7ae34da
Update node.js.yml
mnagaraju5628 Dec 22, 2023
fbb3a43
Update node.js.yml
mnagaraju5628 Dec 22, 2023
170de69
Delete .github/workflows directory
mnagaraju5628 Dec 22, 2023
56e9808
Create node.js.yml
mnagaraju5628 Dec 22, 2023
aa30f91
Delete .github/workflows directory
mnagaraju5628 Dec 22, 2023
08b9b18
Create node.js.yml
mnagaraju5628 Dec 22, 2023
b11f314
Delete .github/workflows directory
mnagaraju5628 Dec 22, 2023
7b870aa
Create node.js.yml
mnagaraju5628 Dec 22, 2023
f1a817d
Update node.js.yml
mnagaraju5628 Dec 22, 2023
a5de5b6
Update node.js.yml
mnagaraju5628 Dec 22, 2023
58a9416
Update index.js
mnagaraju5628 Dec 22, 2023
2d3b7b1
Delete .github/workflows directory
mnagaraju5628 Dec 22, 2023
fec758a
Create node.js.yml
mnagaraju5628 Dec 22, 2023
56fdf42
Update node.js.yml
mnagaraju5628 Dec 22, 2023
7bb51c0
Update index.js
mnagaraju5628 Dec 22, 2023
4a27c60
Update test.js
mnagaraju5628 Dec 22, 2023
a4df0af
Update deploymentservice.yml
mnagaraju5628 Dec 22, 2023
752d740
Update deployment.yml
mnagaraju5628 Dec 22, 2023
745a162
Update service.yml
mnagaraju5628 Dec 22, 2023
db29626
Update deploymentservice.yml
mnagaraju5628 Dec 27, 2023
88972c9
Update deployment.yml
mnagaraju5628 Dec 27, 2023
84f124d
Update node.js.yml
mnagaraju5628 Dec 27, 2023
3b08ed1
Update node.js.yml
mnagaraju5628 Dec 27, 2023
f57e684
Update node.js.yml
mnagaraju5628 Dec 27, 2023
bde795e
Update node.js.yml
mnagaraju5628 Dec 27, 2023
a44ffbd
Update node.js.yml
mnagaraju5628 Dec 27, 2023
b3a3fc3
Update node.js.yml
mnagaraju5628 Dec 27, 2023
8ecbd34
Update node.js.yml
mnagaraju5628 Dec 27, 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
33 changes: 0 additions & 33 deletions .github/workflows/main.yml

This file was deleted.

54 changes: 54 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm install

- name: install the gcloud cli
uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GOOGLE_PROJECT }}
service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
install_components: 'gke-gcloud-auth-plugin'
export_default_credentials: true

- name: build and push the docker image
env:
GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }}
run: |
gcloud auth configure-docker us-central1-docker.pkg.dev
docker build -t us-central1-docker.pkg.dev/goldengate-1/test-project/node:latest .
docker push us-central1-docker.pkg.dev/goldengate-1/test-project/node:latest
- name: deploy to gke
env:
GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }}
run: |
gcloud container clusters get-credentials test-cluster --region asia-south1-c
sed -i "s/GOOGLE_PROJECT/$GOOGLE_PROJECT/g" deploymentservice.yml
kubectl apply -f deploymentservice.yml
2 changes: 1 addition & 1 deletion deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ spec:
spec:
containers:
- name: nodeserver
image: thetips4you/nodeapp:latest
image: us-central1-docker.pkg.dev/goldengate-1/test-project/nodeapp:latest
ports:
- containerPort: 3000
4 changes: 2 additions & 2 deletions deploymentservice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
spec:
containers:
- name: nodeserver
image: thetips4you/nodeapp:latest
image: asia-south1-docker.pkg.dev/goldengate-1/test-project/code:latest
ports:
- containerPort: 3000

Expand All @@ -33,6 +33,6 @@ spec:
type: LoadBalancer
ports:
- protocol: TCP
port: 5000
port: 8000
targetPort: 3000
nodePort: 31110
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ var express = require('express');
var app = express();

app.get('/', function (req, res) {
res.send('{ "response": "Hello From Thetips4you" }');
res.send('{ "response": "Welcome to Innodata" }');
});

app.get('/will', function (req, res) {
res.send('{ "response": "Hello World" }');
res.send('{ "response": "Welcome" }');
});
app.get('/ready', function (req, res) {
res.send('{ "response": " Great!, It works!" }');
Expand Down
2 changes: 1 addition & 1 deletion service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ spec:
type: LoadBalancer
ports:
- protocol: TCP
port: 5000
port: 8000
targetPort: 3000
nodePort: 31110
6 changes: 3 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var request = require('supertest');
var app = require('../index.js');
describe('GET /will', function() {
it('respond with hello world', function(done) {
request(app).get('/will').expect('{ "response": "Hello World" }', done);
it('respond with Welcome', function(done) {
request(app).get('/will').expect('{ "response": "Welcome" }', done);
});
});
});