Skip to content

Commit

Permalink
Merge pull request #14684 from knobunc/feature/fix-image-build
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored Jun 20, 2017
2 parents 1d4dd0d + 1b42143 commit f2be346
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions hack/build-local-images.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/env python

import sys
from shutil import copy, copytree, rmtree
from shutil import copy, rmtree
import distutils.dir_util as dir_util
from subprocess import call
from tempfile import mkdtemp

from atexit import register
from os import getenv, mkdir, remove
from os import getenv, listdir, mkdir, remove
from os.path import abspath, dirname, exists, isdir, join

if len(sys.argv) > 1 and sys.argv[1] in ['-h', '--h', '-help', '--help']:
Expand Down Expand Up @@ -170,11 +171,10 @@ def add_to_context(context_dir, source, destination, container_destination):
container_destination)
)
absolute_destination = abspath(join(context_dir, destination))
if not exists(absolute_destination):
if isdir(source):
copytree(source, absolute_destination)
else:
copy(source, absolute_destination)
if isdir(source):
dir_util.copy_tree(source, absolute_destination)
else:
copy(source, absolute_destination)
with open(join(context_dir, "Dockerfile"), "a") as dockerfile:
dockerfile.write("ADD {} {}\n".format(destination, container_destination))

Expand Down

0 comments on commit f2be346

Please sign in to comment.