Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
heroku-buildpack-nodejs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
heroku-buildpack-nodejs
Commits
c9591745
Commit
c9591745
authored
Oct 13, 2011
by
David Dollar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up aws config env vars
parent
c47ba39d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
14 deletions
+35
-14
compile
bin/compile
+4
-3
s3
support/aws/s3
+4
-4
package_node
support/package_node
+11
-6
package_npm
support/package_npm
+16
-1
No files found.
bin/compile
View file @
c9591745
...
...
@@ -23,6 +23,7 @@ function indent() {
NODE_VERSION
=
"0.4.7"
NPM_VERSION
=
"1.0.94"
SCONS_VERSION
=
"1.2.0"
S3_BUCKET
=
"language-pack-nodejs"
# parse and derive params
BUILD_DIR
=
$1
...
...
@@ -32,9 +33,9 @@ CACHE_STORE_DIR=$CACHE_DIR"/node_modules/$NPM_VERSION"
CACHE_TARGET_DIR
=
$BUILD_DIR
"/node_modules"
# s3 packages
NODE_PACKAGE
=
"http://
language-pack-nodejs
.s3.amazonaws.com/nodejs-
${
NODE_VERSION
}
.tgz"
NPM_PACKAGE
=
"http://
language-pack-nodejs
.s3.amazonaws.com/npm-
${
NPM_VERSION
}
.tgz"
SCONS_PACKAGE
=
"http://
language-pack-nodejs
.s3.amazonaws.com/scons-
${
SCONS_VERSION
}
.tgz"
NODE_PACKAGE
=
"http://
${
S3_BUCKET
}
.s3.amazonaws.com/nodejs-
${
NODE_VERSION
}
.tgz"
NPM_PACKAGE
=
"http://
${
S3_BUCKET
}
.s3.amazonaws.com/npm-
${
NPM_VERSION
}
.tgz"
SCONS_PACKAGE
=
"http://
${
S3_BUCKET
}
.s3.amazonaws.com/scons-
${
SCONS_VERSION
}
.tgz"
# vendor directories
VENDORED_NODE
=
"
$(
mktmpdir node
)
"
...
...
support/aws/s3
View file @
c9591745
...
...
@@ -24,10 +24,10 @@ check_or_die() {
# Bail if we do not.
check_s3
()
{
local
sak x
for
x
in
S3_ACCESS_KEY_ID S3_SECRET_ACCESS_KEY
;
do
for
x
in
AWS_ID AWS_SECRET
;
do
check_or_die
${
x
}
;
done
sak
=
"
$(
echo
-n
$
S3_SECRET_ACCESS_KEY
|
wc
-c
)
"
sak
=
"
$(
echo
-n
$
AWS_SECRET
|
wc
-c
)
"
((
${
sak
%%[!0-9 ]*
}
==
40
))
||
\
die
"S3 Secret Access Key is not exactly 40 bytes long. Please fix it."
}
...
...
@@ -98,7 +98,7 @@ s3_signature_string() {
printf
"%s
\n
%s
\n
%s
\n
%s
\n
%s
\n
%s%s"
\
"
${
verb
}
"
"
${
md5
}
"
"
${
mime
}
"
"
${
date
}
"
\
"
${
headers
}
"
"
${
bucket
}
"
"
${
resource
}
"
|
\
hmac sha1
"
${
S3_SECRET_ACCESS_KEY
}
"
| openssl
base64
-e
-a
hmac sha1
"
${
AWS_SECRET
}
"
| openssl
base64
-e
-a
}
# cheesy, but it is the best way to have multiple headers.
...
...
@@ -147,7 +147,7 @@ s3_curl() {
date
=
"
$(
TZ
=
UTC
date
'+%a, %e %b %Y %H:%M:%S %z'
)
"
sig
=
$(
s3_signature_string
${
1
}
"
${
date
}
"
"
${
bucket
}
"
"
${
remote
}
"
"
${
md5
}
"
""
"x-amz-acl:public-read"
)
headers[
${#
headers
[@]
}
]=
"Authorization: AWS
${
S3_ACCESS_KEY
_ID
}
:
${
sig
}
"
headers[
${#
headers
[@]
}
]=
"Authorization: AWS
${
AWS
_ID
}
:
${
sig
}
"
headers[
${#
headers
[@]
}
]=
"Date:
${
date
}
"
[[
${
md5
}
]]
&&
headers[
${#
headers
[@]
}
]=
"Content-MD5:
${
md5
}
"
curl
${
arg
}
"
${
inout
}
"
${
stdopts
}
-o
-
-K
<
(
curl_headers
"
${
headers
[@]
}
"
)
\
...
...
support/package_node
View file @
c9591745
...
...
@@ -9,13 +9,18 @@ if [ "$node_version" == "" ]; then
exit
1
fi
if
[
"
$
S3_ACCESS_KEY
_ID
"
==
""
]
;
then
echo
"must set
S3_ACCESS_KEY
_ID"
if
[
"
$
AWS
_ID
"
==
""
]
;
then
echo
"must set
AWS
_ID"
exit
1
fi
if
[
"
$S3_SECRET_ACCESS_KEY
"
==
""
]
;
then
echo
"must set S3_SECRET_ACCESS_KEY"
if
[
"
$AWS_SECRET
"
==
""
]
;
then
echo
"must set AWS_SECRET"
exit
1
fi
if
[
"
$S3_BUCKET
"
==
""
]
;
then
echo
"must set S3_BUCKET"
exit
1
fi
...
...
@@ -38,7 +43,7 @@ pushd node-v${node_version}
vulcan build
-v
-o
$tempdir
/node-
${
node_version
}
.tgz
# upload nodejs to s3
$basedir
/aws/s3 put
language-pack-nodejs
\
$basedir
/aws/s3 put
$S3_BUCKET
\
nodejs-
${
node_version
}
.tgz
$tempdir
/node-
${
node_version
}
.tgz
# go into scons
...
...
@@ -49,5 +54,5 @@ scons_version=$(ls | grep "scons-local" | cut -d- -f3)
tar
czvf
$tempdir
/scons-
${
scons_version
}
.tgz
*
# upload scons to s3
$basedir
/aws/s3 put
language-pack-nodejs
\
$basedir
/aws/s3 put
$S3_BUCKET
\
scons-
${
scons_version
}
.tgz
$tempdir
/scons-
${
scons_version
}
.tgz
support/package_npm
View file @
c9591745
...
...
@@ -9,6 +9,21 @@ if [ "$npm_version" == "" ]; then
exit
1
fi
if
[
"
$AWS_ID
"
==
""
]
;
then
echo
"must set AWS_ID"
exit
1
fi
if
[
"
$AWS_SECRET
"
==
""
]
;
then
echo
"must set AWS_SECRET"
exit
1
fi
if
[
"
$S3_BUCKET
"
==
""
]
;
then
echo
"must set S3_BUCKET"
exit
1
fi
basedir
=
"
$(
cd
-P
"
$(
dirname
"
$0
"
)
"
&&
pwd
)
"
# make a temp directory
...
...
@@ -31,5 +46,5 @@ git submodule update --init --recursive
tar
czvf
$tempdir
/npm-
${
npm_version
}
.tgz
*
# upload npm to s3
$basedir
/aws/s3 put
language-pack-nodejs
\
$basedir
/aws/s3 put
$S3_BUCKET
\
npm-
${
npm_version
}
.tgz
$tempdir
/npm-
${
npm_version
}
.tgz
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment