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
36ad8a3b
Commit
36ad8a3b
authored
Jan 21, 2014
by
zeke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update compile script to work with new buildpack-env-dir API
parent
26c18bce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
9 deletions
+23
-9
common.sh
bin/common.sh
+13
-0
compile
bin/compile
+4
-4
test
bin/test
+6
-5
No files found.
bin/common.sh
View file @
36ad8a3b
...
...
@@ -28,3 +28,16 @@ indent() {
cat_npm_debug_log
()
{
test
-f
$build_dir
/npm-debug.log
&&
cat
$build_dir
/npm-debug.log
}
export_env_dir
()
{
env_dir
=
$1
whitelist_regex
=
${
2
:-
''
}
blacklist_regex
=
${
3
:-
'^(PATH|GIT_DIR|CPATH|CPPATH|LD_PRELOAD|LIBRARY_PATH)$'
}
if
[
-d
"
$env_dir
"
]
;
then
for
e
in
$(
ls
$env_dir
)
;
do
echo
"
$e
"
|
grep
-E
"
$whitelist_regex
"
|
grep
-qvE
"
$blacklist_regex
"
&&
export
"
$e
=
$(
cat
$env_dir
/
$e
)
"
:
done
fi
}
bin/compile
View file @
36ad8a3b
...
...
@@ -7,7 +7,7 @@ set -o pipefail # don't ignore exit codes when piping output
# Configure directories
build_dir
=
$1
cache_dir
=
$2
env_
file
=
$3
env_
dir
=
$3
bp_dir
=
$(
cd
$(
dirname
$0
)
;
cd
..
;
pwd
)
...
...
@@ -71,9 +71,9 @@ fi
# Scope config var availability only to `npm install`
(
if
[
"
$env_file
"
]
;
then
status
"
Importing application config vars
"
export
$(
egrep
-v
"^(PATH|GIT_DIR|CPATH|CPPATH|LD_PRELOAD|LIBRARY_PATH)"
"
$env_file
"
)
if
[
-d
"
$env_dir
"
]
;
then
status
"
Exporting config vars to environment
"
export
_env_dir
$env_dir
fi
status
"Installing dependencies"
...
...
bin/test
View file @
36ad8a3b
...
...
@@ -117,11 +117,12 @@ testEnvfileNotImported() {
assertCapturedSuccess
}
testEnvfileImported
()
{
env_file
=
$(
mktemp
)
echo
"FOO=1"
>
$env_file
compile
"stable-node"
"
$(
mktmpdir
)
"
$env_file
assertCaptured
"Importing application config vars"
testEnvDirExported
()
{
env_dir
=
$(
mktmpdir
)
echo
"chicken"
>
$env_dir
/birds
echo
"koi"
>
$env_dir
/fish
compile
"stable-node"
"
$(
mktmpdir
)
"
$env_dir
assertCaptured
"Exporting config vars to environment"
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