FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
docker-lambda/base/dump-nodejs.js at master · DataQuery/docker-lambda · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
DataQuery
/
docker-lambda
Public
forked from
lambci/docker-lambda
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
docker-lambda
/
base
/
dump-nodejs.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
88 lines (79 loc) · 3.04 KB
Breadcrumbs
docker-lambda
/
base
/
dump-nodejs.js
Copy path
File metadata and controls
88 lines (79 loc) · 3.04 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
var
fs
=
require
(
'fs'
)
var
childProcess
=
require
(
'child_process'
)
var
AWS
=
require
(
'aws-sdk'
)
var
s3
=
new
AWS
.
S3
(
)
exports
.
handler
=
function
(
event
,
context
)
{
var
filename
=
'nodejs.tgz'
var
cmd
=
'tar -cpzf /tmp/'
+
filename
+
' --numeric-owner --ignore-failed-read /var/runtime /var/lang'
var
child
=
childProcess
.
spawn
(
'sh'
,
[
'-c'
,
event
.
cmd
||
cmd
]
)
child
.
stdout
.
setEncoding
(
'utf8'
)
child
.
stderr
.
setEncoding
(
'utf8'
)
child
.
stdout
.
on
(
'data'
,
console
.
log
.
bind
(
console
)
)
child
.
stderr
.
on
(
'data'
,
console
.
error
.
bind
(
console
)
)
child
.
on
(
'error'
,
context
.
done
.
bind
(
context
)
)
child
.
on
(
'close'
,
function
(
)
{
if
(
event
.
cmd
)
return
context
.
done
(
)
console
.
log
(
'Zipping done! Uploading...'
)
s3
.
upload
(
{
Bucket
:
'lambci'
,
Key
:
'fs/'
+
filename
,
Body
:
fs
.
createReadStream
(
'/tmp/'
+
filename
)
,
ACL
:
'public-read'
,
}
,
function
(
err
,
data
)
{
if
(
err
)
return
context
.
done
(
err
)
console
.
log
(
'Uploading done!'
)
console
.
log
(
process
.
execPath
)
console
.
log
(
process
.
execArgv
)
console
.
log
(
process
.
argv
)
console
.
log
(
process
.
cwd
(
)
)
console
.
log
(
__filename
)
console
.
log
(
process
.
env
)
console
.
log
(
context
)
context
.
done
(
)
}
)
}
)
}
// /usr/bin/node
// [ '--max-old-space-size=1229', '--max-new-space-size=153', '--max-executable-size=153', '--expose-gc' ]
// [ '/usr/bin/node', '/var/runtime/node_modules/awslambda/bin/awslambda' ]
// /var/task
// /var/task/index.js
// {
// PATH: '/usr/local/bin:/usr/bin/:/bin:/opt/bin',
// LANG: 'en_US.UTF-8',
// LD_LIBRARY_PATH: '/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib',
// LAMBDA_TASK_ROOT: '/var/task',
// LAMBDA_RUNTIME_DIR: '/var/runtime',
// AWS_REGION: 'us-east-1',
// AWS_DEFAULT_REGION: 'us-east-1',
// AWS_LAMBDA_LOG_GROUP_NAME: '/aws/lambda/dump-node010',
// AWS_LAMBDA_LOG_STREAM_NAME: '2017/03/23/[$LATEST]c079a84d433534434534ef0ddc99d00f',
// AWS_LAMBDA_FUNCTION_NAME: 'dump-node010',
// AWS_LAMBDA_FUNCTION_MEMORY_SIZE: '1536',
// AWS_LAMBDA_FUNCTION_VERSION: '$LATEST',
// _AWS_XRAY_DAEMON_ADDRESS: '169.254.79.2',
// _AWS_XRAY_DAEMON_PORT: '2000',
// AWS_XRAY_DAEMON_ADDRESS: '169.254.79.2:2000',
// AWS_XRAY_CONTEXT_MISSING: 'LOG_ERROR',
// _X_AMZN_TRACE_ID: 'Root=1-dc99d00f-c079a84d433534434534ef0d;Parent=91ed514f1e5c03b2;Sampled=0',
// AWS_EXECUTION_ENV: 'AWS_Lambda_nodejs',
// NODE_PATH: '/var/runtime:/var/task:/var/runtime/node_modules',
// AWS_ACCESS_KEY_ID: 'ASIA...C37A',
// AWS_SECRET_ACCESS_KEY: 'JZvD...BDZ4L',
// AWS_SESSION_TOKEN: 'FQoDYXdzEMb//////////...0oog7bzuQU='
// }
// {
// awsRequestId: '1fcdc383-a9e8-4228-bc1c-8db17629e183',
// invokeid: '1fcdc383-a9e8-4228-bc1c-8db17629e183',
// logGroupName: '/aws/lambda/dump-node010',
// logStreamName: '2017/03/23/[$LATEST]c079a84d433534434534ef0ddc99d00f',
// functionName: 'dump-node010',
// memoryLimitInMB: '1536',
// functionVersion: '$LATEST',
// invokedFunctionArn: 'arn:aws:lambda:us-east-1:879423879432:function:dump-node010',
// getRemainingTimeInMillis: [Function],
// succeed: [Function],
// fail: [Function],
// done: [Function]
// }
Back
|
FazBrowse Home
|
New Git URL