@goldstack/utils-s3-deployment 0.3.34 → 0.3.38
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
interface S3UploadParams {
|
|
2
|
-
userName: string;
|
|
3
|
-
region: string;
|
|
4
|
-
localPath: string;
|
|
5
|
-
bucket: string;
|
|
6
|
-
bucketPath: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const upload: (params: S3UploadParams) => Promise<void>;
|
|
9
|
-
export {};
|
|
1
|
+
interface S3UploadParams {
|
|
2
|
+
userName: string;
|
|
3
|
+
region: string;
|
|
4
|
+
localPath: string;
|
|
5
|
+
bucket: string;
|
|
6
|
+
bucketPath: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const upload: (params: S3UploadParams) => Promise<void>;
|
|
9
|
+
export {};
|
|
10
10
|
//# sourceMappingURL=utilsS3Deployment.d.ts.map
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.upload = void 0;
|
|
4
|
-
const infra_aws_1 = require("@goldstack/infra-aws");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
const utils_aws_cli_1 = require("@goldstack/utils-aws-cli");
|
|
7
|
-
const upload = async (params) => {
|
|
8
|
-
const user = await (0, infra_aws_1.getAWSUser)(params.userName);
|
|
9
|
-
// command run twice, once without and once with delete to ensure that
|
|
10
|
-
// users will not try to request files that no longer exist
|
|
11
|
-
// during the upload process
|
|
12
|
-
// see https://github.com/aws/aws-cli/issues/1417
|
|
13
|
-
(0, utils_aws_cli_1.awsCli)({
|
|
14
|
-
command: `s3 sync . s3://${params.bucket}${params.bucketPath}`,
|
|
15
|
-
workDir: (0, path_1.resolve)(params.localPath),
|
|
16
|
-
credentials: user,
|
|
17
|
-
region: params.region,
|
|
18
|
-
});
|
|
19
|
-
(0, utils_aws_cli_1.awsCli)({
|
|
20
|
-
command: `s3 sync . s3://${params.bucket}${params.bucketPath} --delete`,
|
|
21
|
-
workDir: (0, path_1.resolve)(params.localPath),
|
|
22
|
-
credentials: user,
|
|
23
|
-
region: params.region,
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
exports.upload = upload;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.upload = void 0;
|
|
4
|
+
const infra_aws_1 = require("@goldstack/infra-aws");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const utils_aws_cli_1 = require("@goldstack/utils-aws-cli");
|
|
7
|
+
const upload = async (params) => {
|
|
8
|
+
const user = await (0, infra_aws_1.getAWSUser)(params.userName);
|
|
9
|
+
// command run twice, once without and once with delete to ensure that
|
|
10
|
+
// users will not try to request files that no longer exist
|
|
11
|
+
// during the upload process
|
|
12
|
+
// see https://github.com/aws/aws-cli/issues/1417
|
|
13
|
+
await (0, utils_aws_cli_1.awsCli)({
|
|
14
|
+
command: `s3 sync . s3://${params.bucket}${params.bucketPath}`,
|
|
15
|
+
workDir: (0, path_1.resolve)(params.localPath),
|
|
16
|
+
credentials: user,
|
|
17
|
+
region: params.region,
|
|
18
|
+
});
|
|
19
|
+
await (0, utils_aws_cli_1.awsCli)({
|
|
20
|
+
command: `s3 sync . s3://${params.bucket}${params.bucketPath} --delete`,
|
|
21
|
+
workDir: (0, path_1.resolve)(params.localPath),
|
|
22
|
+
credentials: user,
|
|
23
|
+
region: params.region,
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
exports.upload = upload;
|
|
27
27
|
//# sourceMappingURL=utilsS3Deployment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilsS3Deployment.js","sourceRoot":"","sources":["../../src/utilsS3Deployment.ts"],"names":[],"mappings":";;;AAAA,oDAAkD;AAClD,+BAA+B;AAC/B,4DAAkD;AAU3C,MAAM,MAAM,GAAG,KAAK,EAAE,MAAsB,EAAiB,EAAE;IACpE,MAAM,IAAI,GAAG,MAAM,IAAA,sBAAU,EAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC/C,sEAAsE;IACtE,2DAA2D;IAC3D,4BAA4B;IAC5B,iDAAiD;IACjD,IAAA,sBAAM,EAAC;
|
|
1
|
+
{"version":3,"file":"utilsS3Deployment.js","sourceRoot":"","sources":["../../src/utilsS3Deployment.ts"],"names":[],"mappings":";;;AAAA,oDAAkD;AAClD,+BAA+B;AAC/B,4DAAkD;AAU3C,MAAM,MAAM,GAAG,KAAK,EAAE,MAAsB,EAAiB,EAAE;IACpE,MAAM,IAAI,GAAG,MAAM,IAAA,sBAAU,EAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC/C,sEAAsE;IACtE,2DAA2D;IAC3D,4BAA4B;IAC5B,iDAAiD;IACjD,MAAM,IAAA,sBAAM,EAAC;QACX,OAAO,EAAE,kBAAkB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,UAAU,EAAE;QAC9D,OAAO,EAAE,IAAA,cAAO,EAAC,MAAM,CAAC,SAAS,CAAC;QAClC,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC,CAAC;IACH,MAAM,IAAA,sBAAM,EAAC;QACX,OAAO,EAAE,kBAAkB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,UAAU,WAAW;QACvE,OAAO,EAAE,IAAA,cAAO,EAAC,MAAM,CAAC,SAAS,CAAC;QAClC,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC,CAAC;AACL,CAAC,CAAC;AAlBW,QAAA,MAAM,UAkBjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goldstack/utils-s3-deployment",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.38",
|
|
4
4
|
"description": "Utility for deploying files to S3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"goldstack",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"version:apply:force": "yarn version $@ && yarn version apply"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@goldstack/infra-aws": "0.3.
|
|
40
|
-
"@goldstack/utils-aws-cli": "0.3.
|
|
41
|
-
"@goldstack/utils-docker": "0.3.
|
|
42
|
-
"@goldstack/utils-sh": "0.4.
|
|
39
|
+
"@goldstack/infra-aws": "0.3.30",
|
|
40
|
+
"@goldstack/utils-aws-cli": "0.3.37",
|
|
41
|
+
"@goldstack/utils-docker": "0.3.26",
|
|
42
|
+
"@goldstack/utils-sh": "0.4.22"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@goldstack/utils-git": "0.1.29",
|