Skip to content

Commit

Permalink
container_build.py: add verbose option
Browse files Browse the repository at this point in the history
This is the same idea as in build.py (and in fact we use
the env variable to do it, so in a sense it's not really
necessary to have an option, but I think this looks cleaner).
  • Loading branch information
chris3torek committed Jul 19, 2017
1 parent 5366523 commit 885b24f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions container_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ def shell_quote(cmd):


def run_docker_cmd(cmd):
run_cmd('docker run -e CXX -e DEBUG -e SANITIZE --rm -t '
run_cmd('docker run -e V -e CXX -e DEBUG -e SANITIZE --rm -t '
'-u %d:%d -v %s:%s %s sh -c %s' %
(os.getuid(), os.getgid(), BESS_DIR_HOST, BESS_DIR_CONTAINER,
IMAGE, shell_quote(cmd)))


def run_shell():
run_cmd('docker run -e CXX -e DEBUG -e SANITIZE --rm -it -v %s:%s %s' %
run_cmd('docker run -e V -e CXX -e DEBUG -e SANITIZE --rm -it -v %s:%s %s' %
(BESS_DIR_HOST, BESS_DIR_CONTAINER, IMAGE))


Expand Down Expand Up @@ -100,8 +100,12 @@ def main():
default='all',
choices=cmdlist,
help='Action is one of ' + ', '.join(cmdlist))
parser.add_argument('-v', '--verbose', action='store_true',
help='pass verbose flag to build inside container')

args = parser.parse_args()
if args.verbose:
os.environ['V'] = '1'

cmds[args.action]()

Expand Down

0 comments on commit 885b24f

Please sign in to comment.