@samitouri / QOS-React-2 / commits / f35287dda4

[build2 -> build] -> download-build-artifacts

Andrew Clark committed Sep 21, 2021 at 12:13 UTC f35287dda431fd48706b57f57df7dc4584e2ca30
1 file changed +9 -3
scripts/release/shared-commands/download-build-artifacts.js
+9 -3
@@ -4,6 +4,7 @@
4
5 const {exec} = require('child-process-promise');
6 const {existsSync} = require('fs');
7 +const fse = require('fs-extra');
8 const {join} = require('path');
9 const {getArtifactsList, logPromise} = require('../utils');
10 const theme = require('../theme');
@@ -11,7 +12,7 @@ const theme = require('../theme');
12 const run = async ({build, cwd, releaseChannel}) => {
13 const artifacts = await getArtifactsList(build);
14 const buildArtifacts = artifacts.find(entry =>
14 - entry.path.endsWith('build2.tgz')
15 + entry.path.endsWith('build.tgz')
16 );
17
18 if (!buildArtifacts) {
@@ -22,7 +23,7 @@ const run = async ({build, cwd, releaseChannel}) => {
23 }
24
25 // Download and extract artifact
25 - await exec(`rm -rf ./build2`, {cwd});
26 + await exec(`rm -rf ./build`, {cwd});
27 await exec(
28 `curl -L $(fwdproxy-config curl) ${buildArtifacts.url} | tar -xvz`,
29 {
@@ -30,6 +31,11 @@ const run = async ({build, cwd, releaseChannel}) => {
31 }
32 );
33
34 + // TODO: Currently storing a copy of the artifacts as `./build2`, because
35 + // some scripts reference that directory. Remove once we migrate everything to
36 + // reference `./build` instead.
37 + fse.copySync('./build', './build2');
38 +
39 // Copy to staging directory
40 // TODO: Consider staging the release in a different directory from the CI
41 // build artifacts: `./build/node_modules` -> `./staged-releases`
@@ -50,7 +56,7 @@ const run = async ({build, cwd, releaseChannel}) => {
56 console.error('Internal error: Invalid release channel: ' + releaseChannel);
57 process.exit(releaseChannel);
58 }
53 - await exec(`cp -r ./build2/${sourceDir} ./build/node_modules`, {cwd});
59 + await exec(`cp -r ./build/${sourceDir} ./build/node_modules`, {cwd});
60 };
61
62 module.exports = async ({build, commit, cwd, releaseChannel}) => {