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
Hide 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() {
...
@@ -39,20 +39,19 @@ install_nodejs() {
local
version
=
${
1
:-
6
.x
}
local
version
=
${
1
:-
6
.x
}
local dir
=
"
$2
"
local dir
=
"
$2
"
if
needs_resolution
"
$version
"
;
then
echo
"Resolving node version
$version
..."
echo
"Resolving node version
$version
via semver.io..."
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
local
version
=
$(
curl
--silent
--get
--retry
5
--retry-max-time
15
--data-urlencode
"range=
${
version
}
"
https://semver.herokuapp.com/node/resolve
)
echo
"Unable to resolve; does that version exist?"
&&
false
fi
fi
echo
"Downloading and installing node
$version
..."
echo
"Downloading and installing node
$number
..."
local
download_url
=
"https://s3pository.heroku.com/node/v
$version
/node-v
$version
-
$os
-
$cpu
.tar.gz"
local
code
=
$(
curl
"
$url
"
-L
--silent
--fail
--retry
5
--retry-max-time
15
-o
/tmp/node.tar.gz
--write-out
"%{http_code}"
)
local
code
=
$(
curl
"
$download_url
"
--silent
--fail
--retry
5
--retry-max-time
15
-o
/tmp/node.tar.gz
--write-out
"%{http_code}"
)
if
[
"
$code
"
!=
"200"
]
;
then
if
[
"
$code
"
!=
"200"
]
;
then
echo
"Unable to download node
$version
; does it exist?
"
&&
false
echo
"Unable to download node
:
$code
"
&&
false
fi
fi
tar
xzf /tmp/node.tar.gz
-C
/tmp
tar
xzf /tmp/node.tar.gz
-C
/tmp
rm
-rf
$dir
/
*
rm
-rf
$dir
/
*
mv
/tmp/node-v
$
version
-
$os
-
$cpu
/
*
$dir
mv
/tmp/node-v
$
number
-
$os
-
$cpu
/
*
$dir
chmod
+x
$dir
/bin/
*
chmod
+x
$dir
/bin/
*
}
}
...
...
test/run
View file @
9ec30558
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
testNoVersion
()
{
testNoVersion
()
{
compile
"no-version"
compile
"no-version"
assertCaptured
"engines.node (package.json): unspecified"
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."
assertCaptured
"Downloading and installing node 6."
assertCapturedSuccess
assertCapturedSuccess
}
}
...
@@ -344,8 +344,8 @@ testConcurrencyCustomLimit() {
...
@@ -344,8 +344,8 @@ testConcurrencyCustomLimit() {
testInvalidNode
()
{
testInvalidNode
()
{
compile
"invalid-node"
compile
"invalid-node"
assertCaptured
"
Downloading and installing node
0.11.333"
assertCaptured
"
Resolving node version
0.11.333"
assertCaptured
"Unable to
download node 0.11.333
"
assertCaptured
"Unable to
resolve
"
assertCapturedError
assertCapturedError
}
}
...
@@ -405,7 +405,7 @@ testIoJs() {
...
@@ -405,7 +405,7 @@ testIoJs() {
testSpecificVersion
()
{
testSpecificVersion
()
{
compile
"specific-version"
compile
"specific-version"
assert
Not
Captured
"Resolving node version"
assertCaptured
"Resolving node version"
assertCaptured
"Downloading and installing node 0.10.29"
assertCaptured
"Downloading and installing node 0.10.29"
assertCaptured
"Using default npm version: 1.4.14"
assertCaptured
"Using default npm version: 1.4.14"
assertCapturedSuccess
assertCapturedSuccess
...
@@ -420,7 +420,7 @@ testStableVersion() {
...
@@ -420,7 +420,7 @@ testStableVersion() {
testUnstableVersion
()
{
testUnstableVersion
()
{
compile
"unstable-version"
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."
assertCaptured
"Downloading and installing node 0.11."
assertCapturedSuccess
assertCapturedSuccess
}
}
...
@@ -490,7 +490,7 @@ testInfoEmpty() {
...
@@ -490,7 +490,7 @@ testInfoEmpty() {
testDangerousRangeStar
()
{
testDangerousRangeStar
()
{
compile
"dangerous-range-star"
compile
"dangerous-range-star"
assertCaptured
"Dangerous semver range"
assertCaptured
"Dangerous semver range"
assertCaptured
"Resolving node version *
via semver.io
"
assertCaptured
"Resolving node version *"
assertCaptured
"Downloading and installing node 8."
assertCaptured
"Downloading and installing node 8."
assertCapturedError
assertCapturedError
}
}
...
@@ -498,14 +498,14 @@ testDangerousRangeStar() {
...
@@ -498,14 +498,14 @@ testDangerousRangeStar() {
testDangerousRangeGreaterThan
()
{
testDangerousRangeGreaterThan
()
{
compile
"dangerous-range-greater-than"
compile
"dangerous-range-greater-than"
assertCaptured
"Dangerous semver range"
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."
assertCaptured
"Downloading and installing node 8."
assertCapturedError
assertCapturedError
}
}
testRangeWithSpace
()
{
testRangeWithSpace
()
{
compile
"range-with-space"
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."
assertCaptured
"Downloading and installing node 8."
assertCapturedSuccess
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