codedeploy-scripts
Advanced tools
| "use strict"; | ||
| class NodeDeployment extends require("./deployment") { | ||
| constructor(options) { | ||
| super(options); | ||
| var Node = require("./node"); | ||
| this.node = new Node(this.appName, options.nodePort || 5000, options.serverScript || "server.js"); | ||
| } | ||
| BeforeInstall() { | ||
| this.node.stop(); | ||
| } | ||
| AfterInstall() { | ||
| this.writeSecretFile(this.appName + "/.env", ".env"); | ||
| } | ||
| ApplicationStart() { | ||
| this.node.start(); | ||
| } | ||
| } | ||
| module.exports = NodeDeployment; |
+1
-1
@@ -5,3 +5,3 @@ { | ||
| "description": "AWS CodeDeploy lifecycle scripts using ES6 to deploy a node app to EC2", | ||
| "version": "0.0.9", | ||
| "version": "1.0.0", | ||
| "keywords": [ | ||
@@ -8,0 +8,0 @@ "AWS", |
+19
-8
@@ -7,2 +7,4 @@ # CodeDeploy Scripts | ||
| See https://github.com/tqc/react-demo for a minimal working example. | ||
| ## Usage | ||
@@ -21,3 +23,3 @@ | ||
| files: | ||
| + source: / | ||
| - source: / | ||
| destination: /apps/appname | ||
@@ -29,12 +31,12 @@ hooks: | ||
| BeforeInstall: | ||
| + location: deployment.js | ||
| - location: deployment.js | ||
| timeout: 180 | ||
| AfterInstall: | ||
| + location: deployment.js | ||
| - location: deployment.js | ||
| timeout: 180 | ||
| ApplicationStart: | ||
| + location: deployment.js | ||
| - location: deployment.js | ||
| timeout: 180 | ||
| ValidateService: | ||
| + location: deployment.js | ||
| - location: deployment.js | ||
| timeout: 180 | ||
@@ -57,4 +59,10 @@ | ||
| domains: "deploytest.example.com", | ||
| // files in these folders will be served from nginx without calling the node server | ||
| buildFolder: "build", | ||
| staticFolder: "static" | ||
| staticFolder: "static", | ||
| // files in s3 my-secret-bucket/deploytest will be copied to /apps/deploytest; suitable for ssh keys and | ||
| // config files which can't be part of the code deployment | ||
| secretBucket: "my-secret-bucket", | ||
| // if true, nginx will be set to serve https using /apps/deploytest/deploytest.[crt|key] | ||
| useSSL: false | ||
| }); | ||
@@ -70,4 +78,7 @@ deployment.run(); | ||
| * The target is a standard Amazon Linux instance | ||
| * io.js is installed as /usr/local/bin/node | ||
| * node.js is installed | ||
| * The app will be installed to /apps/appname | ||
| * static files are in /apps/appname/static and /apps/appname/build | ||
| A userdata script that will sufficiently configure a standard Amazon Linux instance can be found at https://github.com/tqc/ec2scripts/blob/master/userdata-app.sh | ||
| Manual configuration is required for the security settings - the machine role will need the standard CodeDeploy access settings, plus access to the secrets bucket if used. |
+2
-1
@@ -6,3 +6,4 @@ | ||
| Deployment: require("./deployment"), | ||
| SimpleDeployment: require("./simpledeployment") | ||
| SimpleDeployment: require("./simpledeployment"), | ||
| NodeDeployment: require("./nodedeployment"), | ||
| }; |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
13371
10.96%15
7.14%162
13.29%1
-50%80
15.94%