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