diff options
-rw-r--r-- | README.md | 14 | ||||
-rw-r--r-- | rbuild.py | 10 |
2 files changed, 13 insertions, 11 deletions
@@ -85,21 +85,21 @@ WantedBy=timers.target ## Usage ``` -usage: rbuild.py [-h] [--build-period BUILD_PERIOD] [--up-timeout-period UP_TIMEOUT_PERIOD] [--force-rebuild] [--remove-images] filename +usage: rbuild.py [-h] [--build-period BUILD_PERIOD] [--up-timeout-period UP_TIMEOUT_PERIOD] [--force-rebuild] [--remove-images] filename [filename ...] -Automatically rebuild a series of containers using Docker Compose. +Automatically rebuild a series of containers with docker compose. positional arguments: filename The docker-compose file to use. options: - -h, --help Show this help message and exit. + -h, --help show this help message and exit --build-period BUILD_PERIOD - Rebuild period in seconds. + Time images are allowed to live (in seconds.) --up-timeout-period UP_TIMEOUT_PERIOD - Timeout period for bringing up containers in seconds. - --force-rebuild Force a rebuild of all containers. - --remove-images Remove all existing images. + Up timeout period in seconds. + --force-rebuild Force all containers to be rebuilt + --remove-images Remove all images ``` ## License @@ -164,7 +164,7 @@ if __name__ == '__main__': parser = argparse.ArgumentParser(description='Automatically rebuild a series of containers with docker compose.') - parser.add_argument('filename', type=str, help='The docker-compose file to use.') + parser.add_argument('filename', type=str, nargs='+', help='The docker-compose file to use.') parser.add_argument('--build-period', type=int, default=BUILD_TTL, help='Time images are allowed to live (in seconds.)') parser.add_argument('--up-timeout-period', type=int, default=UP_TIMEOUT_PERIOD, help='Up timeout period in seconds.') @@ -185,8 +185,10 @@ if __name__ == '__main__': if args.remove_images and args.force_rebuild: die("Error: --remove-images cannot be used with --force-rebuild") - if args.remove_images: - remove_main(args.filename) + for filename in args.filename: - build_main(args.filename, force_rebuild=args.force_rebuild) + if args.remove_images: + remove_main(filename) + + build_main(filename, force_rebuild=args.force_rebuild) |