@rlyle1179/serverless-aws-batch 1.0.36 → 1.0.39

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.
@@ -7,7 +7,7 @@ const path = require('path');
7
7
  const _ = require('lodash');
8
8
  var util = require('util');
9
9
 
10
- const lifeCyclePolicies = JSON.stringify({
10
+ const lifeCyclePolicies = {
11
11
  "rules": [
12
12
  {
13
13
  "rulePriority": 1,
@@ -23,50 +23,52 @@ const lifeCyclePolicies = JSON.stringify({
23
23
  }
24
24
  }
25
25
  ]
26
- });
26
+ };
27
27
 
28
28
  /**
29
29
  * Adds the ECR repository to the "create" template so that we have a repository we can upload our docker image to
30
30
  * during deployment.
31
31
  */
32
32
  function generateCoreTemplate() {
33
- // Setup our ECR Repository to delete untagged images after 1 day
34
- const ecrTemplate = `
33
+ // Setup our ECR Repository to delete untagged images after 1 day
34
+ const ecrTemplate = `
35
35
  {
36
36
  "Type" : "AWS::ECR::Repository",
37
37
  "Properties" : {
38
38
  "LifecyclePolicy" : {
39
- "LifecyclePolicyText" : "${JSON.stringify(lifeCyclePolicies)}"
39
+ "LifecyclePolicyText" : ${JSON.stringify(JSON.stringify(lifeCyclePolicies))}
40
40
  },
41
41
  "RepositoryName" : "${this.provider.naming.getECRRepositoryName()}"
42
42
  }
43
43
  }
44
44
  `;
45
45
 
46
- const newECRObject = {
47
- [this.provider.naming.getECRLogicalId()]: JSON.parse(ecrTemplate)
48
- };
46
+ console.log("ecrTemplate:", ecrTemplate );
49
47
 
50
- // Add it to our initial compiled cloud formation templates
51
- _.merge(
52
- this.serverless.service.provider.compiledCloudFormationTemplate.Resources,
53
- newECRObject
54
- );
48
+ const newECRObject = {
49
+ [this.provider.naming.getECRLogicalId()]: JSON.parse(ecrTemplate)
50
+ };
55
51
 
56
- // Then write it back out to the file
57
- const coreTemplateFileName = this.provider.naming.getCoreTemplateFileName();
52
+ // Add it to our initial compiled cloud formation templates
53
+ _.merge(
54
+ this.serverless.service.provider.compiledCloudFormationTemplate.Resources,
55
+ newECRObject
56
+ );
58
57
 
59
- const coreTemplateFilePath = path.join(this.serverless.config.servicePath,
60
- '.serverless',
61
- coreTemplateFileName);
58
+ // Then write it back out to the file
59
+ const coreTemplateFileName = this.provider.naming.getCoreTemplateFileName();
62
60
 
63
- this.serverless.utils.writeFileSync(coreTemplateFilePath,
64
- this.serverless.service.provider.compiledCloudFormationTemplate);
61
+ const coreTemplateFilePath = path.join(this.serverless.config.servicePath,
62
+ '.serverless',
63
+ coreTemplateFileName);
65
64
 
66
- this.serverless.service.provider.coreCloudFormationTemplate =
67
- _.cloneDeep(this.serverless.service.provider.compiledCloudFormationTemplate);
65
+ this.serverless.utils.writeFileSync(coreTemplateFilePath,
66
+ this.serverless.service.provider.compiledCloudFormationTemplate);
68
67
 
69
- return BbPromise.resolve();
68
+ this.serverless.service.provider.coreCloudFormationTemplate =
69
+ _.cloneDeep(this.serverless.service.provider.compiledCloudFormationTemplate);
70
+
71
+ return BbPromise.resolve();
70
72
  }
71
73
 
72
74
  module.exports = { generateCoreTemplate };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rlyle1179/serverless-aws-batch",
3
- "version": "1.0.36",
3
+ "version": "1.0.39",
4
4
  "description": "Serverless Framework Plugin for interacting with AWS Batch",
5
5
  "main": "index.js",
6
6
  "scripts": {