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
9ec30558
Commit
9ec30558
authored
Jul 24, 2017
by
Jeremy Morrell
Committed by
GitHub
Jul 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch nodejs install over to using nodebin service (#451)
Switch nodejs install over to using nodebin
parent
c0ecab66
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
16 deletions
+15
-16
binaries.sh
lib/binaries.sh
+7
-8
run
test/run
+8
-8
No files found.
lib/binaries.sh
View file @
9ec30558
...
...
@@ -39,20 +39,19 @@ install_nodejs() {
local
version
=
${
1
:-
6
.x
}
local dir
=
"
$2
"
if
needs_resolution
"
$version
"
;
then
echo
"Resolving node version
$version
via semver.io..."
local
version
=
$(
curl
--silent
--get
--retry
5
--retry-max-time
15
--data-urlencode
"range=
${
version
}
"
https://semver.herokuapp.com/node/resolve
)
echo
"Resolving node version
$version
..."
if
!
read
number url < <
(
curl
--silent
--get
--retry
5
--retry-max-time
15
--data-urlencode
"range=
$version
"
"https://nodebin.herokai.com/v1/node/
$platform
/latest.txt"
)
;
then
echo
"Unable to resolve; does that version exist?"
&&
false
fi
echo
"Downloading and installing node
$version
..."
local
download_url
=
"https://s3pository.heroku.com/node/v
$version
/node-v
$version
-
$os
-
$cpu
.tar.gz"
local
code
=
$(
curl
"
$download_url
"
--silent
--fail
--retry
5
--retry-max-time
15
-o
/tmp/node.tar.gz
--write-out
"%{http_code}"
)
echo
"Downloading and installing node
$number
..."
local
code
=
$(
curl
"
$url
"
-L
--silent
--fail
--retry
5
--retry-max-time
15
-o
/tmp/node.tar.gz
--write-out
"%{http_code}"
)
if
[
"
$code
"
!=
"200"
]
;
then
echo
"Unable to download node
$version
; does it exist?
"
&&
false
echo
"Unable to download node
:
$code
"
&&
false
fi
tar
xzf /tmp/node.tar.gz
-C
/tmp
rm
-rf
$dir
/
*
mv
/tmp/node-v
$
version
-
$os
-
$cpu
/
*
$dir
mv
/tmp/node-v
$
number
-
$os
-
$cpu
/
*
$dir
chmod
+x
$dir
/bin/
*
}
...
...
test/run
View file @
9ec30558
...
...
@@ -4,7 +4,7 @@
testNoVersion
()
{
compile
"no-version"
assertCaptured
"engines.node (package.json): unspecified"
assertCaptured
"Resolving node version 6.x
via semver.io
"
assertCaptured
"Resolving node version 6.x"
assertCaptured
"Downloading and installing node 6."
assertCapturedSuccess
}
...
...
@@ -344,8 +344,8 @@ testConcurrencyCustomLimit() {
testInvalidNode
()
{
compile
"invalid-node"
assertCaptured
"
Downloading and installing node
0.11.333"
assertCaptured
"Unable to
download node 0.11.333
"
assertCaptured
"
Resolving node version
0.11.333"
assertCaptured
"Unable to
resolve
"
assertCapturedError
}
...
...
@@ -405,7 +405,7 @@ testIoJs() {
testSpecificVersion
()
{
compile
"specific-version"
assert
Not
Captured
"Resolving node version"
assertCaptured
"Resolving node version"
assertCaptured
"Downloading and installing node 0.10.29"
assertCaptured
"Using default npm version: 1.4.14"
assertCapturedSuccess
...
...
@@ -420,7 +420,7 @@ testStableVersion() {
testUnstableVersion
()
{
compile
"unstable-version"
assertCaptured
"Resolving node version 0.11.x
via semver.io
"
assertCaptured
"Resolving node version 0.11.x"
assertCaptured
"Downloading and installing node 0.11."
assertCapturedSuccess
}
...
...
@@ -490,7 +490,7 @@ testInfoEmpty() {
testDangerousRangeStar
()
{
compile
"dangerous-range-star"
assertCaptured
"Dangerous semver range"
assertCaptured
"Resolving node version *
via semver.io
"
assertCaptured
"Resolving node version *"
assertCaptured
"Downloading and installing node 8."
assertCapturedError
}
...
...
@@ -498,14 +498,14 @@ testDangerousRangeStar() {
testDangerousRangeGreaterThan
()
{
compile
"dangerous-range-greater-than"
assertCaptured
"Dangerous semver range"
assertCaptured
"Resolving node version >0.4
via semver.io
"
assertCaptured
"Resolving node version >0.4"
assertCaptured
"Downloading and installing node 8."
assertCapturedError
}
testRangeWithSpace
()
{
compile
"range-with-space"
assertCaptured
"Resolving node version >= 0.8.x
via semver.io
"
assertCaptured
"Resolving node version >= 0.8.x"
assertCaptured
"Downloading and installing node 8."
assertCapturedSuccess
}
...
...
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