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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
getLatestArtifacts();
|
updateWebsite();
|
||||||
|
|
||||||
res.send("Hello World!");
|
res.send("Done!");
|
||||||
});
|
});
|
||||||
|
|
||||||
app.listen(PORT, () => {
|
app.listen(PORT, () => {
|
||||||
console.log(`👀 http://localhost:${PORT}`);
|
console.log(`👀 http://localhost:${PORT}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
function getLatestArtifacts() {
|
function updateWebsite() {
|
||||||
const branch = "linna-staging";
|
const branch = "main";
|
||||||
const job = "deploy-staging";
|
const job = "staging";
|
||||||
const url = `https://git.uwaterloo.ca/csc/website/-/jobs/artifacts/${branch}/download?job=${job}`;
|
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(`wget -O ${zipPath} '${url}'`);
|
||||||
|
execSync(`yes All | unzip ${zipPath}`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue