unzip artifacts
This commit is contained in:
parent
686ceec68b
commit
bfa7883a48
13
index.ts
13
index.ts
|
@ -39,21 +39,22 @@ app.post("/", (req, res) => {
|
|||
return;
|
||||
}
|
||||
|
||||
getLatestArtifacts();
|
||||
updateWebsite();
|
||||
|
||||
res.send("Hello World!");
|
||||
res.send("Done!");
|
||||
});
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`👀 http://localhost:${PORT}`);
|
||||
});
|
||||
|
||||
function getLatestArtifacts() {
|
||||
const branch = "linna-staging";
|
||||
const job = "deploy-staging";
|
||||
function updateWebsite() {
|
||||
const branch = "main";
|
||||
const job = "staging";
|
||||
const url = `https://git.uwaterloo.ca/csc/website/-/jobs/artifacts/${branch}/download?job=${job}`;
|
||||
|
||||
const zipPath = `${branch}.zip`;
|
||||
const zipPath = `zips/${branch}.zip`;
|
||||
|
||||
execSync(`wget -O ${zipPath} '${url}'`);
|
||||
execSync(`yes All | unzip ${zipPath}`);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue