inital commit

This commit is contained in:
Shahan Nedadahandeh 2022-06-07 02:29:45 -04:00
commit 1f41aab543
4 changed files with 2836 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules/

30
csccp.js Normal file
View File

@ -0,0 +1,30 @@
const exec = require('await-exec')
const express = require('express')
const app = express()
const port = 2344
const name = "cscclassprofilestaging"
const image = "registry.cloud.csclub.uwaterloo.ca/snedadah/csc-class-profile-staging"
app.get('/cscclassprofilestaging', async (req, res) => {
await call(`kubectl delete deployment ${name}`);
await call(`kubectl create deployment ${name} --image ${image} --port=80`);
await call(`kubectl expose deployment ${name}`);
await call(`kubectl create ingress ${name} --rule='${name}-snedadah.k8s.csclub.cloud/*=${name}:80'`);
res.send('Hello World!')
})
async function call(cmd){
let out
try{
out = await exec(cmd);
}catch(e)
{
console.log(e, out)
}
}
app.listen(port, () => {
console.log(`Example app listening on port ${port}`)
})

2788
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

17
package.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "webhooks",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"await-exec": "^0.1.2",
"express": "^4.18.1",
"forever": "^4.0.3",
"forver": "0.0.6"
}
}