From 8d6cfd9fc1143e94978ce01025ef3a9c08bb1a11 Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Wed, 27 Jan 2016 10:18:34 -0800 Subject: [PATCH] Add automatic build execution. --- .bashrc | 6 +++++- Makefile | 2 +- docker/tools/onlbuilder | 7 +++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index 8526d6d1..1bbf65dd 100644 --- a/.bashrc +++ b/.bashrc @@ -13,4 +13,8 @@ . setup.env -echo Ready to build OpenNetworkLinux. +if [ -n "$ONL_AUTOBUILD" ]; then + make all +else + echo Ready to build OpenNetworkLinux. +fi diff --git a/Makefile b/Makefile index 62d86c21..e59bd617 100644 --- a/Makefile +++ b/Makefile @@ -42,4 +42,4 @@ docker_check: @which docker > /dev/null || (echo "*** Docker appears to be missing. Please install docker.io in order to build OpenNetworkLinux." && exit 1) docker: docker_check - @docker/tools/onlbuilder -$(VERSION) --isolate --hostname onlbuilder$(VERSION) --pull + @docker/tools/onlbuilder -$(VERSION) --isolate --hostname onlbuilder$(VERSION) --pull --autobuild diff --git a/docker/tools/onlbuilder b/docker/tools/onlbuilder index 3cde708a..04ec4ae4 100755 --- a/docker/tools/onlbuilder +++ b/docker/tools/onlbuilder @@ -96,6 +96,10 @@ ap.add_argument("--volumes", metavar='DIRECTORY', default=[]) +ap.add_argument("--autobuild", + help="Automatic build in isolation mode.", + action='store_true') + ap.add_argument("--command", "-c", help="Explicit command to run. All arguments after -c are considered to be part of the command.", nargs=argparse.REMAINDER, @@ -171,6 +175,9 @@ else: if ops.hostname: g_docker_arguments += " -h %s" % ops.hostname + if ops.autobuild: + g_docker_arguments += " -e ONL_AUTOBUILD=1 " + else: # Development host mode g_docker_arguments += "-e USER=%(username)s --net host -w %(workdir)s " % g_arg_d