FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit/utils/uploadOpenSSL.mjs at napi · Chen-Software/nodegit · GitHub
Chen-Software
nodegit
Repository navigation
Code
Pull requests
23
(23)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodegit
/
utils
/
uploadOpenSSL.mjs
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (27 loc) · 1.07 KB
Breadcrumbs
nodegit
/
utils
/
uploadOpenSSL.mjs
Copy path
File metadata and controls
32 lines (27 loc) · 1.07 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
import
aws
from
'aws-sdk'
;
import
fs
from
"fs"
;
import
path
from
"path"
;
import
pkgJson
from
'../package.json'
with
{
type
:
"json"
}
;
import
{
getOpenSSLPackagePath
,
getOpenSSLPackageName
}
from
'./acquireOpenSSL.mjs'
;
const
s3
=
new
aws
.
S3
(
)
;
const
uploadBinaryToS3
=
(
fileName
,
bucketName
,
pathToFile
)
=>
s3
.
upload
(
{
Body
:
fs
.
createReadStream
(
pathToFile
)
,
Bucket
:
bucketName
,
Key
:
fileName
,
ACL
:
"public-read"
}
)
.
promise
(
)
;
export
const
uploadOpenSSL
=
async
(
)
=>
{
const
packageName
=
path
.
basename
(
getOpenSSLPackageName
(
)
)
;
const
packagePath
=
getOpenSSLPackagePath
(
)
;
console
.
log
(
`Uploading
${
packagePath
}
to s3://
${
pkgJson
.
binary
.
bucket_name
}
/
${
packageName
}
`
)
;
await
uploadBinaryToS3
(
packageName
,
pkgJson
.
binary
.
bucket_name
,
packagePath
)
;
const
sha256PackageName
=
`
${
packageName
}
.sha256`
;
await
uploadBinaryToS3
(
sha256PackageName
,
pkgJson
.
binary
.
bucket_name
,
`
${
packagePath
}
.sha256`
)
;
}
;
if
(
process
.
argv
[
1
]
===
import
.
meta
.
filename
)
{
uploadOpenSSL
(
)
.
catch
(
(
error
)
=>
{
console
.
error
(
'Push to S3 failed: '
,
error
)
;
process
.
exit
(
1
)
;
}
)
;
}
Back
|
FazBrowse Home
|
New Git URL