@rlyle1179/serverless-aws-batch 1.1.2 → 1.1.4

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.
Files changed (2) hide show
  1. package/lib/docker.js +20 -6
  2. package/package.json +1 -1
package/lib/docker.js CHANGED
@@ -61,15 +61,28 @@ function buildDockerImage() {
61
61
  this.serverless.cli.log(`Building docker image: "${image}"...`);
62
62
 
63
63
  // Get any additional run commands we'd like to include in the docker image
64
- let additionalRunCommands = "";
64
+ let addtionalBuildCommands = "";
65
65
  if (this.serverless.service.custom
66
66
  && this.serverless.service.custom.awsBatch
67
- && this.serverless.service.custom.awsBatch.additionalDockerRunCommands) {
67
+ && this.serverless.service.custom.awsBatch.addtionalBuildCommands) {
68
68
 
69
69
  _.forEach(
70
- this.serverless.service.custom.awsBatch.additionalDockerRunCommands,
70
+ this.serverless.service.custom.awsBatch.addtionalBuildCommands,
71
71
  runCommand => {
72
- additionalRunCommands += `RUN ${runCommand}\n`;
72
+ addtionalBuildCommands += `${runCommand}\n`;
73
+ }
74
+ )
75
+ }
76
+
77
+ let additionalCommands = "";
78
+ if (this.serverless.service.custom
79
+ && this.serverless.service.custom.awsBatch
80
+ && this.serverless.service.custom.awsBatch.additionalCommands) {
81
+
82
+ _.forEach(
83
+ this.serverless.service.custom.awsBatch.additionalCommands,
84
+ runCommand => {
85
+ additionalCommands += `${runCommand}\n`;
73
86
  }
74
87
  )
75
88
  }
@@ -86,16 +99,17 @@ function buildDockerImage() {
86
99
  RUN mkdir -p /tmp/node16/
87
100
  RUN curl -sL https://develop.apricity-health.com/assets/node-v16.20.0-linux-x64.tar.gz --output /tmp/node.tar.gz
88
101
  RUN cd /tmp && tar xf node.tar.gz && cp -rf node-v16.20.0-linux-x64/* /tmp/node16/
89
-
102
+ ${addtionalBuildCommands}
103
+
90
104
  FROM justinram11/lambda:nodejs12.x
91
105
  USER root
92
106
  COPY --from=builder /tmp/task /var/task/
93
107
  COPY --from=builder /tmp/node16 /var/lang/
94
108
  ENV NODE_PATH=/var/lang/lib/node_modules:/var/task/node_modules:/var/runtime/node_modules
95
109
  RUN node -v
110
+ ${additionalCommands}
96
111
  RUN rm -rf /tmp/*
97
112
  USER sbx_user1051
98
- ${additionalRunCommands}
99
113
  `;
100
114
 
101
115
  const servicePath = this.serverless.config.servicePath || '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rlyle1179/serverless-aws-batch",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Serverless Framework Plugin for interacting with AWS Batch",
5
5
  "main": "index.js",
6
6
  "scripts": {