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

Innodata testgcp patch1 #19

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 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
58e430f
Update node.js.yml
mnagaraju5628 Dec 27, 2023
8e4d812
Update node.js.yml
mnagaraju5628 Dec 27, 2023
bed2c1b
Update node.js.yml
mnagaraju5628 Dec 27, 2023
9071f07
Update node.js.yml
mnagaraju5628 Dec 27, 2023
0862e74
Update node.js.yml
mnagaraju5628 Dec 27, 2023
dbd6616
Update node.js.yml
mnagaraju5628 Dec 27, 2023
20675b2
Update node.js.yml
mnagaraju5628 Dec 27, 2023
c7f11dd
Update node.js.yml
mnagaraju5628 Dec 27, 2023
f748d7c
Update node.js.yml
mnagaraju5628 Dec 27, 2023
8099589
deploymentservice.yml
mnagaraju5628 Dec 27, 2023
d0a9b3e
Delete deployment.yml
mnagaraju5628 Dec 27, 2023
31127ea
Delete service.yml
mnagaraju5628 Dec 27, 2023
a50168a
Update node.js.yml
mnagaraju5628 Dec 27, 2023
0d902a5
Create README.md
mnagaraju5628 Dec 27, 2023
ac872fb
Update node.js.yml
mnagaraju5628 Dec 29, 2023
7070877
Update node.js.yml
mnagaraju5628 Dec 29, 2023
f00884e
Update node.js.yml
mnagaraju5628 Dec 29, 2023
59d5cd9
Update node.js.yml
mnagaraju5628 Dec 29, 2023
24d709c
Update node.js.yml
mnagaraju5628 Dec 29, 2023
348082f
Update node.js.yml
mnagaraju5628 Dec 29, 2023
269148c
Update node.js.yml
mnagaraju5628 Dec 29, 2023
add794c
Update node.js.yml
mnagaraju5628 Dec 29, 2023
7b72be3
Update index.js
mnagaraju5628 Jan 4, 2024
4412aed
Update index.js
mnagaraju5628 Jan 4, 2024
930a3c4
Merge pull request #1 from mnagaraju5628/innodata-test-patch
mnagaraju5628 Jan 4, 2024
d0dd9b5
updated tagname
mnagaraju5628 Jan 4, 2024
f06da44
Update node.js.yml
mnagaraju5628 Jan 4, 2024
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.

55 changes: 55 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 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:
deploy:

runs-on: self-hosted

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/[email protected]
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/nodeapp:v1 .
docker push us-central1-docker.pkg.dev/goldengate-1/test-project/nodeapp:v1
- 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

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Node.js Application
21 changes: 0 additions & 21 deletions deployment.yml

This file was deleted.

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: us-central1-docker.pkg.dev/goldengate-1/test-project/nodeapp:v1
ports:
- containerPort: 3000

Expand All @@ -33,6 +33,6 @@ spec:
type: LoadBalancer
ports:
- protocol: TCP
port: 5000
port: 8000
targetPort: 3000
nodePort: 31110
2 changes: 1 addition & 1 deletion dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:latest
FROM nodeapp:v1

WORKDIR /usr/src/app

Expand Down
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 testgcp-project" }');
});

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
13 changes: 0 additions & 13 deletions service.yml

This file was deleted.

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);
});
});
});