Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratap2018 committed Aug 19, 2024
1 parent af0c7f5 commit 03a735f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion script.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

gcloud auth login --cred-file=/data/fyre-400407-9c9f737ef3f7.json


gcloud config set project fyre-400407

Expand Down
42 changes: 42 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { configDotenv } from 'dotenv';
import { getKubeconfig } from './auth.js';
import { exec } from 'child_process'




configDotenv()


Expand All @@ -8,8 +13,44 @@ import k8s from '@kubernetes/client-node';



function execute() {
try {

exec(`gcloud auth login --cred-file=${process.env.GOOGLE_APPLICATION_CREDENTIALS}`, (err, stdout, stderr) => {
if (err) {
console.log(err);

// node couldn't execute the command
return;
}

// the *entire* stdout and stderr (buffered)
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);

})


exec(`gcloud container clusters get-credentials hypermine-gke --region asia-south1`, (err, stdout, stderr) => {
if (err) {
console.log(err);

// node couldn't execute the command
return;
}

// the *entire* stdout and stderr (buffered)
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);

})
} catch (e) {
console.log(e);

}

}




Expand Down Expand Up @@ -127,6 +168,7 @@ const queueName = process.env.GLOBAL_TXN_CONTROLLER_QUEUE || 'GLOBAL_TXN_CONTROL

(async () => {
try {
execute()
console.log("Start Service");

const namespace = 'hypermine-development'
Expand Down

0 comments on commit 03a735f

Please sign in to comment.