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
ef57f219
Commit
ef57f219
authored
Sep 10, 2013
by
zeke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bring caching back
parent
b8a6635f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
25 deletions
+23
-25
compile
bin/compile
+17
-18
test
bin/test
+5
-5
package.json
test/node-modules-caching/package.json
+1
-2
No files found.
bin/compile
View file @
ef57f219
...
@@ -62,31 +62,30 @@ cache_store_dir="$cache_dir/node_modules/$node_version"
...
@@ -62,31 +62,30 @@ cache_store_dir="$cache_dir/node_modules/$node_version"
cache_target_dir
=
"
$build_dir
/node_modules"
cache_target_dir
=
"
$build_dir
/node_modules"
# Restore node_modules from cache, if present
# Restore node_modules from cache, if present
# if [ -d $cache_store_dir ]; then
if
[
-d
$cache_store_dir
]
;
then
# status "Restoring node_modules cache"
status
"Restoring node_modules cache"
# if [ -d $cache_target_dir ]; then
if
[
-d
$cache_target_dir
]
;
then
# cp -r $cache_store_dir/* $cache_target_dir/
cp
-r
$cache_store_dir
/
*
$cache_target_dir
/
# else
else
# cp -r $cache_store_dir $cache_target_dir
cp
-r
$cache_store_dir
$cache_target_dir
# fi
fi
# status "Pruning any unused dependencies"
status
"Pruning any unused dependencies"
# npm prune
npm prune
# fi
fi
cd
$build_dir
# Install dependencies
# Install dependencies
status
"Installing dependencies"
status
"Installing dependencies"
cd
$build_dir
npm
install
--production
npm
install
--production
npm rebuild
npm rebuild
# Cache node_modules for future builds
# Cache node_modules for future builds
#
if [ -d $cache_target_dir ]; then
if
[
-d
$cache_target_dir
]
;
then
#
status "Caching node_modules for future builds"
status
"Caching node_modules for future builds"
#
rm -rf $cache_store_dir
rm
-rf
$cache_store_dir
#
mkdir -p $(dirname $cache_store_dir)
mkdir
-p
$(
dirname
$cache_store_dir
)
#
cp -r $cache_target_dir $cache_store_dir
cp
-r
$cache_target_dir
$cache_store_dir
#
fi
fi
# Update the PATH
# Update the PATH
status
"Building runtime environment"
status
"Building runtime environment"
...
...
bin/test
View file @
ef57f219
...
@@ -51,11 +51,11 @@ testProfileCreated() {
...
@@ -51,11 +51,11 @@ testProfileCreated() {
assertCapturedSuccess
assertCapturedSuccess
}
}
#
testNodeModulesCached() {
testNodeModulesCached
()
{
#
cache=$(mktmpdir)
cache
=
$(
mktmpdir
)
#
compile "node-modules-caching" $cache
compile
"node-modules-caching"
$cache
# assertEquals "1" "$(ls -1 $cache/node_modules/0.10.17
| wc -l)"
assertEquals
"1"
"
$(
ls
-1
$cache
/node_modules/0.10.18
|
wc
-l
)
"
#
}
}
## utils ########################################
## utils ########################################
...
...
test/node-modules-caching/package.json
View file @
ef57f219
...
@@ -7,8 +7,7 @@
...
@@ -7,8 +7,7 @@
"url"
:
"http://github.com/example/example.git"
"url"
:
"http://github.com/example/example.git"
},
},
"engines"
:
{
"engines"
:
{
"node"
:
"0.10.15"
,
"node"
:
"0.10.18"
"npm"
:
"1.3.5"
},
},
"dependencies"
:
{
"dependencies"
:
{
"express"
:
"latest"
"express"
:
"latest"
...
...
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