commit
1f41aab543
@ -0,0 +1 @@ |
||||
node_modules/ |
@ -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}`) |
||||
}) |
File diff suppressed because it is too large
Load Diff
@ -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" |
||||
} |
||||
} |
Loading…
Reference in new issue