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
11721a03
Unverified
Commit
11721a03
authored
May 02, 2019
by
Jeremy Morrell
Committed by
GitHub
May 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compare new semver logic for node binaries (#663)
parent
21a7e7ba
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
binaries.sh
lib/binaries.sh
+21
-4
run
test/run
+1
-0
No files found.
lib/binaries.sh
View file @
11721a03
...
@@ -27,7 +27,7 @@ install_yarn() {
...
@@ -27,7 +27,7 @@ install_yarn() {
# log out when the new logic fails
# log out when the new logic fails
if
[[
"
$resolve_result
"
==
"failed"
]]
;
then
if
[[
"
$resolve_result
"
==
"failed"
]]
;
then
meta_set
"resolve-failed"
"true"
meta_set
"resolve-failed
-yarn
"
"true"
fi
fi
echo
"Downloading and installing yarn (
$number
)..."
echo
"Downloading and installing yarn (
$number
)..."
...
@@ -51,14 +51,31 @@ install_nodejs() {
...
@@ -51,14 +51,31 @@ install_nodejs() {
local
version
=
${
1
:-
10
.x
}
local
version
=
${
1
:-
10
.x
}
local dir
=
"
${
2
:?
}
"
local dir
=
"
${
2
:?
}
"
local
platform
=
"
$3
"
local
platform
=
"
$3
"
local
code os cpu
local
code os cpu
nodebin_result resolve_result
os
=
$(
get_os
)
os
=
$(
get_os
)
cpu
=
$(
get_cpu
)
cpu
=
$(
get_cpu
)
echo
"Resolving node version
$version
..."
echo
"Resolving node version
$version
..."
if
!
read
-r
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
nodebin_result
=
$(
curl
--silent
--fail
--get
--retry
5
--retry-max-time
15
--data-urlencode
"range=
$version
"
"https://nodebin.herokai.com/v1/node/
$platform
/latest.txt"
||
echo
"failed"
)
fail_bin_install node
"
$version
"
"
$platform
"
;
resolve_result
=
$(
$RESOLVE
node
"
$version
"
||
echo
"failed"
)
read
-r
number url < <
(
echo
"
$nodebin_result
"
)
if
[[
"
$nodebin_result
"
==
"failed"
]]
;
then
fail_bin_install node
"
$version
"
"
$platform
"
fi
# log out whether the new logic matches the old logic
if
[[
"
$nodebin_result
"
!=
"
$resolve_result
"
]]
;
then
meta_set
"resolve-matches-nodebin-node"
"false"
else
meta_set
"resolve-matches-nodebin-node"
"true"
fi
# log out when the new logic fails
if
[[
"
$resolve_result
"
==
"failed"
]]
;
then
meta_set
"resolve-failed-node"
"true"
fi
fi
echo
"Downloading and installing node
$number
..."
echo
"Downloading and installing node
$number
..."
...
...
test/run
View file @
11721a03
...
@@ -1085,6 +1085,7 @@ testBuildMetaData() {
...
@@ -1085,6 +1085,7 @@ testBuildMetaData() {
# log resolve logic dark-launch
# log resolve logic dark-launch
assertFileContains
"resolve-matches-nodebin-yarn=true"
$log_file
assertFileContains
"resolve-matches-nodebin-yarn=true"
$log_file
assertFileContains
"resolve-matches-nodebin-node=true"
$log_file
}
}
testFailingBuildMetaData
()
{
testFailingBuildMetaData
()
{
...
...
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