@goldstack/utils-s3-deployment 0.3.37 → 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 +1 @@
1
- {"version":3,"file":"utilsS3Deployment.d.ts","sourceRoot":"","sources":["../../src/utilsS3Deployment.ts"],"names":[],"mappings":"AAIA,UAAU,cAAc;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,MAAM,WAAkB,cAAc,KAAG,QAAQ,IAAI,CAyBjE,CAAC"}
1
+ {"version":3,"file":"utilsS3Deployment.d.ts","sourceRoot":"","sources":["../../src/utilsS3Deployment.ts"],"names":[],"mappings":"AAIA,UAAU,cAAc;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,MAAM,WAAkB,cAAc,KAAG,QAAQ,IAAI,CAkBjE,CAAC"}
@@ -1,32 +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
- const dest = `s3://${params.bucket}${params.bucketPath}`;
10
- const source = (0, path_1.resolve)(params.localPath);
11
- console.log(`Uploading [${source}] to [${dest}]`);
12
- // command run twice, once without and once with delete to ensure that
13
- // users will not try to request files that no longer exist
14
- // during the upload process
15
- // see https://github.com/aws/aws-cli/issues/1417
16
- await (0, utils_aws_cli_1.awsCli)({
17
- command: `s3 sync . ${dest}`,
18
- workDir: source,
19
- credentials: user,
20
- region: params.region,
21
- options: { silent: false },
22
- });
23
- await (0, utils_aws_cli_1.awsCli)({
24
- command: `s3 sync . ${dest} --delete`,
25
- workDir: source,
26
- credentials: user,
27
- region: params.region,
28
- options: { silent: false },
29
- });
30
- };
31
- 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;
32
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;IAE/C,MAAM,IAAI,GAAG,QAAQ,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IACzD,MAAM,MAAM,GAAG,IAAA,cAAO,EAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAEzC,OAAO,CAAC,GAAG,CAAC,cAAc,MAAM,SAAS,IAAI,GAAG,CAAC,CAAC;IAClD,sEAAsE;IACtE,2DAA2D;IAC3D,4BAA4B;IAC5B,iDAAiD;IACjD,MAAM,IAAA,sBAAM,EAAC;QACX,OAAO,EAAE,aAAa,IAAI,EAAE;QAC5B,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;KAC3B,CAAC,CAAC;IACH,MAAM,IAAA,sBAAM,EAAC;QACX,OAAO,EAAE,aAAa,IAAI,WAAW;QACrC,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;KAC3B,CAAC,CAAC;AACL,CAAC,CAAC;AAzBW,QAAA,MAAM,UAyBjB"}
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.37",
3
+ "version": "0.3.38",
4
4
  "description": "Utility for deploying files to S3",
5
5
  "keywords": [
6
6
  "goldstack",
@@ -36,8 +36,8 @@
36
36
  "version:apply:force": "yarn version $@ && yarn version apply"
37
37
  },
38
38
  "dependencies": {
39
- "@goldstack/infra-aws": "0.3.29",
40
- "@goldstack/utils-aws-cli": "0.3.36",
39
+ "@goldstack/infra-aws": "0.3.30",
40
+ "@goldstack/utils-aws-cli": "0.3.37",
41
41
  "@goldstack/utils-docker": "0.3.26",
42
42
  "@goldstack/utils-sh": "0.4.22"
43
43
  },