FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
docker-lambda/base/dump-ruby25.rb at python3.7 · chrisoverzero/docker-lambda · GitHub
chrisoverzero
/
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-ruby25.rb
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (23 loc) · 748 Bytes
Breadcrumbs
docker-lambda
/
base
/
dump-ruby25.rb
Copy path
File metadata and controls
31 lines (23 loc) · 748 Bytes
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
require
'json'
require
'aws-sdk-s3'
S3_CLIENT
=
Aws
::
S3
::
Client
.
new
(
{
region
:
"us-east-1"
}
)
def
lambda_handler
(
event
:
,
context
:
)
filename
=
'ruby2.5.tgz'
puts
`tar -cpzf /tmp/
#{
filename
}
--numeric-owner --ignore-failed-read /var/runtime /var/lang /var/rapid`
File
.
open
(
"/tmp/
#{
filename
}
"
,
'rb'
)
do
|
file
|
S3_CLIENT
.
put_object
(
{
body
:
file
,
bucket
:
'lambci'
,
key
:
"fs/
#{
filename
}
"
,
acl
:
'public-read'
,
}
)
end
info
=
{
'ENV'
=>
ENV
.
to_hash
,
'context'
=>
context
.
instance_variables
.
each_with_object
(
{
}
)
{
|
k
,
h
|
h
[
k
]
=
context
.
instance_variable_get
k
}
,
'ps aux'
=>
`ps aux`
,
'proc environ'
=>
`xargs -n 1 -0 < /proc/1/environ`
,
}
print
JSON
.
pretty_generate
(
info
)
return
info
end
Back
|
FazBrowse Home
|
New Git URL