Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
heroku-buildpack-static
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Python-Dev
heroku-buildpack-static
Commits
70578df9
Commit
70578df9
authored
Jun 04, 2015
by
Terence Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mount the app for each build vs building a new image
parent
773c9e1b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
36 deletions
+5
-36
Dockerfile
Dockerfile
+1
-3
app_runner.rb
spec/support/app_runner.rb
+4
-33
No files found.
Dockerfile
View file @
70578df9
...
...
@@ -12,6 +12,4 @@ ENV HOME /app
ENV
PORT 3000
EXPOSE
3000
ONBUILD
WORKDIR
/app/
ONBUILD
COPY
. /app/
ONBUILD
CMD
/app/bin/boot
WORKDIR
/app
spec/support/app_runner.rb
View file @
70578df9
...
...
@@ -16,10 +16,11 @@ class AppRunner
def
initialize
(
fixture
,
debug
=
false
)
@debug
=
debug
@image
=
build_image
(
fixture
)
@container
=
Docker
::
Container
.
create
(
'Image'
=>
@image
.
id
,
'Image'
=>
BuildpackBuilder
::
TAG
,
'Cmd'
=>
[
"bash"
,
"-c"
,
"cp -rf /src/* /app/ && /app/bin/boot"
],
'HostConfig'
=>
{
'Binds'
=>
[
"
#{
fixtures_path
(
fixture
)
}
:/src"
],
'PortBindings'
=>
{
"
#{
CONTAINER_PORT
}
/tcp"
=>
[{
"HostIp"
=>
HOST_IP
,
...
...
@@ -62,10 +63,7 @@ class AppRunner
end
def
destroy
unless
@debug
@container
.
delete
(
force:
true
)
@image
.
remove
(
force:
true
)
end
@container
.
delete
(
force:
true
)
unless
@debug
end
private
...
...
@@ -79,31 +77,4 @@ class AppRunner
retry
end
end
def
build_image
(
fixture
)
image
=
nil
Dir
.
mktmpdir
do
|
tmpdir
|
print_output
=
if
@debug
->
(
chunk
)
{
json
=
JSON
.
parse
(
chunk
)
puts
json
[
"stream"
]
}
else
->
(
chunk
)
{
nil
}
end
FileUtils
.
cp_r
(
Dir
.
glob
(
fixtures_path
(
fixture
)
+
"*"
),
tmpdir
)
dockerfile
=
"
#{
tmpdir
}
/Dockerfile"
unless
File
.
exist?
(
dockerfile
)
File
.
open
(
dockerfile
,
"w"
)
do
|
file
|
file
.
puts
"FROM
#{
BuildpackBuilder
::
TAG
}
"
end
end
image
=
Docker
::
Image
.
build_from_dir
(
tmpdir
,
'rm'
=>
true
,
&
print_output
)
end
image
end
end
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