@akash-chowdhury-24/deployhub 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import fs from 'fs-extra';
|
|
3
3
|
import archiver from 'archiver';
|
|
4
|
-
import
|
|
4
|
+
import axios from 'axios';
|
|
5
5
|
import { createLogger } from '../../../logger/index.js';
|
|
6
6
|
import {
|
|
7
7
|
runCli,
|
|
@@ -29,6 +29,18 @@ async function createRootZip(sourceDir, zipPath) {
|
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* @param {string} zipPath
|
|
34
|
+
* @param {string} uploadUrl
|
|
35
|
+
*/
|
|
36
|
+
async function uploadZipToAmplify(zipPath, uploadUrl) {
|
|
37
|
+
await axios.put(uploadUrl, fs.createReadStream(zipPath), {
|
|
38
|
+
headers: { 'Content-Type': 'application/zip' },
|
|
39
|
+
maxBodyLength: Infinity,
|
|
40
|
+
maxContentLength: Infinity,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
32
44
|
/**
|
|
33
45
|
* @param {import('../../../core/config.js').DeployHubConfig} config
|
|
34
46
|
* @param {string} envName
|
|
@@ -153,11 +165,8 @@ export function createAwsAmplifyProvider(config, envName, env = process.env) {
|
|
|
153
165
|
const jobId = deployment.jobId;
|
|
154
166
|
const zipUploadUrl = deployment.zipUploadUrl;
|
|
155
167
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
stdio: 'inherit',
|
|
159
|
-
shell: true,
|
|
160
|
-
});
|
|
168
|
+
log.info('Uploading zip to Amplify...');
|
|
169
|
+
await uploadZipToAmplify(amplifyZipPath, zipUploadUrl);
|
|
161
170
|
|
|
162
171
|
const startResult = await runCli(
|
|
163
172
|
`aws amplify start-deployment --app-id ${appId} --branch-name ${branch} --job-id ${jobId}`,
|