From bfa7883a48a9509fdf8bc981206cd940ef4b30c2 Mon Sep 17 00:00:00 2001 From: Aditya Thakral Date: Mon, 7 Jun 2021 19:57:27 -0400 Subject: [PATCH] unzip artifacts --- index.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/index.ts b/index.ts index 987d7ea..45f7ac0 100644 --- a/index.ts +++ b/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}`); }