Simple code review changes.
I sneakily also added local-test.sh and renamed run-local to local-run.sh.
This commit is contained in:
parent
0763f0d999
commit
d0763862b1
8 changed files with 27 additions and 25 deletions
|
@ -17,13 +17,13 @@ class BuildPackage(object):
|
|||
|
||||
def __init__(self, requests_file):
|
||||
self._mime_processors = {
|
||||
'application/zip': BuildPackage.__prepare_zip,
|
||||
'application/x-zip-compressed': BuildPackage.__prepare_zip,
|
||||
'text/plain': BuildPackage.__prepare_dockerfile,
|
||||
'application/octet-stream': BuildPackage.__prepare_dockerfile,
|
||||
'application/x-tar': BuildPackage.__prepare_tarball,
|
||||
'application/gzip': BuildPackage.__prepare_tarball,
|
||||
'application/x-gzip': BuildPackage.__prepare_tarball,
|
||||
'application/zip': BuildPackage._prepare_zip,
|
||||
'application/x-zip-compressed': BuildPackage._prepare_zip,
|
||||
'text/plain': BuildPackage._prepare_dockerfile,
|
||||
'application/octet-stream': BuildPackage._prepare_dockerfile,
|
||||
'application/x-tar': BuildPackage._prepare_tarball,
|
||||
'application/gzip': BuildPackage._prepare_tarball,
|
||||
'application/x-gzip': BuildPackage._prepare_tarball,
|
||||
}
|
||||
|
||||
c_type = requests_file.headers['content-type']
|
||||
|
@ -57,7 +57,7 @@ class BuildPackage(object):
|
|||
return BuildPackage(buildpack_resource)
|
||||
|
||||
@staticmethod
|
||||
def __prepare_zip(request_file):
|
||||
def _prepare_zip(request_file):
|
||||
build_dir = mkdtemp(prefix='docker-build-')
|
||||
|
||||
# Save the zip file to temp somewhere
|
||||
|
@ -69,7 +69,7 @@ class BuildPackage(object):
|
|||
return build_dir
|
||||
|
||||
@staticmethod
|
||||
def __prepare_dockerfile(request_file):
|
||||
def _prepare_dockerfile(request_file):
|
||||
build_dir = mkdtemp(prefix='docker-build-')
|
||||
dockerfile_path = os.path.join(build_dir, "Dockerfile")
|
||||
with open(dockerfile_path, 'w') as dockerfile:
|
||||
|
@ -78,7 +78,7 @@ class BuildPackage(object):
|
|||
return build_dir
|
||||
|
||||
@staticmethod
|
||||
def __prepare_tarball(request_file):
|
||||
def _prepare_tarball(request_file):
|
||||
build_dir = mkdtemp(prefix='docker-build-')
|
||||
|
||||
# Save the zip file to temp somewhere
|
||||
|
|
Reference in a new issue