@rlyle1179/serverless-aws-batch 1.1.3 → 1.1.5

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 +19 -11
  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
  }
@@ -83,17 +96,12 @@ function buildDockerImage() {
83
96
  RUN mkdir -p /tmp/task/
84
97
  COPY ${this.serverless.service.service}.zip /tmp/task
85
98
  RUN cd /tmp/task && unzip -q ${this.serverless.service.service}.zip && rm ${this.serverless.service.service}.zip
86
- RUN mkdir -p /tmp/node16/
87
- RUN curl -sL https://develop.apricity-health.com/assets/node-v16.20.0-linux-x64.tar.gz --output /tmp/node.tar.gz
88
- RUN cd /tmp && tar xf node.tar.gz && cp -rf node-v16.20.0-linux-x64/* /tmp/node16/
99
+ ${addtionalBuildCommands}
89
100
 
90
101
  FROM justinram11/lambda:nodejs12.x
91
102
  USER root
92
103
  COPY --from=builder /tmp/task /var/task/
93
- COPY --from=builder /tmp/node16 /var/lang/
94
- ENV NODE_PATH=/var/lang/lib/node_modules:/var/task/node_modules:/var/runtime/node_modules
95
- RUN node -v
96
- ${additionalRunCommands}
104
+ ${additionalCommands}
97
105
  RUN rm -rf /tmp/*
98
106
  USER sbx_user1051
99
107
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rlyle1179/serverless-aws-batch",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "Serverless Framework Plugin for interacting with AWS Batch",
5
5
  "main": "index.js",
6
6
  "scripts": {