unzip artifacts

This commit is contained in:
Aditya Thakral 2021-06-07 19:57:27 -04:00
parent 686ceec68b
commit bfa7883a48
1 changed files with 7 additions and 6 deletions

View File

@ -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}`);
} }